polos-sdk 0.1.0__py3-none-any.whl

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 (55) hide show
  1. polos/__init__.py +105 -0
  2. polos/agents/__init__.py +7 -0
  3. polos/agents/agent.py +746 -0
  4. polos/agents/conversation_history.py +121 -0
  5. polos/agents/stop_conditions.py +280 -0
  6. polos/agents/stream.py +635 -0
  7. polos/core/__init__.py +0 -0
  8. polos/core/context.py +143 -0
  9. polos/core/state.py +26 -0
  10. polos/core/step.py +1380 -0
  11. polos/core/workflow.py +1192 -0
  12. polos/features/__init__.py +0 -0
  13. polos/features/events.py +456 -0
  14. polos/features/schedules.py +110 -0
  15. polos/features/tracing.py +605 -0
  16. polos/features/wait.py +82 -0
  17. polos/llm/__init__.py +9 -0
  18. polos/llm/generate.py +152 -0
  19. polos/llm/providers/__init__.py +5 -0
  20. polos/llm/providers/anthropic.py +615 -0
  21. polos/llm/providers/azure.py +42 -0
  22. polos/llm/providers/base.py +196 -0
  23. polos/llm/providers/fireworks.py +41 -0
  24. polos/llm/providers/gemini.py +40 -0
  25. polos/llm/providers/groq.py +40 -0
  26. polos/llm/providers/openai.py +1021 -0
  27. polos/llm/providers/together.py +40 -0
  28. polos/llm/stream.py +183 -0
  29. polos/middleware/__init__.py +0 -0
  30. polos/middleware/guardrail.py +148 -0
  31. polos/middleware/guardrail_executor.py +253 -0
  32. polos/middleware/hook.py +164 -0
  33. polos/middleware/hook_executor.py +104 -0
  34. polos/runtime/__init__.py +0 -0
  35. polos/runtime/batch.py +87 -0
  36. polos/runtime/client.py +841 -0
  37. polos/runtime/queue.py +42 -0
  38. polos/runtime/worker.py +1365 -0
  39. polos/runtime/worker_server.py +249 -0
  40. polos/tools/__init__.py +0 -0
  41. polos/tools/tool.py +587 -0
  42. polos/types/__init__.py +23 -0
  43. polos/types/types.py +116 -0
  44. polos/utils/__init__.py +27 -0
  45. polos/utils/agent.py +27 -0
  46. polos/utils/client_context.py +41 -0
  47. polos/utils/config.py +12 -0
  48. polos/utils/output_schema.py +311 -0
  49. polos/utils/retry.py +47 -0
  50. polos/utils/serializer.py +167 -0
  51. polos/utils/tracing.py +27 -0
  52. polos/utils/worker_singleton.py +40 -0
  53. polos_sdk-0.1.0.dist-info/METADATA +650 -0
  54. polos_sdk-0.1.0.dist-info/RECORD +55 -0
  55. polos_sdk-0.1.0.dist-info/WHEEL +4 -0
polos/__init__.py ADDED
@@ -0,0 +1,105 @@
1
+ # Version is managed by hatch-vcs from git tags
2
+ __version__ = "0.1.0" # This will be replaced by hatch-vcs during build
3
+
4
+ # Core imports
5
+ from .agents.agent import (
6
+ Agent,
7
+ AgentStreamHandle,
8
+ StreamResult,
9
+ )
10
+ from .agents.stop_conditions import (
11
+ ExecutedToolConfig,
12
+ HasTextConfig,
13
+ MaxStepsConfig,
14
+ MaxTokensConfig,
15
+ StopConditionContext,
16
+ executed_tool,
17
+ has_text,
18
+ max_steps,
19
+ max_tokens,
20
+ stop_condition,
21
+ )
22
+ from .core.context import AgentContext, WorkflowContext
23
+ from .core.state import WorkflowState
24
+ from .core.workflow import (
25
+ StepExecutionError,
26
+ Workflow,
27
+ WorkflowTimeoutError,
28
+ get_all_workflows,
29
+ get_workflow,
30
+ workflow,
31
+ )
32
+ from .features import events, schedules
33
+ from .features.events import BatchEventPayload, EventPayload
34
+ from .features.schedules import SchedulePayload
35
+ from .middleware.guardrail import GuardrailContext, GuardrailResult, guardrail
36
+ from .middleware.hook import HookAction, HookContext, HookResult, hook
37
+ from .runtime.batch import batch_agent_invoke, batch_invoke
38
+ from .runtime.client import ExecutionHandle, PolosClient
39
+ from .runtime.queue import Queue, queue
40
+ from .runtime.worker import Worker
41
+ from .tools.tool import Tool, tool
42
+ from .types.types import (
43
+ AgentConfig,
44
+ BatchStepResult,
45
+ BatchWorkflowInput,
46
+ Step,
47
+ ToolCall,
48
+ ToolCallFunction,
49
+ ToolResult,
50
+ Usage,
51
+ )
52
+
53
+ __all__ = [
54
+ "workflow",
55
+ "Workflow",
56
+ "get_workflow",
57
+ "get_all_workflows",
58
+ "PolosClient",
59
+ "ExecutionHandle",
60
+ "Queue",
61
+ "queue",
62
+ "batch_invoke",
63
+ "batch_agent_invoke",
64
+ "Agent",
65
+ "AgentStreamHandle",
66
+ "StreamResult",
67
+ "stop_condition",
68
+ "max_steps",
69
+ "max_tokens",
70
+ "executed_tool",
71
+ "has_text",
72
+ "MaxTokensConfig",
73
+ "MaxStepsConfig",
74
+ "ExecutedToolConfig",
75
+ "HasTextConfig",
76
+ "StopConditionContext",
77
+ "tool",
78
+ "Tool",
79
+ "hook",
80
+ "HookContext",
81
+ "HookResult",
82
+ "HookAction",
83
+ "guardrail",
84
+ "GuardrailContext",
85
+ "GuardrailResult",
86
+ "Worker",
87
+ "WorkflowContext",
88
+ "AgentContext",
89
+ "WorkflowState",
90
+ "events",
91
+ "schedules",
92
+ "SchedulePayload",
93
+ "EventPayload",
94
+ "BatchEventPayload",
95
+ "BatchStepResult",
96
+ "Step",
97
+ "Usage",
98
+ "ToolCall",
99
+ "ToolResult",
100
+ "ToolCallFunction",
101
+ "AgentConfig",
102
+ "WorkflowTimeoutError",
103
+ "StepExecutionError",
104
+ "BatchWorkflowInput",
105
+ ]
@@ -0,0 +1,7 @@
1
+ """Agent execution functions."""
2
+
3
+ from .stream import _agent_stream_function
4
+
5
+ __all__ = [
6
+ "_agent_stream_function",
7
+ ]