atlasbot: send snapshot as explicit context
This commit is contained in:
parent
864f1cab20
commit
241a8889ee
@ -16,7 +16,7 @@ spec:
|
|||||||
labels:
|
labels:
|
||||||
app: atlasbot
|
app: atlasbot
|
||||||
annotations:
|
annotations:
|
||||||
checksum/atlasbot-configmap: manual-atlasbot-46
|
checksum/atlasbot-configmap: manual-atlasbot-47
|
||||||
vault.hashicorp.com/agent-inject: "true"
|
vault.hashicorp.com/agent-inject: "true"
|
||||||
vault.hashicorp.com/role: "comms"
|
vault.hashicorp.com/role: "comms"
|
||||||
vault.hashicorp.com/agent-inject-secret-turn-secret: "kv/data/atlas/comms/turn-shared-secret"
|
vault.hashicorp.com/agent-inject-secret-turn-secret: "kv/data/atlas/comms/turn-shared-secret"
|
||||||
|
|||||||
@ -2124,11 +2124,9 @@ def _ollama_call(hist_key, prompt: str, *, context: str, use_history: bool = Tru
|
|||||||
endpoint = _ollama_endpoint()
|
endpoint = _ollama_endpoint()
|
||||||
if not endpoint:
|
if not endpoint:
|
||||||
raise RuntimeError("ollama endpoint missing")
|
raise RuntimeError("ollama endpoint missing")
|
||||||
system_content = system
|
messages: list[dict[str, str]] = [{"role": "system", "content": system}]
|
||||||
if context:
|
if context:
|
||||||
system_content += "\n\nContext (grounded):\n" + context[:MAX_CONTEXT_CHARS]
|
messages.append({"role": "user", "content": "Context (grounded):\n" + context[:MAX_CONTEXT_CHARS]})
|
||||||
|
|
||||||
messages: list[dict[str, str]] = [{"role": "system", "content": system_content}]
|
|
||||||
if use_history:
|
if use_history:
|
||||||
messages.extend(_history_to_messages(history[hist_key][-24:]))
|
messages.extend(_history_to_messages(history[hist_key][-24:]))
|
||||||
messages.append({"role": "user", "content": prompt})
|
messages.append({"role": "user", "content": prompt})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user