ovid-core 0.1.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.
Files changed (182) hide show
  1. ovid_core-0.1.0/LICENSE +21 -0
  2. ovid_core-0.1.0/PKG-INFO +304 -0
  3. ovid_core-0.1.0/README.md +266 -0
  4. ovid_core-0.1.0/pyproject.toml +187 -0
  5. ovid_core-0.1.0/pyproject.toml.orig +187 -0
  6. ovid_core-0.1.0/src/ovid_core/__init__.py +83 -0
  7. ovid_core-0.1.0/src/ovid_core/adapters/__init__.py +0 -0
  8. ovid_core-0.1.0/src/ovid_core/adapters/pydantic_ai/__init__.py +19 -0
  9. ovid_core-0.1.0/src/ovid_core/adapters/pydantic_ai/_agent_errors.py +53 -0
  10. ovid_core-0.1.0/src/ovid_core/adapters/pydantic_ai/_agent_runtime.py +205 -0
  11. ovid_core-0.1.0/src/ovid_core/adapters/pydantic_ai/_agent_stream.py +234 -0
  12. ovid_core-0.1.0/src/ovid_core/adapters/pydantic_ai/_codex_http.py +107 -0
  13. ovid_core-0.1.0/src/ovid_core/adapters/pydantic_ai/_deferred_tools.py +140 -0
  14. ovid_core-0.1.0/src/ovid_core/adapters/pydantic_ai/_events.py +79 -0
  15. ovid_core-0.1.0/src/ovid_core/adapters/pydantic_ai/_extension_validation.py +39 -0
  16. ovid_core-0.1.0/src/ovid_core/adapters/pydantic_ai/_instruction_sources.py +28 -0
  17. ovid_core-0.1.0/src/ovid_core/adapters/pydantic_ai/_interrupted_replay.py +92 -0
  18. ovid_core-0.1.0/src/ovid_core/adapters/pydantic_ai/_journal.py +162 -0
  19. ovid_core-0.1.0/src/ovid_core/adapters/pydantic_ai/_provider_errors.py +60 -0
  20. ovid_core-0.1.0/src/ovid_core/adapters/pydantic_ai/_provider_retry.py +45 -0
  21. ovid_core-0.1.0/src/ovid_core/adapters/pydantic_ai/_request_parts.py +160 -0
  22. ovid_core-0.1.0/src/ovid_core/adapters/pydantic_ai/_response_parts.py +171 -0
  23. ovid_core-0.1.0/src/ovid_core/adapters/pydantic_ai/_run_input.py +130 -0
  24. ovid_core-0.1.0/src/ovid_core/adapters/pydantic_ai/_steering.py +94 -0
  25. ovid_core-0.1.0/src/ovid_core/adapters/pydantic_ai/_stream_events.py +231 -0
  26. ovid_core-0.1.0/src/ovid_core/adapters/pydantic_ai/_tool_collisions.py +78 -0
  27. ovid_core-0.1.0/src/ovid_core/adapters/pydantic_ai/_tool_context.py +62 -0
  28. ovid_core-0.1.0/src/ovid_core/adapters/pydantic_ai/_tool_execution.py +126 -0
  29. ovid_core-0.1.0/src/ovid_core/adapters/pydantic_ai/_tool_hooks.py +208 -0
  30. ovid_core-0.1.0/src/ovid_core/adapters/pydantic_ai/_usage_tracking.py +103 -0
  31. ovid_core-0.1.0/src/ovid_core/adapters/pydantic_ai/_user_content.py +104 -0
  32. ovid_core-0.1.0/src/ovid_core/adapters/pydantic_ai/ag_ui.py +178 -0
  33. ovid_core-0.1.0/src/ovid_core/adapters/pydantic_ai/agents.py +112 -0
  34. ovid_core-0.1.0/src/ovid_core/adapters/pydantic_ai/budget.py +16 -0
  35. ovid_core-0.1.0/src/ovid_core/adapters/pydantic_ai/capabilities.py +54 -0
  36. ovid_core-0.1.0/src/ovid_core/adapters/pydantic_ai/codex.py +226 -0
  37. ovid_core-0.1.0/src/ovid_core/adapters/pydantic_ai/compaction.py +151 -0
  38. ovid_core-0.1.0/src/ovid_core/adapters/pydantic_ai/effects.py +28 -0
  39. ovid_core-0.1.0/src/ovid_core/adapters/pydantic_ai/extensions.py +67 -0
  40. ovid_core-0.1.0/src/ovid_core/adapters/pydantic_ai/history.py +30 -0
  41. ovid_core-0.1.0/src/ovid_core/adapters/pydantic_ai/integrations.py +217 -0
  42. ovid_core-0.1.0/src/ovid_core/adapters/pydantic_ai/messages.py +161 -0
  43. ovid_core-0.1.0/src/ovid_core/adapters/pydantic_ai/models.py +176 -0
  44. ovid_core-0.1.0/src/ovid_core/adapters/pydantic_ai/results.py +167 -0
  45. ovid_core-0.1.0/src/ovid_core/adapters/pydantic_ai/routing.py +82 -0
  46. ovid_core-0.1.0/src/ovid_core/adapters/pydantic_ai/skills.py +43 -0
  47. ovid_core-0.1.0/src/ovid_core/adapters/pydantic_ai/tools.py +204 -0
  48. ovid_core-0.1.0/src/ovid_core/adapters/pydantic_ai/usage.py +56 -0
  49. ovid_core-0.1.0/src/ovid_core/adapters/pydantic_ai/web.py +50 -0
  50. ovid_core-0.1.0/src/ovid_core/adapters/pydantic_ai/web_read.py +95 -0
  51. ovid_core-0.1.0/src/ovid_core/adapters/starlette/__init__.py +1 -0
  52. ovid_core-0.1.0/src/ovid_core/adapters/starlette/ag_ui.py +108 -0
  53. ovid_core-0.1.0/src/ovid_core/adapters/starlette/app.py +216 -0
  54. ovid_core-0.1.0/src/ovid_core/adapters/starlette/http.py +137 -0
  55. ovid_core-0.1.0/src/ovid_core/agent_build.py +173 -0
  56. ovid_core-0.1.0/src/ovid_core/agent_definition.py +49 -0
  57. ovid_core-0.1.0/src/ovid_core/agent_runtime.py +215 -0
  58. ovid_core-0.1.0/src/ovid_core/agents.py +190 -0
  59. ovid_core-0.1.0/src/ovid_core/authentication/__init__.py +42 -0
  60. ovid_core-0.1.0/src/ovid_core/authentication/api_key.py +48 -0
  61. ovid_core-0.1.0/src/ovid_core/authentication/bindings.py +25 -0
  62. ovid_core-0.1.0/src/ovid_core/authentication/codex.py +161 -0
  63. ovid_core-0.1.0/src/ovid_core/authentication/contracts.py +57 -0
  64. ovid_core-0.1.0/src/ovid_core/authentication/models.py +92 -0
  65. ovid_core-0.1.0/src/ovid_core/authentication/providers.py +110 -0
  66. ovid_core-0.1.0/src/ovid_core/authentication/registry.py +108 -0
  67. ovid_core-0.1.0/src/ovid_core/capabilities/__init__.py +25 -0
  68. ovid_core-0.1.0/src/ovid_core/capabilities/base.py +89 -0
  69. ovid_core-0.1.0/src/ovid_core/capabilities/budget.py +36 -0
  70. ovid_core-0.1.0/src/ovid_core/capabilities/deferred.py +29 -0
  71. ovid_core-0.1.0/src/ovid_core/capabilities/history.py +16 -0
  72. ovid_core-0.1.0/src/ovid_core/capabilities/integrations.py +158 -0
  73. ovid_core-0.1.0/src/ovid_core/capabilities/specs.py +75 -0
  74. ovid_core-0.1.0/src/ovid_core/codex/__init__.py +12 -0
  75. ovid_core-0.1.0/src/ovid_core/codex/_browser.py +191 -0
  76. ovid_core-0.1.0/src/ovid_core/codex/_device.py +92 -0
  77. ovid_core-0.1.0/src/ovid_core/codex/_login.py +43 -0
  78. ovid_core-0.1.0/src/ovid_core/codex/_oauth.py +41 -0
  79. ovid_core-0.1.0/src/ovid_core/codex/auth.py +236 -0
  80. ovid_core-0.1.0/src/ovid_core/codex/catalog.py +47 -0
  81. ovid_core-0.1.0/src/ovid_core/codex/keyring.py +109 -0
  82. ovid_core-0.1.0/src/ovid_core/codex/models.py +59 -0
  83. ovid_core-0.1.0/src/ovid_core/codex/tokens.py +173 -0
  84. ovid_core-0.1.0/src/ovid_core/compaction/__init__.py +3 -0
  85. ovid_core-0.1.0/src/ovid_core/compaction/capability.py +46 -0
  86. ovid_core-0.1.0/src/ovid_core/compaction/models.py +12 -0
  87. ovid_core-0.1.0/src/ovid_core/config/__init__.py +10 -0
  88. ovid_core-0.1.0/src/ovid_core/config/migration.py +38 -0
  89. ovid_core-0.1.0/src/ovid_core/config/models.py +56 -0
  90. ovid_core-0.1.0/src/ovid_core/conversation_state.py +71 -0
  91. ovid_core-0.1.0/src/ovid_core/credentials/__init__.py +9 -0
  92. ovid_core-0.1.0/src/ovid_core/credentials/models.py +43 -0
  93. ovid_core-0.1.0/src/ovid_core/credentials/resolvers.py +32 -0
  94. ovid_core-0.1.0/src/ovid_core/errors.py +235 -0
  95. ovid_core-0.1.0/src/ovid_core/hooks/__init__.py +7 -0
  96. ovid_core-0.1.0/src/ovid_core/hooks/base.py +29 -0
  97. ovid_core-0.1.0/src/ovid_core/hooks/models.py +36 -0
  98. ovid_core-0.1.0/src/ovid_core/identifiers.py +9 -0
  99. ovid_core-0.1.0/src/ovid_core/journal.py +131 -0
  100. ovid_core-0.1.0/src/ovid_core/mcp/__init__.py +8 -0
  101. ovid_core-0.1.0/src/ovid_core/mcp/capability.py +63 -0
  102. ovid_core-0.1.0/src/ovid_core/mcp/models.py +57 -0
  103. ovid_core-0.1.0/src/ovid_core/messages/__init__.py +27 -0
  104. ovid_core-0.1.0/src/ovid_core/messages/content.py +53 -0
  105. ovid_core-0.1.0/src/ovid_core/messages/models.py +232 -0
  106. ovid_core-0.1.0/src/ovid_core/models.py +22 -0
  107. ovid_core-0.1.0/src/ovid_core/observability.py +10 -0
  108. ovid_core-0.1.0/src/ovid_core/persistence.py +149 -0
  109. ovid_core-0.1.0/src/ovid_core/plugins/__init__.py +20 -0
  110. ovid_core-0.1.0/src/ovid_core/plugins/activation.py +181 -0
  111. ovid_core-0.1.0/src/ovid_core/plugins/capability.py +46 -0
  112. ovid_core-0.1.0/src/ovid_core/plugins/discovery.py +86 -0
  113. ovid_core-0.1.0/src/ovid_core/plugins/host.py +124 -0
  114. ovid_core-0.1.0/src/ovid_core/plugins/models.py +45 -0
  115. ovid_core-0.1.0/src/ovid_core/plugins/registrar.py +223 -0
  116. ovid_core-0.1.0/src/ovid_core/policy.py +48 -0
  117. ovid_core-0.1.0/src/ovid_core/py.typed +0 -0
  118. ovid_core-0.1.0/src/ovid_core/read/__init__.py +20 -0
  119. ovid_core-0.1.0/src/ovid_core/read/capability.py +28 -0
  120. ovid_core-0.1.0/src/ovid_core/read/errors.py +14 -0
  121. ovid_core-0.1.0/src/ovid_core/read/handlers.py +98 -0
  122. ovid_core-0.1.0/src/ovid_core/read/models.py +121 -0
  123. ovid_core-0.1.0/src/ovid_core/read/registry.py +68 -0
  124. ovid_core-0.1.0/src/ovid_core/read/router.py +233 -0
  125. ovid_core-0.1.0/src/ovid_core/read/tool.py +102 -0
  126. ovid_core-0.1.0/src/ovid_core/read/window.py +53 -0
  127. ovid_core-0.1.0/src/ovid_core/recovery.py +107 -0
  128. ovid_core-0.1.0/src/ovid_core/relay/__init__.py +30 -0
  129. ovid_core-0.1.0/src/ovid_core/relay/_locking.py +22 -0
  130. ovid_core-0.1.0/src/ovid_core/relay/_state.py +40 -0
  131. ovid_core-0.1.0/src/ovid_core/relay/capability.py +30 -0
  132. ovid_core-0.1.0/src/ovid_core/relay/connection.py +73 -0
  133. ovid_core-0.1.0/src/ovid_core/relay/contracts.py +45 -0
  134. ovid_core-0.1.0/src/ovid_core/relay/errors.py +21 -0
  135. ovid_core-0.1.0/src/ovid_core/relay/memory.py +250 -0
  136. ovid_core-0.1.0/src/ovid_core/relay/models.py +42 -0
  137. ovid_core-0.1.0/src/ovid_core/relay/tools.py +163 -0
  138. ovid_core-0.1.0/src/ovid_core/routing/__init__.py +16 -0
  139. ovid_core-0.1.0/src/ovid_core/routing/factory.py +10 -0
  140. ovid_core-0.1.0/src/ovid_core/routing/models.py +85 -0
  141. ovid_core-0.1.0/src/ovid_core/routing/options.py +68 -0
  142. ovid_core-0.1.0/src/ovid_core/routing/router.py +93 -0
  143. ovid_core-0.1.0/src/ovid_core/runtime/__init__.py +20 -0
  144. ovid_core-0.1.0/src/ovid_core/runtime/context.py +16 -0
  145. ovid_core-0.1.0/src/ovid_core/runtime/events.py +138 -0
  146. ovid_core-0.1.0/src/ovid_core/runtime/identifiers.py +2 -0
  147. ovid_core-0.1.0/src/ovid_core/runtime/results.py +145 -0
  148. ovid_core-0.1.0/src/ovid_core/server/__init__.py +44 -0
  149. ovid_core-0.1.0/src/ovid_core/server/active_runs.py +222 -0
  150. ovid_core-0.1.0/src/ovid_core/server/ag_ui.py +22 -0
  151. ovid_core-0.1.0/src/ovid_core/server/app.py +53 -0
  152. ovid_core-0.1.0/src/ovid_core/server/contracts.py +136 -0
  153. ovid_core-0.1.0/src/ovid_core/server/conversations.py +218 -0
  154. ovid_core-0.1.0/src/ovid_core/server/errors.py +162 -0
  155. ovid_core-0.1.0/src/ovid_core/server/lifespan.py +28 -0
  156. ovid_core-0.1.0/src/ovid_core/server/models.py +100 -0
  157. ovid_core-0.1.0/src/ovid_core/server/registry.py +44 -0
  158. ovid_core-0.1.0/src/ovid_core/server/runtime.py +241 -0
  159. ovid_core-0.1.0/src/ovid_core/server/sessions.py +45 -0
  160. ovid_core-0.1.0/src/ovid_core/server/stdio.py +110 -0
  161. ovid_core-0.1.0/src/ovid_core/server/stdio_connection.py +245 -0
  162. ovid_core-0.1.0/src/ovid_core/server/stdio_models.py +102 -0
  163. ovid_core-0.1.0/src/ovid_core/services.py +169 -0
  164. ovid_core-0.1.0/src/ovid_core/sessions/__init__.py +7 -0
  165. ovid_core-0.1.0/src/ovid_core/sessions/hooks.py +56 -0
  166. ovid_core-0.1.0/src/ovid_core/sessions/runner.py +91 -0
  167. ovid_core-0.1.0/src/ovid_core/skills.py +126 -0
  168. ovid_core-0.1.0/src/ovid_core/todo/__init__.py +24 -0
  169. ovid_core-0.1.0/src/ovid_core/todo/_reducer_state.py +112 -0
  170. ovid_core-0.1.0/src/ovid_core/todo/capability.py +117 -0
  171. ovid_core-0.1.0/src/ovid_core/todo/errors.py +29 -0
  172. ovid_core-0.1.0/src/ovid_core/todo/models.py +208 -0
  173. ovid_core-0.1.0/src/ovid_core/todo/reducer.py +158 -0
  174. ovid_core-0.1.0/src/ovid_core/todo/service.py +49 -0
  175. ovid_core-0.1.0/src/ovid_core/todo/store.py +94 -0
  176. ovid_core-0.1.0/src/ovid_core/tools/__init__.py +20 -0
  177. ovid_core-0.1.0/src/ovid_core/tools/base.py +141 -0
  178. ovid_core-0.1.0/src/ovid_core/tools/deferred.py +96 -0
  179. ovid_core-0.1.0/src/ovid_core/tools/models.py +44 -0
  180. ovid_core-0.1.0/src/ovid_core/usage/__init__.py +5 -0
  181. ovid_core-0.1.0/src/ovid_core/usage/models.py +122 -0
  182. ovid_core-0.1.0/src/ovid_core/usage/tracking.py +92 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Galtozzy
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,304 @@
1
+ Metadata-Version: 2.4
2
+ Name: ovid-core
3
+ Version: 0.1.0
4
+ Summary: Shared compatibility, configuration, runtime, and extension layer for Ovid applications
5
+ Keywords: ai-agents,pydantic-ai,agent-framework,typed,asyncio
6
+ Author: Galtozzy
7
+ Author-email: Galtozzy <galtozzy+git@gmail.com>
8
+ License-Expression: MIT
9
+ License-File: LICENSE
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Operating System :: OS Independent
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.14
15
+ Classifier: Typing :: Typed
16
+ Requires-Dist: filelock>=4.3.0,<5.0.0
17
+ Requires-Dist: httpx2>=2.16.2,<3.0.0
18
+ Requires-Dist: genai-prices>=0.2.5,<0.3.0
19
+ Requires-Dist: keyring>=25.6.0,<26.0.0
20
+ Requires-Dist: packaging>=25.0,<26.0
21
+ Requires-Dist: pydantic-ai-harness[skills]>=0.71.0,<0.72.0
22
+ Requires-Dist: pydantic-ai-slim[anthropic,bedrock,bedrock-mantle,cohere,google,groq,huggingface,mcp,mistral,openai,openrouter,xai,zai]>=2.71.0,<3
23
+ Requires-Dist: starlette>=0.46.2,<2.0.0 ; extra == 'server'
24
+ Requires-Dist: uvicorn>=0.38.0,<1.0.0 ; extra == 'server'
25
+ Requires-Dist: ovid-core[server] ; extra == 'server-ag-ui'
26
+ Requires-Dist: pydantic-ai-slim[ag-ui]>=2.71.0,<2.72.0 ; extra == 'server-ag-ui'
27
+ Requires-Dist: pydantic-ai-slim[web-fetch]>=2.71.0,<2.72.0 ; extra == 'web-fetch'
28
+ Requires-Dist: pydantic-ai-slim[duckduckgo]>=2.71.0,<2.72.0 ; extra == 'web-search'
29
+ Requires-Python: >=3.14
30
+ Project-URL: Documentation, https://github.com/EzyGang/ovid-core/tree/main/docs/content
31
+ Project-URL: Issues, https://github.com/EzyGang/ovid-core/issues
32
+ Project-URL: Repository, https://github.com/EzyGang/ovid-core
33
+ Provides-Extra: server
34
+ Provides-Extra: server-ag-ui
35
+ Provides-Extra: web-fetch
36
+ Provides-Extra: web-search
37
+ Description-Content-Type: text/markdown
38
+
39
+ <h1 align="center">Ovid Core</h1>
40
+
41
+ <p align="center">
42
+ Typed building blocks for Python agent applications.
43
+ </p>
44
+
45
+ <p align="center">
46
+ <a href="https://www.python.org/downloads/"><img src="https://img.shields.io/badge/Python-3.14%2B-blue" alt="Python 3.14 or newer"></a>
47
+ <a href="pyproject.toml"><img src="https://img.shields.io/badge/version-0.1.0-indigo" alt="Version 0.1.0"></a>
48
+ <a href="https://github.com/EzyGang/ovid-core/actions/workflows/ci.yml"><img src="https://github.com/EzyGang/ovid-core/actions/workflows/ci.yml/badge.svg" alt="CI status"></a>
49
+ <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-green" alt="MIT license"></a>
50
+ </p>
51
+
52
+ ---
53
+
54
+ Ovid Core uses [Pydantic AI](https://ai.pydantic.dev/) for model calls, the agent loop, tools, structured output, streaming, and provider support.
55
+
56
+ Ovid Core adds stable types for application code. These types cover configuration, messages, results, usage, tools, storage, and transports. Ovid Core does not replace or fork Pydantic AI.
57
+
58
+ Installing the package does not start a server or add tools to an agent. Your application enables each optional feature.
59
+
60
+ **Documentation:** [docs/content/index.md](docs/content/index.md)
61
+ **Source:** https://github.com/EzyGang/ovid-core
62
+ **Native tools:** https://github.com/EzyGang/ovid-native
63
+
64
+ ---
65
+
66
+ ## Contents
67
+
68
+ - [When to use Ovid Core](#when-to-use-ovid-core)
69
+ - [Installation](#installation)
70
+ - [Quick start](#quick-start)
71
+ - [Features](#features)
72
+ - [Pydantic AI capabilities](#pydantic-ai-capabilities)
73
+ - [Server support](#server-support)
74
+ - [Application ownership](#application-ownership)
75
+ - [Development](#development)
76
+ - [Contributing](#contributing)
77
+ - [License](#license)
78
+
79
+ ## When to use Ovid Core
80
+
81
+ Use Pydantic AI directly when one small process owns the agent and upstream types can stay in that process.
82
+
83
+ Use Ovid Core when an agent is a shared application component. Workers, services, databases, command-line programs, and user interfaces can use the same agent definition and data contracts.
84
+
85
+ ```mermaid
86
+ graph LR
87
+ APP[Application] --> CORE[Ovid Core contracts]
88
+ CORE --> PAI[Pydantic AI]
89
+ PAI --> PROVIDER[Model provider]
90
+ ```
91
+
92
+ | Need | Direct Pydantic AI | Ovid Core |
93
+ | --- | --- | --- |
94
+ | Model selection | Model string or provider object | Names, aliases, routes, and fallbacks |
95
+ | Messages and results | Pydantic AI runtime values | Frozen Ovid models |
96
+ | Tools | Pydantic AI tools and toolsets | Typed tools, approvals, timeouts, and hooks |
97
+ | Usage limits | One upstream run | One budget across parent and child agents |
98
+ | Storage | Upstream messages or custom conversion | Normalized messages and a versioned codec |
99
+ | Transports | Application-built transport | Optional HTTP, SSE, stdio, and AG-UI adapters |
100
+ | Upstream changes | Update each caller | Update the Ovid adapter boundary |
101
+
102
+ This layer adds structure and another dependency. Do not use it for a small script that does not need shared contracts. Use it when agent data crosses a process, storage, transport, or team boundary.
103
+
104
+ Read [Why Ovid Core](docs/content/why-ovid-core.md) for a longer comparison.
105
+
106
+ ## Installation
107
+
108
+ Ovid Core requires Python 3.14 or newer.
109
+
110
+ With uv:
111
+
112
+ ```bash
113
+ uv add ovid-core
114
+ ```
115
+
116
+ With pip:
117
+
118
+ ```bash
119
+ pip install ovid-core
120
+ ```
121
+
122
+ Add native HTTP and SSE support only when needed:
123
+
124
+ ```bash
125
+ uv add 'ovid-core[server]'
126
+ ```
127
+
128
+ Add AG-UI support with:
129
+
130
+ ```bash
131
+ uv add 'ovid-core[server-ag-ui]'
132
+ ```
133
+
134
+ Add the local web search or the local web fetch with:
135
+
136
+ ```bash
137
+ uv add 'ovid-core[web-search]'
138
+ uv add 'ovid-core[web-fetch]'
139
+ ```
140
+
141
+ ## Quick start
142
+
143
+ The application constructs one final `OvidConfig`. It can parse TOML, JSON, YAML, or another source before validation.
144
+
145
+ Set the provider key:
146
+
147
+ ```bash
148
+ export OPENAI_API_KEY='...'
149
+ ```
150
+
151
+ On Windows PowerShell:
152
+
153
+ ```powershell
154
+ $env:OPENAI_API_KEY = '...'
155
+ ```
156
+
157
+ Create and run an agent:
158
+
159
+ ```python
160
+ import asyncio
161
+
162
+ from ovid_core import AgentDefinition, AgentFactory
163
+ from ovid_core.config import OvidConfig
164
+ from ovid_core.routing import ModelRef
165
+
166
+
167
+ async def main() -> None:
168
+ config = OvidConfig.model_validate(
169
+ {'models': {'primary': {'provider': 'openai', 'model': 'gpt-5'}}}
170
+ )
171
+ factory = AgentFactory(config=config)
172
+ agent = await factory.build(
173
+ AgentDefinition[None, str](
174
+ model=ModelRef(name='primary'),
175
+ deps_type=type(None),
176
+ output_type=str,
177
+ instructions=('Answer clearly. Do not invent facts.',),
178
+ )
179
+ )
180
+
181
+ result = await agent.run('What is 2 + 2?', deps=None)
182
+
183
+ print(result.output)
184
+ print(result.usage)
185
+ print(result.run_id)
186
+
187
+
188
+ asyncio.run(main())
189
+ ```
190
+
191
+ The result uses Ovid types. It contains the validated output, messages, usage, run ID, and conversation ID.
192
+
193
+ Read the [getting started guide](docs/content/getting-started.md) for provider keys, routes, streaming, and errors.
194
+
195
+ ## Features
196
+
197
+ ### Configuration and model routes
198
+
199
+ Give models local names such as `primary` or `fast`. Agent definitions use those names instead of provider strings. Routes can try another model after an eligible provider failure.
200
+
201
+ ### Typed agent definitions
202
+
203
+ `AgentDefinition[Deps, Output]` sets the model, dependencies, output, instructions, extensions, and run policy. Definitions are immutable.
204
+
205
+ ### Normalized runtime data
206
+
207
+ Runs return Ovid-owned messages, events, results, usage values, and identifiers. Application code does not need provider response types.
208
+
209
+ ### Tools and capabilities
210
+
211
+ Add only the tools an agent needs. Capabilities can add instructions, tools, toolsets, model settings, and service requirements. Duplicate IDs are errors.
212
+
213
+ Each tool supplies a default approval value.
214
+ Set `AgentDefinition.tool_approval` when the application must override that value for all Ovid tools.
215
+
216
+ ### Usage and policy
217
+
218
+ Apply request, token, and tool-call limits to one run or a nested workflow. Run policy also controls retries, timeouts, concurrency, and end behavior.
219
+
220
+ ### Relay and Todo
221
+
222
+ Relay gives application-owned agents a typed message channel. Todo stores phased work state through a replaceable backend. It emits a `todo.state` event after each change and can add an opt-in plan reminder to each model request. Applications must enable each capability.
223
+
224
+ ### Storage and transports
225
+
226
+ Use the conversation store protocol with your database. Optional adapters expose registered agents over HTTP, SSE, stdio, or AG-UI.
227
+
228
+ ## Pydantic AI capabilities
229
+
230
+ A normal Ovid agent can also use a Pydantic AI or Pydantic AI Harness capability:
231
+
232
+ ```python
233
+ from pydantic_ai_harness.planning import Planning
234
+
235
+ from ovid_core.adapters.pydantic_ai import pydantic_ai_capability
236
+ from ovid_native.search import SearchCapability
237
+
238
+
239
+ capabilities = (
240
+ SearchCapability[AppDependencies](),
241
+ pydantic_ai_capability(Planning()),
242
+ )
243
+ ```
244
+
245
+ The adapter passes the same capability instance to Pydantic AI. Upstream instructions, tools, ordering, deferred loading, run state, and lifecycle hooks keep their normal behavior. A deferred capability needs an explicit ID.
246
+
247
+ Upstream tools remain Pydantic AI tools. They do not gain Ovid approvals, Ovid result validation, service binding, or Ovid timeouts. Ovid tool hooks apply to them. Test any capability that changes models, messages, events, or durable execution through Ovid's public run and stream APIs.
248
+
249
+ Use Ovid capability types when you need the complete Ovid contract. See [Tools and capabilities](docs/content/api/extensions.md#pydantic-ai-capability-passthrough) for the boundary details.
250
+
251
+ ## Server support
252
+
253
+ Ovid Core can expose registered agents, but it is not a full web framework. The application still owns:
254
+
255
+ - authentication and authorization
256
+ - database setup and data retention
257
+ - TLS and network policy
258
+ - dependency construction
259
+ - deployment and process control
260
+ - telemetry export
261
+
262
+ Read [Embed and expose agents](docs/content/guides/embed-agents.md) before adding a transport.
263
+
264
+ ## Application ownership
265
+
266
+ Ovid Core does not discover configuration files, load application secrets, choose every tool, or create global services. The application passes one final configuration and selects each capability.
267
+
268
+ Install [ovid-native](https://github.com/EzyGang/ovid-native) for Rust-backed workspace tools. Ovid Core does not depend on it.
269
+
270
+ ## Development
271
+
272
+ Clone the repository, then run:
273
+
274
+ ```bash
275
+ uv sync
276
+ uv run task ruff
277
+ uv run task ty-lint
278
+ uv run task vulture
279
+ uv run task tests
280
+ uv run task docs-build
281
+ uv build
282
+ ```
283
+
284
+ Serve the documentation locally with:
285
+
286
+ ```bash
287
+ uv run task docs-run
288
+ ```
289
+
290
+ Ovid Core requires 100% branch coverage for its Python integration layer.
291
+
292
+ ## Contributing
293
+
294
+ 1. Open an issue for a large change or new public contract.
295
+ 2. Create a branch from `main`.
296
+ 3. Add tests for changed behavior.
297
+ 4. Run the development checks.
298
+ 5. Open a pull request that explains the reason for the change.
299
+
300
+ Keep provider runtime types inside adapters. Keep application policy in the application. See [AGENTS.md](AGENTS.md) for all repository rules.
301
+
302
+ ## License
303
+
304
+ Ovid Core is licensed under the [MIT License](LICENSE).
@@ -0,0 +1,266 @@
1
+ <h1 align="center">Ovid Core</h1>
2
+
3
+ <p align="center">
4
+ Typed building blocks for Python agent applications.
5
+ </p>
6
+
7
+ <p align="center">
8
+ <a href="https://www.python.org/downloads/"><img src="https://img.shields.io/badge/Python-3.14%2B-blue" alt="Python 3.14 or newer"></a>
9
+ <a href="pyproject.toml"><img src="https://img.shields.io/badge/version-0.1.0-indigo" alt="Version 0.1.0"></a>
10
+ <a href="https://github.com/EzyGang/ovid-core/actions/workflows/ci.yml"><img src="https://github.com/EzyGang/ovid-core/actions/workflows/ci.yml/badge.svg" alt="CI status"></a>
11
+ <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-green" alt="MIT license"></a>
12
+ </p>
13
+
14
+ ---
15
+
16
+ Ovid Core uses [Pydantic AI](https://ai.pydantic.dev/) for model calls, the agent loop, tools, structured output, streaming, and provider support.
17
+
18
+ Ovid Core adds stable types for application code. These types cover configuration, messages, results, usage, tools, storage, and transports. Ovid Core does not replace or fork Pydantic AI.
19
+
20
+ Installing the package does not start a server or add tools to an agent. Your application enables each optional feature.
21
+
22
+ **Documentation:** [docs/content/index.md](docs/content/index.md)
23
+ **Source:** https://github.com/EzyGang/ovid-core
24
+ **Native tools:** https://github.com/EzyGang/ovid-native
25
+
26
+ ---
27
+
28
+ ## Contents
29
+
30
+ - [When to use Ovid Core](#when-to-use-ovid-core)
31
+ - [Installation](#installation)
32
+ - [Quick start](#quick-start)
33
+ - [Features](#features)
34
+ - [Pydantic AI capabilities](#pydantic-ai-capabilities)
35
+ - [Server support](#server-support)
36
+ - [Application ownership](#application-ownership)
37
+ - [Development](#development)
38
+ - [Contributing](#contributing)
39
+ - [License](#license)
40
+
41
+ ## When to use Ovid Core
42
+
43
+ Use Pydantic AI directly when one small process owns the agent and upstream types can stay in that process.
44
+
45
+ Use Ovid Core when an agent is a shared application component. Workers, services, databases, command-line programs, and user interfaces can use the same agent definition and data contracts.
46
+
47
+ ```mermaid
48
+ graph LR
49
+ APP[Application] --> CORE[Ovid Core contracts]
50
+ CORE --> PAI[Pydantic AI]
51
+ PAI --> PROVIDER[Model provider]
52
+ ```
53
+
54
+ | Need | Direct Pydantic AI | Ovid Core |
55
+ | --- | --- | --- |
56
+ | Model selection | Model string or provider object | Names, aliases, routes, and fallbacks |
57
+ | Messages and results | Pydantic AI runtime values | Frozen Ovid models |
58
+ | Tools | Pydantic AI tools and toolsets | Typed tools, approvals, timeouts, and hooks |
59
+ | Usage limits | One upstream run | One budget across parent and child agents |
60
+ | Storage | Upstream messages or custom conversion | Normalized messages and a versioned codec |
61
+ | Transports | Application-built transport | Optional HTTP, SSE, stdio, and AG-UI adapters |
62
+ | Upstream changes | Update each caller | Update the Ovid adapter boundary |
63
+
64
+ This layer adds structure and another dependency. Do not use it for a small script that does not need shared contracts. Use it when agent data crosses a process, storage, transport, or team boundary.
65
+
66
+ Read [Why Ovid Core](docs/content/why-ovid-core.md) for a longer comparison.
67
+
68
+ ## Installation
69
+
70
+ Ovid Core requires Python 3.14 or newer.
71
+
72
+ With uv:
73
+
74
+ ```bash
75
+ uv add ovid-core
76
+ ```
77
+
78
+ With pip:
79
+
80
+ ```bash
81
+ pip install ovid-core
82
+ ```
83
+
84
+ Add native HTTP and SSE support only when needed:
85
+
86
+ ```bash
87
+ uv add 'ovid-core[server]'
88
+ ```
89
+
90
+ Add AG-UI support with:
91
+
92
+ ```bash
93
+ uv add 'ovid-core[server-ag-ui]'
94
+ ```
95
+
96
+ Add the local web search or the local web fetch with:
97
+
98
+ ```bash
99
+ uv add 'ovid-core[web-search]'
100
+ uv add 'ovid-core[web-fetch]'
101
+ ```
102
+
103
+ ## Quick start
104
+
105
+ The application constructs one final `OvidConfig`. It can parse TOML, JSON, YAML, or another source before validation.
106
+
107
+ Set the provider key:
108
+
109
+ ```bash
110
+ export OPENAI_API_KEY='...'
111
+ ```
112
+
113
+ On Windows PowerShell:
114
+
115
+ ```powershell
116
+ $env:OPENAI_API_KEY = '...'
117
+ ```
118
+
119
+ Create and run an agent:
120
+
121
+ ```python
122
+ import asyncio
123
+
124
+ from ovid_core import AgentDefinition, AgentFactory
125
+ from ovid_core.config import OvidConfig
126
+ from ovid_core.routing import ModelRef
127
+
128
+
129
+ async def main() -> None:
130
+ config = OvidConfig.model_validate(
131
+ {'models': {'primary': {'provider': 'openai', 'model': 'gpt-5'}}}
132
+ )
133
+ factory = AgentFactory(config=config)
134
+ agent = await factory.build(
135
+ AgentDefinition[None, str](
136
+ model=ModelRef(name='primary'),
137
+ deps_type=type(None),
138
+ output_type=str,
139
+ instructions=('Answer clearly. Do not invent facts.',),
140
+ )
141
+ )
142
+
143
+ result = await agent.run('What is 2 + 2?', deps=None)
144
+
145
+ print(result.output)
146
+ print(result.usage)
147
+ print(result.run_id)
148
+
149
+
150
+ asyncio.run(main())
151
+ ```
152
+
153
+ The result uses Ovid types. It contains the validated output, messages, usage, run ID, and conversation ID.
154
+
155
+ Read the [getting started guide](docs/content/getting-started.md) for provider keys, routes, streaming, and errors.
156
+
157
+ ## Features
158
+
159
+ ### Configuration and model routes
160
+
161
+ Give models local names such as `primary` or `fast`. Agent definitions use those names instead of provider strings. Routes can try another model after an eligible provider failure.
162
+
163
+ ### Typed agent definitions
164
+
165
+ `AgentDefinition[Deps, Output]` sets the model, dependencies, output, instructions, extensions, and run policy. Definitions are immutable.
166
+
167
+ ### Normalized runtime data
168
+
169
+ Runs return Ovid-owned messages, events, results, usage values, and identifiers. Application code does not need provider response types.
170
+
171
+ ### Tools and capabilities
172
+
173
+ Add only the tools an agent needs. Capabilities can add instructions, tools, toolsets, model settings, and service requirements. Duplicate IDs are errors.
174
+
175
+ Each tool supplies a default approval value.
176
+ Set `AgentDefinition.tool_approval` when the application must override that value for all Ovid tools.
177
+
178
+ ### Usage and policy
179
+
180
+ Apply request, token, and tool-call limits to one run or a nested workflow. Run policy also controls retries, timeouts, concurrency, and end behavior.
181
+
182
+ ### Relay and Todo
183
+
184
+ Relay gives application-owned agents a typed message channel. Todo stores phased work state through a replaceable backend. It emits a `todo.state` event after each change and can add an opt-in plan reminder to each model request. Applications must enable each capability.
185
+
186
+ ### Storage and transports
187
+
188
+ Use the conversation store protocol with your database. Optional adapters expose registered agents over HTTP, SSE, stdio, or AG-UI.
189
+
190
+ ## Pydantic AI capabilities
191
+
192
+ A normal Ovid agent can also use a Pydantic AI or Pydantic AI Harness capability:
193
+
194
+ ```python
195
+ from pydantic_ai_harness.planning import Planning
196
+
197
+ from ovid_core.adapters.pydantic_ai import pydantic_ai_capability
198
+ from ovid_native.search import SearchCapability
199
+
200
+
201
+ capabilities = (
202
+ SearchCapability[AppDependencies](),
203
+ pydantic_ai_capability(Planning()),
204
+ )
205
+ ```
206
+
207
+ The adapter passes the same capability instance to Pydantic AI. Upstream instructions, tools, ordering, deferred loading, run state, and lifecycle hooks keep their normal behavior. A deferred capability needs an explicit ID.
208
+
209
+ Upstream tools remain Pydantic AI tools. They do not gain Ovid approvals, Ovid result validation, service binding, or Ovid timeouts. Ovid tool hooks apply to them. Test any capability that changes models, messages, events, or durable execution through Ovid's public run and stream APIs.
210
+
211
+ Use Ovid capability types when you need the complete Ovid contract. See [Tools and capabilities](docs/content/api/extensions.md#pydantic-ai-capability-passthrough) for the boundary details.
212
+
213
+ ## Server support
214
+
215
+ Ovid Core can expose registered agents, but it is not a full web framework. The application still owns:
216
+
217
+ - authentication and authorization
218
+ - database setup and data retention
219
+ - TLS and network policy
220
+ - dependency construction
221
+ - deployment and process control
222
+ - telemetry export
223
+
224
+ Read [Embed and expose agents](docs/content/guides/embed-agents.md) before adding a transport.
225
+
226
+ ## Application ownership
227
+
228
+ Ovid Core does not discover configuration files, load application secrets, choose every tool, or create global services. The application passes one final configuration and selects each capability.
229
+
230
+ Install [ovid-native](https://github.com/EzyGang/ovid-native) for Rust-backed workspace tools. Ovid Core does not depend on it.
231
+
232
+ ## Development
233
+
234
+ Clone the repository, then run:
235
+
236
+ ```bash
237
+ uv sync
238
+ uv run task ruff
239
+ uv run task ty-lint
240
+ uv run task vulture
241
+ uv run task tests
242
+ uv run task docs-build
243
+ uv build
244
+ ```
245
+
246
+ Serve the documentation locally with:
247
+
248
+ ```bash
249
+ uv run task docs-run
250
+ ```
251
+
252
+ Ovid Core requires 100% branch coverage for its Python integration layer.
253
+
254
+ ## Contributing
255
+
256
+ 1. Open an issue for a large change or new public contract.
257
+ 2. Create a branch from `main`.
258
+ 3. Add tests for changed behavior.
259
+ 4. Run the development checks.
260
+ 5. Open a pull request that explains the reason for the change.
261
+
262
+ Keep provider runtime types inside adapters. Keep application policy in the application. See [AGENTS.md](AGENTS.md) for all repository rules.
263
+
264
+ ## License
265
+
266
+ Ovid Core is licensed under the [MIT License](LICENSE).