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