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.
Files changed (118) hide show
  1. {lionagi-0.0.115 → lionagi-0.0.116}/PKG-INFO +1 -1
  2. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/core/sessions/sessions.py +3 -1
  3. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/services/base_api_service.py +11 -4
  4. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/services/oai.py +2 -2
  5. lionagi-0.0.116/lionagi/version.py +1 -0
  6. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi.egg-info/PKG-INFO +1 -1
  7. lionagi-0.0.115/lionagi/version.py +0 -1
  8. {lionagi-0.0.115 → lionagi-0.0.116}/LICENSE +0 -0
  9. {lionagi-0.0.115 → lionagi-0.0.116}/README.md +0 -0
  10. {lionagi-0.0.115 → lionagi-0.0.116}/README.rst +0 -0
  11. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/__init__.py +0 -0
  12. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/bridge/__init__.py +0 -0
  13. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/bridge/langchain.py +0 -0
  14. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/bridge/llama_index.py +0 -0
  15. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/configs/__init__.py +0 -0
  16. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/configs/oai_configs.py +0 -0
  17. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/configs/openrouter_configs.py +0 -0
  18. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/core/__init__.py +0 -0
  19. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/core/conversations/__init__.py +0 -0
  20. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/core/conversations/conversation.py +0 -0
  21. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/core/flows/__init__.py +0 -0
  22. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/core/flows/flow.py +0 -0
  23. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/core/flows/flow_util.py +0 -0
  24. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/core/instruction_set/__init__.py +0 -0
  25. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/core/instruction_set/instruction_sets.py +0 -0
  26. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/core/sessions/__init__.py +0 -0
  27. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/datastores/__init__.py +0 -0
  28. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/datastores/chroma.py +0 -0
  29. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/datastores/deeplake.py +0 -0
  30. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/datastores/elasticsearch.py +0 -0
  31. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/datastores/lantern.py +0 -0
  32. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/datastores/pinecone.py +0 -0
  33. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/datastores/postgres.py +0 -0
  34. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/datastores/qdrant.py +0 -0
  35. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/endpoints/__init__.py +0 -0
  36. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/endpoints/assistants.py +0 -0
  37. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/endpoints/audio.py +0 -0
  38. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/endpoints/chatcompletion.py +0 -0
  39. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/endpoints/embeddings.py +0 -0
  40. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/endpoints/finetune.py +0 -0
  41. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/endpoints/image.py +0 -0
  42. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/endpoints/moderation.py +0 -0
  43. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/endpoints/vision.py +0 -0
  44. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/loaders/__init__.py +0 -0
  45. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/loaders/chunker.py +0 -0
  46. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/loaders/load_util.py +0 -0
  47. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/loaders/reader.py +0 -0
  48. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/messages/__init__.py +0 -0
  49. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/messages/instruction.py +0 -0
  50. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/messages/message.py +0 -0
  51. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/messages/response.py +0 -0
  52. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/messages/system.py +0 -0
  53. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/objs/__init__.py +0 -0
  54. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/objs/abc_objs.py +0 -0
  55. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/objs/async_queue.py +0 -0
  56. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/objs/messenger.py +0 -0
  57. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/objs/status_tracker.py +0 -0
  58. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/objs/tool_manager.py +0 -0
  59. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/schema/__init__.py +0 -0
  60. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/schema/base_condition.py +0 -0
  61. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/schema/base_node.py +0 -0
  62. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/schema/base_tool.py +0 -0
  63. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/schema/data_logger.py +0 -0
  64. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/schema/data_node.py +0 -0
  65. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/services/__init__.py +0 -0
  66. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/services/anthropic.py +0 -0
  67. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/services/anyscale.py +0 -0
  68. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/services/azure.py +0 -0
  69. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/services/bedrock.py +0 -0
  70. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/services/everlyai.py +0 -0
  71. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/services/gemini.py +0 -0
  72. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/services/gpt4all.py +0 -0
  73. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/services/huggingface.py +0 -0
  74. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/services/litellm.py +0 -0
  75. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/services/localai.py +0 -0
  76. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/services/mistralai.py +0 -0
  77. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/services/ollama.py +0 -0
  78. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/services/openllm.py +0 -0
  79. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/services/openrouter.py +0 -0
  80. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/services/perplexity.py +0 -0
  81. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/services/predibase.py +0 -0
  82. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/services/rungpt.py +0 -0
  83. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/services/vllm.py +0 -0
  84. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/services/xinference.py +0 -0
  85. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/structures/__init__.py +0 -0
  86. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/structures/graph.py +0 -0
  87. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/structures/relationship.py +0 -0
  88. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/structures/structure.py +0 -0
  89. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/tests/__init__.py +0 -0
  90. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/tests/test_api_util.py +0 -0
  91. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/tests/test_call_util.py +0 -0
  92. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/tests/test_convert_util.py +0 -0
  93. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/tests/test_encrypt_util.py +0 -0
  94. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/tests/test_flat_util.py +0 -0
  95. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/tests/test_io_util.py +0 -0
  96. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/tests/test_sys_util.py +0 -0
  97. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/tools/__init__.py +0 -0
  98. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/tools/planner.py +0 -0
  99. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/tools/prompter.py +0 -0
  100. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/tools/scorer.py +0 -0
  101. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/tools/summarizer.py +0 -0
  102. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/tools/tool_util.py +0 -0
  103. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/tools/validator.py +0 -0
  104. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/utils/__init__.py +0 -0
  105. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/utils/api_util.py +0 -0
  106. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/utils/call_util.py +0 -0
  107. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/utils/convert_util.py +0 -0
  108. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/utils/encrypt_util.py +0 -0
  109. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/utils/flat_util.py +0 -0
  110. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/utils/io_util.py +0 -0
  111. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi/utils/sys_util.py +0 -0
  112. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi.egg-info/SOURCES.txt +0 -0
  113. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi.egg-info/dependency_links.txt +0 -0
  114. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi.egg-info/requires.txt +0 -0
  115. {lionagi-0.0.115 → lionagi-0.0.116}/lionagi.egg-info/top_level.txt +0 -0
  116. {lionagi-0.0.115 → lionagi-0.0.116}/pyproject.toml +0 -0
  117. {lionagi-0.0.115 → lionagi-0.0.116}/setup.cfg +0 -0
  118. {lionagi-0.0.115 → lionagi-0.0.116}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lionagi
3
- Version: 0.0.115
3
+ Version: 0.0.116
4
4
  Summary: Towards automated general intelligence.
5
5
  Author: HaiyangLi
6
6
  Author-email: Haiyang Li <ocean@lionagi.ai>
@@ -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 = await asyncio.create_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=None, max_requests_per_minute=None, max_tokens_per_minute=None) -> None:
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.rate_limiter = ratelimiter(max_requests_per_minute, max_tokens_per_minute)
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,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lionagi
3
- Version: 0.0.115
3
+ Version: 0.0.116
4
4
  Summary: Towards automated general intelligence.
5
5
  Author: HaiyangLi
6
6
  Author-email: Haiyang Li <ocean@lionagi.ai>
@@ -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