15 lines
358 B
Python
15 lines
358 B
Python
import httpx
|
|||
|
|
|
||
|
|
def summarize(incident, metrics):
|
||
|
|
payload = {
|
||
|
|
"model": "mistral",
|
||
|
|
"prompt": INCIDENT_SUMMARY_PROMPT.format(
|
||
|
|
incident=incident,
|
||
|
|
metrics=metrics,
|
||
|
|
),
|
||
|
|
"stream": False,
|
||
|
|
}
|
||
|
|
|
||
|
|
r = httpx.post("http://ollama:11434/api/generate", json=payload, timeout=30)
|
||
|
|
return r.json()["response"]
|