lionagi 0.0.115__tar.gz → 0.0.116__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {lionagi-0.0.115 → lionagi-0.0.116}/PKG-INFO +1 -1
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/core/sessions/sessions.py +3 -1
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/services/base_api_service.py +11 -4
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/services/oai.py +2 -2
- lionagi-0.0.116/lionagi/version.py +1 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi.egg-info/PKG-INFO +1 -1
- lionagi-0.0.115/lionagi/version.py +0 -1
- {lionagi-0.0.115 → lionagi-0.0.116}/LICENSE +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/README.md +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/README.rst +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/__init__.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/bridge/__init__.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/bridge/langchain.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/bridge/llama_index.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/configs/__init__.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/configs/oai_configs.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/configs/openrouter_configs.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/core/__init__.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/core/conversations/__init__.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/core/conversations/conversation.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/core/flows/__init__.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/core/flows/flow.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/core/flows/flow_util.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/core/instruction_set/__init__.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/core/instruction_set/instruction_sets.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/core/sessions/__init__.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/datastores/__init__.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/datastores/chroma.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/datastores/deeplake.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/datastores/elasticsearch.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/datastores/lantern.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/datastores/pinecone.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/datastores/postgres.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/datastores/qdrant.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/endpoints/__init__.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/endpoints/assistants.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/endpoints/audio.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/endpoints/chatcompletion.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/endpoints/embeddings.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/endpoints/finetune.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/endpoints/image.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/endpoints/moderation.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/endpoints/vision.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/loaders/__init__.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/loaders/chunker.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/loaders/load_util.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/loaders/reader.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/messages/__init__.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/messages/instruction.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/messages/message.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/messages/response.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/messages/system.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/objs/__init__.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/objs/abc_objs.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/objs/async_queue.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/objs/messenger.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/objs/status_tracker.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/objs/tool_manager.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/schema/__init__.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/schema/base_condition.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/schema/base_node.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/schema/base_tool.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/schema/data_logger.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/schema/data_node.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/services/__init__.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/services/anthropic.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/services/anyscale.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/services/azure.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/services/bedrock.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/services/everlyai.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/services/gemini.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/services/gpt4all.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/services/huggingface.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/services/litellm.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/services/localai.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/services/mistralai.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/services/ollama.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/services/openllm.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/services/openrouter.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/services/perplexity.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/services/predibase.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/services/rungpt.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/services/vllm.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/services/xinference.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/structures/__init__.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/structures/graph.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/structures/relationship.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/structures/structure.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/tests/__init__.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/tests/test_api_util.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/tests/test_call_util.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/tests/test_convert_util.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/tests/test_encrypt_util.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/tests/test_flat_util.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/tests/test_io_util.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/tests/test_sys_util.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/tools/__init__.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/tools/planner.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/tools/prompter.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/tools/scorer.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/tools/summarizer.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/tools/tool_util.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/tools/validator.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/utils/__init__.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/utils/api_util.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/utils/call_util.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/utils/convert_util.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/utils/encrypt_util.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/utils/flat_util.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/utils/io_util.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/utils/sys_util.py +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi.egg-info/SOURCES.txt +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi.egg-info/dependency_links.txt +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi.egg-info/requires.txt +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/lionagi.egg-info/top_level.txt +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/pyproject.toml +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/setup.cfg +0 -0
- {lionagi-0.0.115 → lionagi-0.0.116}/setup.py +0 -0
@@ -115,6 +115,8 @@ class Session:
|
|
115
115
|
# kwargs = {**tool_kwarg, **kwargs}
|
116
116
|
if self.tool_manager.registry != {}:
|
117
117
|
kwargs = self._tool_parser(**kwargs)
|
118
|
+
if self.service is not None:
|
119
|
+
await self.service._init()
|
118
120
|
config = {**self.llmconfig, **kwargs}
|
119
121
|
system = system or self.system
|
120
122
|
self.conversation.initiate_conversation(system=system, instruction=instruction, context=context, name=name)
|
@@ -182,4 +184,4 @@ class Session:
|
|
182
184
|
self.service.status_tracker.num_tasks_succeeded += 1
|
183
185
|
else:
|
184
186
|
self.service.status_tracker.num_tasks_failed += 1
|
185
|
-
|
187
|
+
|
@@ -22,7 +22,7 @@ class BaseAPIRateLimiter(RateLimiter):
|
|
22
22
|
) -> None:
|
23
23
|
self = cls(max_requests_per_minute, max_tokens_per_minute)
|
24
24
|
if not os.getenv("env_readthedocs"):
|
25
|
-
self.rate_limit_replenisher_task =
|
25
|
+
self.rate_limit_replenisher_task = asyncio.create_task(
|
26
26
|
self.rate_limit_replenisher()
|
27
27
|
)
|
28
28
|
return self
|
@@ -133,13 +133,16 @@ class BaseAPIService(BaseService):
|
|
133
133
|
def __init__(self, api_key: str = None,
|
134
134
|
status_tracker = None,
|
135
135
|
queue = None, endpoint=None, schema=None,
|
136
|
-
ratelimiter=
|
136
|
+
ratelimiter=BaseAPIRateLimiter, max_requests_per_minute=None, max_tokens_per_minute=None) -> None:
|
137
137
|
self.api_key = api_key
|
138
138
|
self.status_tracker = status_tracker or StatusTracker()
|
139
139
|
self.queue = queue or AsyncQueue()
|
140
140
|
self.endpoint=endpoint
|
141
141
|
self.schema = schema
|
142
|
-
self.
|
142
|
+
self.max_requests_per_minute = max_requests_per_minute
|
143
|
+
self.max_tokens_per_minute = max_tokens_per_minute
|
144
|
+
self.rate_limiter_class = ratelimiter
|
145
|
+
self.rate_limiter = None
|
143
146
|
|
144
147
|
@staticmethod
|
145
148
|
def api_methods(http_session, method="post"):
|
@@ -171,6 +174,10 @@ class BaseAPIService(BaseService):
|
|
171
174
|
yield task_id
|
172
175
|
task_id += 1
|
173
176
|
|
177
|
+
async def _init(self):
|
178
|
+
if self.rate_limiter is None:
|
179
|
+
self.rate_limiter = await self.rate_limiter_class.create(self.max_requests_per_minute, self.max_tokens_per_minute)
|
180
|
+
|
174
181
|
async def _call_api(self, http_session, endpoint_, method="post", payload: Dict[str, any] =None) -> Optional[Dict[str, any]]:
|
175
182
|
endpoint_ = self.api_endpoint_from_url("https://api.openai.com/v1/"+endpoint_)
|
176
183
|
|
@@ -227,4 +234,4 @@ class BaseAPIService(BaseService):
|
|
227
234
|
except Exception as e:
|
228
235
|
self.status_tracker.num_tasks_failed += 1
|
229
236
|
raise e
|
230
|
-
|
237
|
+
|
@@ -15,7 +15,7 @@ class OpenAIService(BaseAPIService):
|
|
15
15
|
max_attempts: int = 3,
|
16
16
|
max_requests_per_minute: int = 500,
|
17
17
|
max_tokens_per_minute: int = 150_000,
|
18
|
-
ratelimiter = BaseAPIRateLimiter
|
18
|
+
ratelimiter = BaseAPIRateLimiter,
|
19
19
|
status_tracker = None,
|
20
20
|
queue = None,
|
21
21
|
):
|
@@ -31,4 +31,4 @@ class OpenAIService(BaseAPIService):
|
|
31
31
|
|
32
32
|
async def serve(self, payload, endpoint_="chat/completions", method="post"):
|
33
33
|
return await self._serve(payload=payload, endpoint_=endpoint_, method=method)
|
34
|
-
|
34
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
__version__ = "0.0.116"
|
@@ -1 +0,0 @@
|
|
1
|
-
__version__ = "0.0.115"
|
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
|
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
|