meshagent-openai 0.0.11__py3-none-any.whl → 0.0.15__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.
Potentially problematic release.
This version of meshagent-openai might be problematic. Click here for more details.
- meshagent/openai/tools/completions_adapter.py +3 -2
- meshagent/openai/tools/responses_adapter.py +9 -7
- meshagent/openai/version.py +1 -1
- {meshagent_openai-0.0.11.dist-info → meshagent_openai-0.0.15.dist-info}/METADATA +4 -4
- meshagent_openai-0.0.15.dist-info/RECORD +10 -0
- meshagent_openai-0.0.11.dist-info/RECORD +0 -10
- {meshagent_openai-0.0.11.dist-info → meshagent_openai-0.0.15.dist-info}/WHEEL +0 -0
- {meshagent_openai-0.0.11.dist-info → meshagent_openai-0.0.15.dist-info}/licenses/LICENSE +0 -0
- {meshagent_openai-0.0.11.dist-info → meshagent_openai-0.0.15.dist-info}/top_level.txt +0 -0
|
@@ -24,9 +24,8 @@ import logging
|
|
|
24
24
|
import re
|
|
25
25
|
import asyncio
|
|
26
26
|
|
|
27
|
-
logging.basicConfig()
|
|
28
27
|
logger = logging.getLogger("openai_agent")
|
|
29
|
-
|
|
28
|
+
|
|
30
29
|
|
|
31
30
|
|
|
32
31
|
|
|
@@ -231,6 +230,8 @@ class OpenAICompletionsAdapter(LLMAdapter):
|
|
|
231
230
|
system_role = "developer"
|
|
232
231
|
elif self._model.startswith("o3"):
|
|
233
232
|
system_role = "developer"
|
|
233
|
+
elif self._model.startswith("o4"):
|
|
234
|
+
system_role = "developer"
|
|
234
235
|
|
|
235
236
|
context = AgentChatContext(
|
|
236
237
|
system_role=system_role
|
|
@@ -3,7 +3,7 @@ from meshagent.agents.agent import Agent, AgentChatContext, AgentCallContext
|
|
|
3
3
|
from meshagent.api import WebSocketClientProtocol, RoomClient, RoomException
|
|
4
4
|
from meshagent.tools.blob import Blob, BlobStorage
|
|
5
5
|
from meshagent.tools import Toolkit, ToolContext, Tool
|
|
6
|
-
from meshagent.api.messaging import Response, LinkResponse, FileResponse, JsonResponse, TextResponse, EmptyResponse, RawOutputs
|
|
6
|
+
from meshagent.api.messaging import Response, LinkResponse, FileResponse, JsonResponse, TextResponse, EmptyResponse, RawOutputs, ensure_response
|
|
7
7
|
from meshagent.api.schema_util import prompt_schema
|
|
8
8
|
from meshagent.agents.adapter import ToolResponseAdapter, LLMAdapter
|
|
9
9
|
from uuid import uuid4
|
|
@@ -24,9 +24,8 @@ import logging
|
|
|
24
24
|
import re
|
|
25
25
|
import asyncio
|
|
26
26
|
|
|
27
|
-
logging.basicConfig()
|
|
28
27
|
logger = logging.getLogger("openai_agent")
|
|
29
|
-
|
|
28
|
+
|
|
30
29
|
|
|
31
30
|
|
|
32
31
|
|
|
@@ -129,7 +128,7 @@ class ResponsesToolBundle:
|
|
|
129
128
|
proxy = self._executors[name]
|
|
130
129
|
result = await proxy.execute(context=context, name=name, arguments=arguments)
|
|
131
130
|
logger.info("success calling %s %s %s", tool_call.id, name, result)
|
|
132
|
-
return result
|
|
131
|
+
return ensure_response(result)
|
|
133
132
|
|
|
134
133
|
except Exception as e:
|
|
135
134
|
logger.error("failed calling %s %s", tool_call.id, name, exc_info=e)
|
|
@@ -232,7 +231,7 @@ class OpenAIResponsesToolResponseAdapter(ToolResponseAdapter):
|
|
|
232
231
|
|
|
233
232
|
class OpenAIResponsesAdapter(LLMAdapter[ResponsesToolBundle]):
|
|
234
233
|
def __init__(self,
|
|
235
|
-
model: str = os.getenv("OPENAI_MODEL","gpt-
|
|
234
|
+
model: str = os.getenv("OPENAI_MODEL","gpt-4.1"),
|
|
236
235
|
parallel_tool_calls : Optional[bool] = None,
|
|
237
236
|
client: Optional[AsyncOpenAI] = None,
|
|
238
237
|
retries : int = 0,
|
|
@@ -250,6 +249,8 @@ class OpenAIResponsesAdapter(LLMAdapter[ResponsesToolBundle]):
|
|
|
250
249
|
system_role = "developer"
|
|
251
250
|
elif self._model.startswith("o3"):
|
|
252
251
|
system_role = "developer"
|
|
252
|
+
elif self._model.startswith("o4"):
|
|
253
|
+
system_role = "developer"
|
|
253
254
|
elif self._model.startswith("computer-use"):
|
|
254
255
|
system_role = "developer"
|
|
255
256
|
|
|
@@ -277,13 +278,14 @@ class OpenAIResponsesAdapter(LLMAdapter[ResponsesToolBundle]):
|
|
|
277
278
|
|
|
278
279
|
def _get_client(self, *, room: RoomClient) -> AsyncOpenAI:
|
|
279
280
|
if self._client != None:
|
|
281
|
+
|
|
280
282
|
openai = self._client
|
|
281
283
|
else:
|
|
282
284
|
token : str = room.protocol.token
|
|
283
285
|
url : str = room.room_url
|
|
284
286
|
|
|
285
287
|
room_proxy_url = f"{url}/v1"
|
|
286
|
-
|
|
288
|
+
|
|
287
289
|
openai=AsyncOpenAI(
|
|
288
290
|
api_key=token,
|
|
289
291
|
base_url=room_proxy_url,
|
|
@@ -346,7 +348,7 @@ class OpenAIResponsesAdapter(LLMAdapter[ResponsesToolBundle]):
|
|
|
346
348
|
"format" : {
|
|
347
349
|
"type" : "json_schema",
|
|
348
350
|
"name" : response_name,
|
|
349
|
-
"schema" :
|
|
351
|
+
"schema" : response_schema,
|
|
350
352
|
"strict" : True,
|
|
351
353
|
}
|
|
352
354
|
}
|
meshagent/openai/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.0.
|
|
1
|
+
__version__ = "0.0.15"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: meshagent-openai
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.15
|
|
4
4
|
Summary: OpenAI Building Blocks for Meshagent
|
|
5
5
|
License-Expression: Apache-2.0
|
|
6
6
|
Project-URL: Documentation, https://meshagent.com
|
|
@@ -13,7 +13,7 @@ Requires-Dist: pyjwt~=2.10.1
|
|
|
13
13
|
Requires-Dist: pytest~=8.3.5
|
|
14
14
|
Requires-Dist: pytest-asyncio~=0.26.0
|
|
15
15
|
Requires-Dist: openai~=1.70.0
|
|
16
|
-
Requires-Dist: meshagent-api~=0.0.
|
|
17
|
-
Requires-Dist: meshagent-agents~=0.0.
|
|
18
|
-
Requires-Dist: meshagent-tools~=0.0.
|
|
16
|
+
Requires-Dist: meshagent-api~=0.0.15
|
|
17
|
+
Requires-Dist: meshagent-agents~=0.0.15
|
|
18
|
+
Requires-Dist: meshagent-tools~=0.0.15
|
|
19
19
|
Dynamic: license-file
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
meshagent/openai/__init__.py,sha256=4JRby-ltGfJzrNYhJkMNIpVc2ml2zL_JkkFC0T1_8Vk,174
|
|
2
|
+
meshagent/openai/version.py,sha256=OpICqW3gacySIEm2aFlBiaIhB7efvBWC8Mt6amfme9M,22
|
|
3
|
+
meshagent/openai/tools/__init__.py,sha256=RBU_J4qRDuBaaUdi6jpgpuMlIbvT30QmTBrZrYLwsUU,185
|
|
4
|
+
meshagent/openai/tools/completions_adapter.py,sha256=yEZcIlfgvNXUjgppZsRIX147WcQGpNh3imUJsSyITLk,15229
|
|
5
|
+
meshagent/openai/tools/responses_adapter.py,sha256=MbFXd8yVOBK6HBa4rR4FynL1Ihe09jRL0tyEbs6uLjY,23350
|
|
6
|
+
meshagent_openai-0.0.15.dist-info/licenses/LICENSE,sha256=eTt0SPW-sVNdkZe9PS_S8WfCIyLjRXRl7sUBWdlteFg,10254
|
|
7
|
+
meshagent_openai-0.0.15.dist-info/METADATA,sha256=eQHsPc2ovd1ii3YSw4-kH-SP4s9jX72NhHPAPufcuKM,633
|
|
8
|
+
meshagent_openai-0.0.15.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
|
9
|
+
meshagent_openai-0.0.15.dist-info/top_level.txt,sha256=GlcXnHtRP6m7zlG3Df04M35OsHtNXy_DY09oFwWrH74,10
|
|
10
|
+
meshagent_openai-0.0.15.dist-info/RECORD,,
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
meshagent/openai/__init__.py,sha256=4JRby-ltGfJzrNYhJkMNIpVc2ml2zL_JkkFC0T1_8Vk,174
|
|
2
|
-
meshagent/openai/version.py,sha256=JYmOHtxsvSjuZb1iFbWIoWJG2xmUKuRX19fGoCSfeco,22
|
|
3
|
-
meshagent/openai/tools/__init__.py,sha256=RBU_J4qRDuBaaUdi6jpgpuMlIbvT30QmTBrZrYLwsUU,185
|
|
4
|
-
meshagent/openai/tools/completions_adapter.py,sha256=BVoUQkzPKdjKKrOBt1uJi7p7GMMHH1q8EMFr7PRCusE,15199
|
|
5
|
-
meshagent/openai/tools/responses_adapter.py,sha256=0kmYn_KuuUpSF4YE6da4JCPwAFTX_Qnh16mExK-NOOs,23269
|
|
6
|
-
meshagent_openai-0.0.11.dist-info/licenses/LICENSE,sha256=eTt0SPW-sVNdkZe9PS_S8WfCIyLjRXRl7sUBWdlteFg,10254
|
|
7
|
-
meshagent_openai-0.0.11.dist-info/METADATA,sha256=ye_kBWuiuuq8a5Iu0t8VLdXo-9Fhqw1JkRbueaIrQQA,633
|
|
8
|
-
meshagent_openai-0.0.11.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
|
9
|
-
meshagent_openai-0.0.11.dist-info/top_level.txt,sha256=GlcXnHtRP6m7zlG3Df04M35OsHtNXy_DY09oFwWrH74,10
|
|
10
|
-
meshagent_openai-0.0.11.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|