LLM-Bridge 1.15.8__py3-none-any.whl → 1.15.9__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.
- llm_bridge/client/implementations/openai/non_stream_openai_responses_client.py +1 -1
- llm_bridge/client/implementations/openai/steam_openai_responses_client.py +1 -1
- llm_bridge/client/model_client/openai_client.py +4 -5
- llm_bridge/logic/chat_generate/chat_client_factory.py +1 -1
- llm_bridge/logic/chat_generate/model_client_factory/openai_client_factory.py +14 -8
- {llm_bridge-1.15.8.dist-info → llm_bridge-1.15.9.dist-info}/METADATA +2 -2
- {llm_bridge-1.15.8.dist-info → llm_bridge-1.15.9.dist-info}/RECORD +9 -9
- {llm_bridge-1.15.8.dist-info → llm_bridge-1.15.9.dist-info}/WHEEL +0 -0
- {llm_bridge-1.15.8.dist-info → llm_bridge-1.15.9.dist-info}/licenses/LICENSE +0 -0
|
@@ -32,7 +32,7 @@ class NonStreamOpenAIResponsesClient(OpenAIClient):
|
|
|
32
32
|
stream=False,
|
|
33
33
|
tools=self.tools,
|
|
34
34
|
include=self.include,
|
|
35
|
-
|
|
35
|
+
text=self.text,
|
|
36
36
|
)
|
|
37
37
|
|
|
38
38
|
return await process_openai_responses_non_stream_response(
|
|
@@ -56,7 +56,7 @@ class StreamOpenAIResponsesClient(OpenAIClient):
|
|
|
56
56
|
stream=True,
|
|
57
57
|
tools=self.tools,
|
|
58
58
|
include=self.include,
|
|
59
|
-
|
|
59
|
+
text=self.text,
|
|
60
60
|
)
|
|
61
61
|
|
|
62
62
|
except httpx.HTTPStatusError as e:
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
from typing import AsyncGenerator, Iterable
|
|
2
|
-
from pydantic import BaseModel
|
|
1
|
+
from typing import AsyncGenerator, Iterable
|
|
3
2
|
|
|
4
3
|
import openai.lib.azure
|
|
5
4
|
from openai.types import Reasoning
|
|
6
|
-
from openai.types.responses import ToolParam, ResponseIncludable
|
|
5
|
+
from openai.types.responses import ToolParam, ResponseIncludable, ResponseTextConfigParam
|
|
7
6
|
|
|
8
7
|
from llm_bridge.client.chat_client import ChatClient
|
|
9
8
|
from llm_bridge.type.chat_response import ChatResponse
|
|
@@ -22,7 +21,7 @@ class OpenAIClient(ChatClient):
|
|
|
22
21
|
tools: Iterable[ToolParam],
|
|
23
22
|
reasoning: Reasoning,
|
|
24
23
|
include: list[ResponseIncludable],
|
|
25
|
-
|
|
24
|
+
text: ResponseTextConfigParam,
|
|
26
25
|
):
|
|
27
26
|
self.model = model
|
|
28
27
|
self.messages = messages
|
|
@@ -32,7 +31,7 @@ class OpenAIClient(ChatClient):
|
|
|
32
31
|
self.tools = tools
|
|
33
32
|
self.reasoning = reasoning
|
|
34
33
|
self.include = include
|
|
35
|
-
self.
|
|
34
|
+
self.text = text
|
|
36
35
|
|
|
37
36
|
async def generate_non_stream_response(self) -> ChatResponse:
|
|
38
37
|
raise NotImplementedError
|
|
@@ -5,7 +5,8 @@ import openai
|
|
|
5
5
|
from fastapi import HTTPException
|
|
6
6
|
from openai import Omit
|
|
7
7
|
from openai.types import Reasoning
|
|
8
|
-
from openai.types.responses import WebSearchToolParam, ResponseIncludable
|
|
8
|
+
from openai.types.responses import WebSearchToolParam, ResponseIncludable, ResponseTextConfigParam, \
|
|
9
|
+
ResponseFormatTextJSONSchemaConfigParam
|
|
9
10
|
from openai.types.responses.tool_param import CodeInterpreter, CodeInterpreterContainerCodeInterpreterToolAuto, \
|
|
10
11
|
ImageGeneration, ToolParam
|
|
11
12
|
|
|
@@ -15,12 +16,11 @@ from llm_bridge.client.implementations.openai.steam_openai_responses_client impo
|
|
|
15
16
|
from llm_bridge.client.implementations.openai.stream_openai_client import StreamOpenAIClient
|
|
16
17
|
from llm_bridge.logic.chat_generate.chat_message_converter import convert_messages_to_openai_responses, \
|
|
17
18
|
convert_messages_to_openai
|
|
18
|
-
from llm_bridge.logic.chat_generate.model_client_factory.schema_converter import json_schema_to_pydantic_model
|
|
19
19
|
from llm_bridge.type.message import Message
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
async def create_openai_client(
|
|
23
|
-
api_keys: dict,
|
|
23
|
+
api_keys: dict[str, str],
|
|
24
24
|
messages: list[Message],
|
|
25
25
|
model: str,
|
|
26
26
|
api_type: str,
|
|
@@ -98,10 +98,16 @@ async def create_openai_client(
|
|
|
98
98
|
)
|
|
99
99
|
)
|
|
100
100
|
|
|
101
|
-
|
|
101
|
+
text: ResponseTextConfigParam | Omit = omit
|
|
102
102
|
if structured_output_schema:
|
|
103
|
-
|
|
104
|
-
|
|
103
|
+
text = ResponseTextConfigParam(
|
|
104
|
+
format=ResponseFormatTextJSONSchemaConfigParam(
|
|
105
|
+
name="structured_output",
|
|
106
|
+
schema=structured_output_schema,
|
|
107
|
+
type="json_schema",
|
|
108
|
+
strict=True,
|
|
109
|
+
)
|
|
110
|
+
)
|
|
105
111
|
|
|
106
112
|
if use_responses_api:
|
|
107
113
|
if stream:
|
|
@@ -114,7 +120,7 @@ async def create_openai_client(
|
|
|
114
120
|
tools=tools,
|
|
115
121
|
reasoning=reasoning,
|
|
116
122
|
include=include,
|
|
117
|
-
|
|
123
|
+
text=text,
|
|
118
124
|
)
|
|
119
125
|
else:
|
|
120
126
|
return NonStreamOpenAIResponsesClient(
|
|
@@ -126,7 +132,7 @@ async def create_openai_client(
|
|
|
126
132
|
tools=tools,
|
|
127
133
|
reasoning=reasoning,
|
|
128
134
|
include=include,
|
|
129
|
-
|
|
135
|
+
text=text,
|
|
130
136
|
)
|
|
131
137
|
else:
|
|
132
138
|
if stream:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: LLM-Bridge
|
|
3
|
-
Version: 1.15.
|
|
3
|
+
Version: 1.15.9
|
|
4
4
|
Summary: A Bridge for LLMs
|
|
5
5
|
Author-email: windsnow1025 <windsnow1025@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -48,7 +48,7 @@ The features listed represent the maximum capabilities of each API type supporte
|
|
|
48
48
|
|
|
49
49
|
| API Type | Input Format | Capabilities | Output Format |
|
|
50
50
|
|----------|--------------------------------|---------------------------------------------------------|-------------------|
|
|
51
|
-
| OpenAI | Text, Image, PDF | Thinking, Web Search, Code Execution
|
|
51
|
+
| OpenAI | Text, Image, PDF | Thinking, Web Search, Code Execution, Structured Output | Text, Image |
|
|
52
52
|
| Gemini | Text, Image, Video, Audio, PDF | Thinking, Web Search, Code Execution, Structured Output | Text, Image, File |
|
|
53
53
|
| Claude | Text, Image, PDF | Thinking, Web Search, Code Execution | Text, File |
|
|
54
54
|
| Grok | Text, Image | | Text |
|
|
@@ -15,26 +15,26 @@ llm_bridge/client/implementations/gemini/non_stream_gemini_client.py,sha256=JGNN
|
|
|
15
15
|
llm_bridge/client/implementations/gemini/stream_gemini_client.py,sha256=vqPhQdr-jaHXzn-_1PSZfpo96zM-_89XOEXIx7UBBIw,1545
|
|
16
16
|
llm_bridge/client/implementations/openai/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
17
17
|
llm_bridge/client/implementations/openai/non_stream_openai_client.py,sha256=aceJm6FF6VdzVRECzJyTY8-aQjCekhhbrMPEcUN24fo,2171
|
|
18
|
-
llm_bridge/client/implementations/openai/non_stream_openai_responses_client.py,sha256=
|
|
18
|
+
llm_bridge/client/implementations/openai/non_stream_openai_responses_client.py,sha256=kaih9IVG4JpTCMxeSeZYoMHky-wok9bacza24u1zlhY,2305
|
|
19
19
|
llm_bridge/client/implementations/openai/openai_responses_response_handler.py,sha256=Q8v7Y3KNdrcCxj2VuKzzHkayoCofsHGgpJz5T4IGBTQ,5586
|
|
20
20
|
llm_bridge/client/implementations/openai/openai_token_couter.py,sha256=ah4rMteMYYTAVREpVEsbhkJIIdDfpBopnalthi67eaY,1602
|
|
21
|
-
llm_bridge/client/implementations/openai/steam_openai_responses_client.py,sha256=
|
|
21
|
+
llm_bridge/client/implementations/openai/steam_openai_responses_client.py,sha256=idTGwbEfYfQJM0Occz7qrbFHJ0XxGLH2hy7PnpeKZjg,3157
|
|
22
22
|
llm_bridge/client/implementations/openai/stream_openai_client.py,sha256=Izq4xH9EuLjUCBJsuSr6U4Kj6FN5c7w_oHf9wmQatXE,2988
|
|
23
23
|
llm_bridge/client/model_client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
24
24
|
llm_bridge/client/model_client/claude_client.py,sha256=xLRXYD9t5E3QBVIMe-GdD7eESC752cM9_3FCcp6MFIg,1446
|
|
25
25
|
llm_bridge/client/model_client/gemini_client.py,sha256=4dcueIbpLFqkT98WxmeVmW9Vbq7Z5jbYbifAem-NL1E,906
|
|
26
|
-
llm_bridge/client/model_client/openai_client.py,sha256=
|
|
26
|
+
llm_bridge/client/model_client/openai_client.py,sha256=FXb-iD6_yNU_Eq8EhDD6qy8lynqORRM7uDdv8AvRncE,1431
|
|
27
27
|
llm_bridge/logic/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
28
28
|
llm_bridge/logic/file_fetch.py,sha256=Q8PGNj76E25sKD70TmlnSIdPgAxpNlb89syk87DbAGg,1341
|
|
29
29
|
llm_bridge/logic/model_prices.py,sha256=yQ65U-OBtsw1dhYhEn9a59RisHiIegaLHDI3Ak3OMXY,1396
|
|
30
30
|
llm_bridge/logic/chat_generate/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
31
|
-
llm_bridge/logic/chat_generate/chat_client_factory.py,sha256=
|
|
31
|
+
llm_bridge/logic/chat_generate/chat_client_factory.py,sha256=NIS1RVXSj3TAl5tEzyIGGIV-D4xVGsiZfvvmXLndxmc,4395
|
|
32
32
|
llm_bridge/logic/chat_generate/chat_message_converter.py,sha256=40VTBOPXg_ocrEZMdt1ObYlm-mhRL35zWzzxv8m2xRc,1538
|
|
33
33
|
llm_bridge/logic/chat_generate/media_processor.py,sha256=icl2kX-2SBFt09fjQ5tpmznmuu3WgnZAOiISp0NU8lw,763
|
|
34
34
|
llm_bridge/logic/chat_generate/model_client_factory/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
35
35
|
llm_bridge/logic/chat_generate/model_client_factory/claude_client_factory.py,sha256=mlGcCPnSqu8KBzD-Yl4Qtsw5L_2TE2ezuL9NcD-iYIY,3815
|
|
36
36
|
llm_bridge/logic/chat_generate/model_client_factory/gemini_client_factory.py,sha256=6CuacST1bLUGhY-rGH0bm5tu3r9iQQhIweN32TgqLCc,3692
|
|
37
|
-
llm_bridge/logic/chat_generate/model_client_factory/openai_client_factory.py,sha256=
|
|
37
|
+
llm_bridge/logic/chat_generate/model_client_factory/openai_client_factory.py,sha256=fjtR0FhSjLr7vWggl5nYB1-sVTC9uf4tjK0S2qPNc4A,5291
|
|
38
38
|
llm_bridge/logic/chat_generate/model_client_factory/schema_converter.py,sha256=kQ3RGyg_9vbe7oYzbl11Dzu-tHPY1z2-SBBSgHHwPfM,143
|
|
39
39
|
llm_bridge/logic/chat_generate/model_message_converter/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
40
40
|
llm_bridge/logic/chat_generate/model_message_converter/claude_message_converter.py,sha256=YiPqMkybCXrsAJOFcUfPOHXdMkn3mZxq7gft_W449dA,2439
|
|
@@ -57,7 +57,7 @@ llm_bridge/type/model_message/claude_message.py,sha256=gYJUTbLUeifQMva3Axarc-VFe
|
|
|
57
57
|
llm_bridge/type/model_message/gemini_message.py,sha256=mh8pf929g7_NkBzSOwnLXyrwSzTT4yt2FmyX7NZn0sM,4302
|
|
58
58
|
llm_bridge/type/model_message/openai_message.py,sha256=xFaLY-cZoSwNd7E9BSWQjBNcRfCVH11X9s2yxXlctR0,453
|
|
59
59
|
llm_bridge/type/model_message/openai_responses_message.py,sha256=be1q2euA0ybjj4NO6NxOGIRB9eJuXSb4ssUm_bM4Ocs,1529
|
|
60
|
-
llm_bridge-1.15.
|
|
61
|
-
llm_bridge-1.15.
|
|
62
|
-
llm_bridge-1.15.
|
|
63
|
-
llm_bridge-1.15.
|
|
60
|
+
llm_bridge-1.15.9.dist-info/METADATA,sha256=7073wiw-Kvihk5iHMv1LCGkMzffUq4T_GQLz99LO5Ig,3309
|
|
61
|
+
llm_bridge-1.15.9.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
62
|
+
llm_bridge-1.15.9.dist-info/licenses/LICENSE,sha256=m6uon-6P_CaiqcBfApMfjG9YRtDxcr40Z52JcqUCEAE,1069
|
|
63
|
+
llm_bridge-1.15.9.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|