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.
- polos/__init__.py +105 -0
- polos/agents/__init__.py +7 -0
- polos/agents/agent.py +746 -0
- polos/agents/conversation_history.py +121 -0
- polos/agents/stop_conditions.py +280 -0
- polos/agents/stream.py +635 -0
- polos/core/__init__.py +0 -0
- polos/core/context.py +143 -0
- polos/core/state.py +26 -0
- polos/core/step.py +1380 -0
- polos/core/workflow.py +1192 -0
- polos/features/__init__.py +0 -0
- polos/features/events.py +456 -0
- polos/features/schedules.py +110 -0
- polos/features/tracing.py +605 -0
- polos/features/wait.py +82 -0
- polos/llm/__init__.py +9 -0
- polos/llm/generate.py +152 -0
- polos/llm/providers/__init__.py +5 -0
- polos/llm/providers/anthropic.py +615 -0
- polos/llm/providers/azure.py +42 -0
- polos/llm/providers/base.py +196 -0
- polos/llm/providers/fireworks.py +41 -0
- polos/llm/providers/gemini.py +40 -0
- polos/llm/providers/groq.py +40 -0
- polos/llm/providers/openai.py +1021 -0
- polos/llm/providers/together.py +40 -0
- polos/llm/stream.py +183 -0
- polos/middleware/__init__.py +0 -0
- polos/middleware/guardrail.py +148 -0
- polos/middleware/guardrail_executor.py +253 -0
- polos/middleware/hook.py +164 -0
- polos/middleware/hook_executor.py +104 -0
- polos/runtime/__init__.py +0 -0
- polos/runtime/batch.py +87 -0
- polos/runtime/client.py +841 -0
- polos/runtime/queue.py +42 -0
- polos/runtime/worker.py +1365 -0
- polos/runtime/worker_server.py +249 -0
- polos/tools/__init__.py +0 -0
- polos/tools/tool.py +587 -0
- polos/types/__init__.py +23 -0
- polos/types/types.py +116 -0
- polos/utils/__init__.py +27 -0
- polos/utils/agent.py +27 -0
- polos/utils/client_context.py +41 -0
- polos/utils/config.py +12 -0
- polos/utils/output_schema.py +311 -0
- polos/utils/retry.py +47 -0
- polos/utils/serializer.py +167 -0
- polos/utils/tracing.py +27 -0
- polos/utils/worker_singleton.py +40 -0
- polos_sdk-0.1.0.dist-info/METADATA +650 -0
- polos_sdk-0.1.0.dist-info/RECORD +55 -0
- 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
|
+
]
|