smarta2a 0.4.8__py3-none-any.whl → 0.4.10__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.
@@ -160,15 +160,19 @@ class OpenAIProvider(BaseLLMProvider):
160
160
  messages = [msg if isinstance(msg, Message) else Message(**msg) for msg in state.context_history]
161
161
  openai_messages = self._convert_messages(messages)
162
162
  max_iterations = 30
163
+ openai_functions = self._format_openai_functions()
163
164
 
164
165
  for _ in range(max_iterations):
165
- # Call ChatCompletion with functions (not 'tools')
166
- response = await self.client.chat.completions.create(
167
- model=self.model,
168
- messages=openai_messages,
169
- functions=self._format_openai_functions(),
170
- **kwargs
171
- )
166
+
167
+ create_kwargs = {
168
+ "model": self.model,
169
+ "messages": openai_messages,
170
+ **kwargs # Merge with existing kwargs
171
+ }
172
+ if openai_functions:
173
+ create_kwargs["functions"] = openai_functions # Add functions only if non-empty
174
+
175
+ response = await self.client.chat.completions.create(**create_kwargs)
172
176
  msg = response.choices[0].message
173
177
 
174
178
  # If no function call, return content
smarta2a/server/server.py CHANGED
@@ -84,7 +84,7 @@ class SmartA2A:
84
84
  def _setup_cors(self):
85
85
  self.app.add_middleware(
86
86
  CORSMiddleware,
87
- allow_origins=["http://localhost:3000", "http://localhost:80"],
87
+ allow_origins=["http://localhost:3000", "http://localhost", "http://localhost:8000"],
88
88
  allow_credentials=True,
89
89
  allow_methods=["*"],
90
90
  allow_headers=["*"],
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: smarta2a
3
- Version: 0.4.8
3
+ Version: 0.4.10
4
4
  Summary: a Python framework that helps you build servers and AI agents that communicate using the A2A protocol
5
5
  Project-URL: Homepage, https://github.com/siddharthsma/smarta2a
6
6
  Project-URL: Bug Tracker, https://github.com/siddharthsma/smarta2a/issues
@@ -14,14 +14,14 @@ smarta2a/history_update_strategies/history_update_strategy.py,sha256=n2sfIGu8ztK
14
14
  smarta2a/history_update_strategies/rolling_window_strategy.py,sha256=7Ch042JWt4TM_r1-sFKlSIxHj8VX1P3ZoqjCvIdeSqA,540
15
15
  smarta2a/model_providers/__init__.py,sha256=hJj0w00JjqTiBgJmHmOWwL6MU_hwmro9xTiX3XYf6ts,148
16
16
  smarta2a/model_providers/base_llm_provider.py,sha256=iQUqjnypl0f2M929iU0WhHoxAE4ek-NUFJPbEnNQ8-4,412
17
- smarta2a/model_providers/openai_provider.py,sha256=bkB40syLlRJXdh6J4XbfPpWmimygtEaL3hc5qF-L8uI,12166
17
+ smarta2a/model_providers/openai_provider.py,sha256=SJfEOktgbjyZ3FtE-Q_K7dYJJI0khrltj2kJoYwz0WQ,12317
18
18
  smarta2a/server/__init__.py,sha256=f2X454Ll4vJc02V4JLJHTN-h8u0TBm4d_FkiO4t686U,53
19
19
  smarta2a/server/handler_registry.py,sha256=OVRG5dTvxB7qUNXgsqWxVNxIyRljUShSYxb1gtbi5XM,820
20
20
  smarta2a/server/json_rpc_request_processor.py,sha256=qRB3sfj_n9ImkIOCdaUKMsDmKcO7CiMhaZ4VdQS7Mb4,6993
21
21
  smarta2a/server/nats_client.py,sha256=akyNg1hLd9XYoLSH_qQVs8uoiTQerztgvqu_3TifSgE,1617
22
22
  smarta2a/server/request_handler.py,sha256=5KMtfpHQX6bOgk1DJbhs1fUCQ5tSvMYXWzheT3IW2Bo,26374
23
23
  smarta2a/server/send_task_handler.py,sha256=fiBeCCHCu9c2H4EJOUc0t3EZgpHVFJy4B_6qZOC140s,6336
24
- smarta2a/server/server.py,sha256=leizsge5Gvb4V10djOSS7To5s2a_mU5-GZRKZAMoCk8,6764
24
+ smarta2a/server/server.py,sha256=6MxNM3U7JmEgd9V5Ba64Xu6aM16r69TFWT07jbbtiFg,6786
25
25
  smarta2a/server/state_manager.py,sha256=omjN3C9Sl4hqw5FepnX2qBm1do6QTSE5P9uip78dvEI,6807
26
26
  smarta2a/server/webhook_request_processor.py,sha256=_0XoUDmueSl9CvFQE-1zgKRSts-EW8QxbmolPTfFER8,5306
27
27
  smarta2a/state_stores/__init__.py,sha256=vafxAqpwvag_cYFH2XKGk3DPmJIWJr4Ioey30yLFkVQ,220
@@ -34,7 +34,7 @@ smarta2a/utils/task_builder.py,sha256=wqSyfVHNTaXuGESu09dhlaDi7D007gcN3-8tH-nPQ4
34
34
  smarta2a/utils/task_request_builder.py,sha256=6cOGOqj2Rg43xWM03GRJQzlIZHBptsMCJRp7oD-TDAQ,3362
35
35
  smarta2a/utils/tools_manager.py,sha256=igKYeSi0SaYzd36jUqOMPvnYd5kK55EPQ0X_pdTo5e4,4857
36
36
  smarta2a/utils/types.py,sha256=kzA6Vv5xXfu1sJuxhEXrglI9e9S6eZVIljMnsrQVyN0,13650
37
- smarta2a-0.4.8.dist-info/METADATA,sha256=e6RzmHxhj8p3H4eLk2uNlGehaZ56tgeW01dbYB4zfZc,12987
38
- smarta2a-0.4.8.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
39
- smarta2a-0.4.8.dist-info/licenses/LICENSE,sha256=lDbqrxVnzDMY5KJ8JS1WhvkWE8TJaw-O-CHDy-ecsJA,2095
40
- smarta2a-0.4.8.dist-info/RECORD,,
37
+ smarta2a-0.4.10.dist-info/METADATA,sha256=7n_5EbrUNDyoWXrzngKk_BObSeeZn4wJ27JqLo5fz5E,12988
38
+ smarta2a-0.4.10.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
39
+ smarta2a-0.4.10.dist-info/licenses/LICENSE,sha256=lDbqrxVnzDMY5KJ8JS1WhvkWE8TJaw-O-CHDy-ecsJA,2095
40
+ smarta2a-0.4.10.dist-info/RECORD,,