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/runtime/queue.py
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"""Queue configuration for workflow concurrency control."""
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class Queue:
|
|
5
|
+
"""Represents a named queue with concurrency limits.
|
|
6
|
+
|
|
7
|
+
Queues control how many workflows can run concurrently. Each queue has:
|
|
8
|
+
- A unique name
|
|
9
|
+
- A concurrency limit (max concurrent executions)
|
|
10
|
+
|
|
11
|
+
Workflows can be assigned to queues to control resource usage.
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
def __init__(self, name: str, concurrency_limit: int | None = None):
|
|
15
|
+
"""Create a queue.
|
|
16
|
+
|
|
17
|
+
Args:
|
|
18
|
+
name: Unique queue name
|
|
19
|
+
concurrency_limit: Maximum concurrent executions (None = unlimited, uses env default)
|
|
20
|
+
"""
|
|
21
|
+
self.name = name
|
|
22
|
+
self.concurrency_limit = concurrency_limit
|
|
23
|
+
|
|
24
|
+
def __repr__(self) -> str:
|
|
25
|
+
return f"Queue(name='{self.name}', concurrency_limit={self.concurrency_limit})"
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def queue(name: str, concurrency_limit: int | None = None) -> Queue:
|
|
29
|
+
"""Create a queue object.
|
|
30
|
+
|
|
31
|
+
Example:
|
|
32
|
+
my_queue = queue("my-queue", concurrency_limit=5)
|
|
33
|
+
workflow1 = workflow(queue=my_queue)
|
|
34
|
+
|
|
35
|
+
Args:
|
|
36
|
+
name: Unique queue name
|
|
37
|
+
concurrency_limit: Maximum concurrent executions (None = unlimited, uses env default)
|
|
38
|
+
|
|
39
|
+
Returns:
|
|
40
|
+
Queue object
|
|
41
|
+
"""
|
|
42
|
+
return Queue(name, concurrency_limit)
|