cortexdbai 0.5.0__tar.gz → 0.7.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/.gitignore +3 -3
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/PKG-INFO +7 -1
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/README.md +6 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/__init__.py +71 -71
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/v1/client.py +42 -1
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/pyproject.toml +1 -1
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/__init__.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/ag2/__init__.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/ag2/agent.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/ag2/tools.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/agno/__init__.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/agno/memory.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/agno/tools.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/autogen/__init__.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/autogen/agent.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/autogen/tools.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/beeai/__init__.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/beeai/memory.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/beeai/tools.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/camel/__init__.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/camel/memory.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/camel/tools.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/controlflow/__init__.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/controlflow/memory.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/crewai/__init__.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/crewai/memory.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/crewai/tools.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/deepinfra/__init__.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/deepinfra/config.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/deepinfra/embeddings.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/deepinfra/openai_compat.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/dify/__init__.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/dify/manifest.yaml +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/dify/tool.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/dspy/__init__.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/dspy/memory.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/dspy/retriever.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/fireworks/__init__.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/fireworks/config.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/fireworks/embeddings.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/fireworks/openai_compat.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/flowise/__init__.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/flowise/node.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/google_adk/__init__.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/google_adk/tools.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/groq/__init__.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/groq/config.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/groq/embeddings.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/groq/openai_compat.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/hermes/__init__.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/hermes/provider.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/instructor/__init__.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/instructor/memory.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/langchain/__init__.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/langchain/memory.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/langchain/retriever.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/langchain/tools.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/langgraph/__init__.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/langgraph/memory.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/letta/__init__.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/letta/storage.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/llamaindex/__init__.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/llamaindex/memory.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/nemo_guardrails/__init__.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/nemo_guardrails/actions.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/nemo_guardrails/knowledge_base.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/ollama/__init__.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/ollama/config.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/ollama/embeddings.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/openai_agents/__init__.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/openai_agents/tools.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/prefect/__init__.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/prefect/blocks.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/prefect/tasks.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/pydanticai/__init__.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/pydanticai/dependencies.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/pydanticai/tools.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/smolagents/__init__.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/smolagents/tools.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/temporal/__init__.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/temporal/activities.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/temporal/interceptor.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/together/__init__.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/together/config.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/together/embeddings.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/together/openai_compat.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/vllm/__init__.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/vllm/config.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/vllm/embeddings.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/vllm/openai_compat.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/py.typed +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/v1/__init__.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/v1/exceptions.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/tests/__init__.py +0 -0
- {cortexdbai-0.5.0 → cortexdbai-0.7.0}/tests/test_conflicts.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cortexdbai
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.7.0
|
|
4
4
|
Summary: The Long-Term Memory Layer for AI Systems
|
|
5
5
|
Project-URL: Homepage, https://cortexdb.ai
|
|
6
6
|
Project-URL: Documentation, https://docs.cortexdb.ai
|
|
@@ -173,6 +173,12 @@ print(c.recall(c.actor, query="what did I say?")["context_block"])
|
|
|
173
173
|
c.experience("ws:demo", text="Deployed payments-service v3.1 to prod.")
|
|
174
174
|
c.experience("ws:demo", text="Rolled back auth-gateway.", wait="indexed")
|
|
175
175
|
|
|
176
|
+
# Large content: wait="captured" returns at the durable accept point (~10ms);
|
|
177
|
+
# poll write_status to see indexing progress. After a client timeout,
|
|
178
|
+
# found=False or status="failed" both mean re-sending is safe (re-processes).
|
|
179
|
+
c.experience("ws:demo", text=big_transcript, idempotency_key="k1", wait="captured")
|
|
180
|
+
c.write_status(idempotency_key="k1") # {found, status, stages_completed, ...}
|
|
181
|
+
|
|
176
182
|
# Recall — returns a StratifiedPack { context_block, layers, provenance }.
|
|
177
183
|
pack = c.recall("ws:demo", query="recent deploys", view="holistic")
|
|
178
184
|
|
|
@@ -60,6 +60,12 @@ print(c.recall(c.actor, query="what did I say?")["context_block"])
|
|
|
60
60
|
c.experience("ws:demo", text="Deployed payments-service v3.1 to prod.")
|
|
61
61
|
c.experience("ws:demo", text="Rolled back auth-gateway.", wait="indexed")
|
|
62
62
|
|
|
63
|
+
# Large content: wait="captured" returns at the durable accept point (~10ms);
|
|
64
|
+
# poll write_status to see indexing progress. After a client timeout,
|
|
65
|
+
# found=False or status="failed" both mean re-sending is safe (re-processes).
|
|
66
|
+
c.experience("ws:demo", text=big_transcript, idempotency_key="k1", wait="captured")
|
|
67
|
+
c.write_status(idempotency_key="k1") # {found, status, stages_completed, ...}
|
|
68
|
+
|
|
63
69
|
# Recall — returns a StratifiedPack { context_block, layers, provenance }.
|
|
64
70
|
pack = c.recall("ws:demo", query="recent deploys", view="holistic")
|
|
65
71
|
|
|
@@ -1,71 +1,71 @@
|
|
|
1
|
-
"""CortexDB Python SDK — the long-term memory layer for AI systems.
|
|
2
|
-
|
|
3
|
-
The SDK is a thin HTTP client over the v1 API surface that cortexdb
|
|
4
|
-
exposes by default on port 3141. The top-level :class:`Cortex` class
|
|
5
|
-
(alias :class:`V1Client`) is what you should reach for.
|
|
6
|
-
|
|
7
|
-
Quick start::
|
|
8
|
-
|
|
9
|
-
from cortexdb import Cortex
|
|
10
|
-
|
|
11
|
-
# Local docker run with no auth (CORTEX_API_KEY unset on the server):
|
|
12
|
-
with Cortex("http://localhost:3141") as c:
|
|
13
|
-
c.experience("ws:demo", text="Priya at Acme signed for 200 seats.")
|
|
14
|
-
pack = c.recall("ws:demo", query="How many seats did Acme sign for?")
|
|
15
|
-
print(pack)
|
|
16
|
-
|
|
17
|
-
# Hosted / multi-tenant deployment with PASETO bearer + actor header:
|
|
18
|
-
with Cortex(
|
|
19
|
-
"https://api-v1.cortexdb.ai",
|
|
20
|
-
actor="user:alice",
|
|
21
|
-
bearer="eyJ...",
|
|
22
|
-
) as c:
|
|
23
|
-
out = c.answer(
|
|
24
|
-
"org:initech/user:alice",
|
|
25
|
-
question="What did Alice say about coffee?",
|
|
26
|
-
)
|
|
27
|
-
|
|
28
|
-
Versions ≤ 0.2.x exposed a separate ``cortexdb.Cortex`` class targeting
|
|
29
|
-
the legacy ``/v1/remember`` endpoints. That surface was retired in 0.3.0
|
|
30
|
-
because the cortexdb binary's public port now only serves the v1 API;
|
|
31
|
-
the legacy endpoints survive only as an internal bench-compat helper.
|
|
32
|
-
If you need them, pin ``cortexdbai<0.3``.
|
|
33
|
-
"""
|
|
34
|
-
|
|
35
|
-
from cortexdb.v1 import V1Client, AsyncV1Client
|
|
36
|
-
from cortexdb.v1.exceptions import (
|
|
37
|
-
V1APIError,
|
|
38
|
-
V1AuthError,
|
|
39
|
-
V1ConnectionError,
|
|
40
|
-
V1Error,
|
|
41
|
-
V1NotConfiguredError,
|
|
42
|
-
V1PolicyDeniedError,
|
|
43
|
-
V1RateLimitError,
|
|
44
|
-
V1TimeoutError,
|
|
45
|
-
)
|
|
46
|
-
from cortexdb import v1 # the explicit submodule namespace
|
|
47
|
-
|
|
48
|
-
# Ergonomic top-level aliases. New code can write either form.
|
|
49
|
-
Cortex = V1Client
|
|
50
|
-
AsyncCortex = AsyncV1Client
|
|
51
|
-
|
|
52
|
-
__version__ = "0.
|
|
53
|
-
__all__ = [
|
|
54
|
-
# Clients (preferred top-level names)
|
|
55
|
-
"Cortex",
|
|
56
|
-
"AsyncCortex",
|
|
57
|
-
# Explicit v1 names (identical classes, kept for code that pinned them)
|
|
58
|
-
"V1Client",
|
|
59
|
-
"AsyncV1Client",
|
|
60
|
-
# Submodule
|
|
61
|
-
"v1",
|
|
62
|
-
# Exceptions
|
|
63
|
-
"V1Error",
|
|
64
|
-
"V1APIError",
|
|
65
|
-
"V1AuthError",
|
|
66
|
-
"V1ConnectionError",
|
|
67
|
-
"V1TimeoutError",
|
|
68
|
-
"V1RateLimitError",
|
|
69
|
-
"V1NotConfiguredError",
|
|
70
|
-
"V1PolicyDeniedError",
|
|
71
|
-
]
|
|
1
|
+
"""CortexDB Python SDK — the long-term memory layer for AI systems.
|
|
2
|
+
|
|
3
|
+
The SDK is a thin HTTP client over the v1 API surface that cortexdb
|
|
4
|
+
exposes by default on port 3141. The top-level :class:`Cortex` class
|
|
5
|
+
(alias :class:`V1Client`) is what you should reach for.
|
|
6
|
+
|
|
7
|
+
Quick start::
|
|
8
|
+
|
|
9
|
+
from cortexdb import Cortex
|
|
10
|
+
|
|
11
|
+
# Local docker run with no auth (CORTEX_API_KEY unset on the server):
|
|
12
|
+
with Cortex("http://localhost:3141") as c:
|
|
13
|
+
c.experience("ws:demo", text="Priya at Acme signed for 200 seats.")
|
|
14
|
+
pack = c.recall("ws:demo", query="How many seats did Acme sign for?")
|
|
15
|
+
print(pack)
|
|
16
|
+
|
|
17
|
+
# Hosted / multi-tenant deployment with PASETO bearer + actor header:
|
|
18
|
+
with Cortex(
|
|
19
|
+
"https://api-v1.cortexdb.ai",
|
|
20
|
+
actor="user:alice",
|
|
21
|
+
bearer="eyJ...",
|
|
22
|
+
) as c:
|
|
23
|
+
out = c.answer(
|
|
24
|
+
"org:initech/user:alice",
|
|
25
|
+
question="What did Alice say about coffee?",
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
Versions ≤ 0.2.x exposed a separate ``cortexdb.Cortex`` class targeting
|
|
29
|
+
the legacy ``/v1/remember`` endpoints. That surface was retired in 0.3.0
|
|
30
|
+
because the cortexdb binary's public port now only serves the v1 API;
|
|
31
|
+
the legacy endpoints survive only as an internal bench-compat helper.
|
|
32
|
+
If you need them, pin ``cortexdbai<0.3``.
|
|
33
|
+
"""
|
|
34
|
+
|
|
35
|
+
from cortexdb.v1 import V1Client, AsyncV1Client
|
|
36
|
+
from cortexdb.v1.exceptions import (
|
|
37
|
+
V1APIError,
|
|
38
|
+
V1AuthError,
|
|
39
|
+
V1ConnectionError,
|
|
40
|
+
V1Error,
|
|
41
|
+
V1NotConfiguredError,
|
|
42
|
+
V1PolicyDeniedError,
|
|
43
|
+
V1RateLimitError,
|
|
44
|
+
V1TimeoutError,
|
|
45
|
+
)
|
|
46
|
+
from cortexdb import v1 # the explicit submodule namespace
|
|
47
|
+
|
|
48
|
+
# Ergonomic top-level aliases. New code can write either form.
|
|
49
|
+
Cortex = V1Client
|
|
50
|
+
AsyncCortex = AsyncV1Client
|
|
51
|
+
|
|
52
|
+
__version__ = "0.7.0"
|
|
53
|
+
__all__ = [
|
|
54
|
+
# Clients (preferred top-level names)
|
|
55
|
+
"Cortex",
|
|
56
|
+
"AsyncCortex",
|
|
57
|
+
# Explicit v1 names (identical classes, kept for code that pinned them)
|
|
58
|
+
"V1Client",
|
|
59
|
+
"AsyncV1Client",
|
|
60
|
+
# Submodule
|
|
61
|
+
"v1",
|
|
62
|
+
# Exceptions
|
|
63
|
+
"V1Error",
|
|
64
|
+
"V1APIError",
|
|
65
|
+
"V1AuthError",
|
|
66
|
+
"V1ConnectionError",
|
|
67
|
+
"V1TimeoutError",
|
|
68
|
+
"V1RateLimitError",
|
|
69
|
+
"V1NotConfiguredError",
|
|
70
|
+
"V1PolicyDeniedError",
|
|
71
|
+
]
|
|
@@ -384,6 +384,28 @@ class V1Client:
|
|
|
384
384
|
path = "/v1/experience" + (f"?wait={wait}" if wait else "")
|
|
385
385
|
return self._post(path, env)
|
|
386
386
|
|
|
387
|
+
def write_status(
|
|
388
|
+
self,
|
|
389
|
+
*,
|
|
390
|
+
idempotency_key: Optional[str] = None,
|
|
391
|
+
event_id: Optional[str] = None,
|
|
392
|
+
) -> dict:
|
|
393
|
+
"""``GET /v1/experience/status`` — did a write land, and how far has
|
|
394
|
+
it progressed? The safe resume path after a client-side timeout, and
|
|
395
|
+
the poll target after ``experience(..., wait="captured")``.
|
|
396
|
+
|
|
397
|
+
Returns ``{found, event_id, status, stages_completed, note}`` where
|
|
398
|
+
``status`` is ``"captured"`` / ``"indexed"`` / ``"failed"``.
|
|
399
|
+
``found: False`` (or ``status: "failed"``) means re-sending the same
|
|
400
|
+
write with the same ``idempotency_key`` is safe — it re-processes
|
|
401
|
+
rather than replaying."""
|
|
402
|
+
params: dict = {}
|
|
403
|
+
if idempotency_key is not None:
|
|
404
|
+
params["idempotency_key"] = idempotency_key
|
|
405
|
+
if event_id is not None:
|
|
406
|
+
params["event_id"] = event_id
|
|
407
|
+
return self._get("/v1/experience/status", params=params)
|
|
408
|
+
|
|
387
409
|
def upload_blob(
|
|
388
410
|
self, data: bytes, content_type: str = "application/octet-stream"
|
|
389
411
|
) -> dict:
|
|
@@ -478,6 +500,8 @@ class V1Client:
|
|
|
478
500
|
question_date: Optional[str] = None,
|
|
479
501
|
answer_model: Optional[str] = None,
|
|
480
502
|
answer_max_tokens: Optional[int] = None,
|
|
503
|
+
answer_instructions: Optional[str] = None,
|
|
504
|
+
cite_sources: bool = False,
|
|
481
505
|
use_pack_id: Optional[str] = None,
|
|
482
506
|
temporal: Optional[Mapping[str, Any]] = None,
|
|
483
507
|
diagnostics: str = "none",
|
|
@@ -488,6 +512,12 @@ class V1Client:
|
|
|
488
512
|
defaults to ``"none"`` so free-tier tokens don't hit the
|
|
489
513
|
``diagnostics.read`` gate. Pass ``"summary"`` or ``"full"`` when
|
|
490
514
|
you hold the elevated capability.
|
|
515
|
+
|
|
516
|
+
``answer_instructions`` is a prompt addendum appended to the server's
|
|
517
|
+
system prompt — control style, verbosity, and output format ("be
|
|
518
|
+
terse", "answer as markdown with curl examples", "respond in JSON").
|
|
519
|
+
It never affects retrieval. Max 4000 chars. Pair with
|
|
520
|
+
``question_type="docs-assistant"`` for documentation-support answers.
|
|
491
521
|
"""
|
|
492
522
|
body: dict = {
|
|
493
523
|
"scope": scope,
|
|
@@ -503,6 +533,10 @@ class V1Client:
|
|
|
503
533
|
body["answer_model"] = answer_model
|
|
504
534
|
if answer_max_tokens is not None:
|
|
505
535
|
body["answer_max_tokens"] = answer_max_tokens
|
|
536
|
+
if answer_instructions:
|
|
537
|
+
body["answer_instructions"] = answer_instructions
|
|
538
|
+
if cite_sources:
|
|
539
|
+
body["cite_sources"] = True
|
|
506
540
|
if use_pack_id:
|
|
507
541
|
body["use_pack_id"] = use_pack_id
|
|
508
542
|
if temporal:
|
|
@@ -998,11 +1032,14 @@ class AsyncV1Client:
|
|
|
998
1032
|
*,
|
|
999
1033
|
question_type: Optional[str] = None,
|
|
1000
1034
|
question_date: Optional[str] = None,
|
|
1035
|
+
answer_instructions: Optional[str] = None,
|
|
1036
|
+
cite_sources: bool = False,
|
|
1001
1037
|
view: str = "holistic",
|
|
1002
1038
|
diagnostics: str = "none",
|
|
1003
1039
|
) -> dict:
|
|
1004
1040
|
"""``POST /v1/answer``. ``diagnostics`` defaults to ``"none"`` so
|
|
1005
|
-
free-tier tokens succeed (audit FRI-1).
|
|
1041
|
+
free-tier tokens succeed (audit FRI-1). ``answer_instructions``:
|
|
1042
|
+
see :meth:`V1Client.answer`."""
|
|
1006
1043
|
body: dict = {
|
|
1007
1044
|
"scope": scope,
|
|
1008
1045
|
"view": view,
|
|
@@ -1013,6 +1050,10 @@ class AsyncV1Client:
|
|
|
1013
1050
|
body["question_type"] = question_type
|
|
1014
1051
|
if question_date:
|
|
1015
1052
|
body["question_date"] = question_date
|
|
1053
|
+
if answer_instructions:
|
|
1054
|
+
body["answer_instructions"] = answer_instructions
|
|
1055
|
+
if cite_sources:
|
|
1056
|
+
body["cite_sources"] = True
|
|
1016
1057
|
return await self._post("/v1/answer", body)
|
|
1017
1058
|
|
|
1018
1059
|
# ── conflicts + bi-temporal claims ────────────────────────────────
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cortexdbai-0.5.0 → cortexdbai-0.7.0}/cortexdb/integrations/nemo_guardrails/knowledge_base.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|