LLM-Bridge 1.15.7__tar.gz → 1.15.9__tar.gz
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-1.15.7 → llm_bridge-1.15.9}/PKG-INFO +3 -3
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/README.md +2 -2
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/client/implementations/openai/non_stream_openai_responses_client.py +1 -1
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/client/implementations/openai/steam_openai_responses_client.py +1 -1
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/client/model_client/openai_client.py +4 -5
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/logic/chat_generate/chat_client_factory.py +1 -1
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/logic/chat_generate/model_client_factory/openai_client_factory.py +14 -8
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/logic/chat_generate/model_message_converter/openai_responses_message_converter.py +13 -7
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/pyproject.toml +4 -4
- llm_bridge-1.15.9/usage/config.py +176 -0
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/uv.lock +4 -4
- llm_bridge-1.15.7/usage/config.py +0 -129
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/.gitattributes +0 -0
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/.github/workflows/python-publish.yml +0 -0
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/.github/workflows/python-test.yaml +0 -0
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/.gitignore +0 -0
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/.run/pytest.run.xml +0 -0
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/LICENSE +0 -0
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/MANIFEST.in +0 -0
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/__init__.py +0 -0
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/client/__init__.py +0 -0
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/client/chat_client.py +0 -0
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/client/implementations/__init__.py +0 -0
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/client/implementations/claude/__init__.py +0 -0
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/client/implementations/claude/claude_response_handler.py +0 -0
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/client/implementations/claude/claude_token_counter.py +0 -0
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/client/implementations/claude/non_stream_claude_client.py +0 -0
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/client/implementations/claude/stream_claude_client.py +0 -0
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/client/implementations/gemini/__init__.py +0 -0
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/client/implementations/gemini/gemini_response_handler.py +0 -0
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/client/implementations/gemini/gemini_token_counter.py +0 -0
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/client/implementations/gemini/non_stream_gemini_client.py +0 -0
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/client/implementations/gemini/stream_gemini_client.py +0 -0
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/client/implementations/openai/__init__.py +0 -0
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/client/implementations/openai/non_stream_openai_client.py +0 -0
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/client/implementations/openai/openai_responses_response_handler.py +0 -0
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/client/implementations/openai/openai_token_couter.py +0 -0
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/client/implementations/openai/stream_openai_client.py +0 -0
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/client/implementations/printing_status.py +0 -0
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/client/model_client/__init__.py +0 -0
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/client/model_client/claude_client.py +0 -0
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/client/model_client/gemini_client.py +0 -0
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/logic/__init__.py +0 -0
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/logic/chat_generate/__init__.py +0 -0
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/logic/chat_generate/chat_message_converter.py +0 -0
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/logic/chat_generate/media_processor.py +0 -0
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/logic/chat_generate/model_client_factory/__init__.py +0 -0
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/logic/chat_generate/model_client_factory/claude_client_factory.py +0 -0
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/logic/chat_generate/model_client_factory/gemini_client_factory.py +0 -0
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/logic/chat_generate/model_client_factory/schema_converter.py +0 -0
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/logic/chat_generate/model_message_converter/__init__.py +0 -0
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/logic/chat_generate/model_message_converter/claude_message_converter.py +0 -0
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/logic/chat_generate/model_message_converter/gemini_message_converter.py +0 -0
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/logic/chat_generate/model_message_converter/openai_message_converter.py +0 -0
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/logic/file_fetch.py +0 -0
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/logic/message_preprocess/__init__.py +0 -0
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/logic/message_preprocess/code_file_extensions.py +0 -0
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/logic/message_preprocess/document_processor.py +0 -0
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/logic/message_preprocess/file_type_checker.py +0 -0
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/logic/message_preprocess/message_preprocessor.py +0 -0
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/logic/model_prices.py +0 -0
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/resources/__init__.py +0 -0
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/resources/model_prices.json +0 -0
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/type/__init__.py +0 -0
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/type/chat_response.py +0 -0
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/type/message.py +0 -0
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/type/model_message/__init__.py +0 -0
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/type/model_message/claude_message.py +0 -0
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/type/model_message/gemini_message.py +0 -0
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/type/model_message/openai_message.py +0 -0
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/type/model_message/openai_responses_message.py +0 -0
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/type/serializer.py +0 -0
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/tests/__init__.py +0 -0
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/tests/file_type_checker_test.py +0 -0
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/tests/model_prices_test.py +0 -0
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/usage/.env.example +0 -0
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/usage/main.py +0 -0
- {llm_bridge-1.15.7 → llm_bridge-1.15.9}/usage/workflow.py +0 -0
|
@@ -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
|
|
@@ -24,7 +24,7 @@ Description-Content-Type: text/markdown
|
|
|
24
24
|
|
|
25
25
|
# LLM Bridge
|
|
26
26
|
|
|
27
|
-
LLM Bridge is a unified
|
|
27
|
+
LLM Bridge is a unified API wrapper for native interactions with various LLM providers.
|
|
28
28
|
|
|
29
29
|
GitHub: [https://github.com/windsnow1025/LLM-Bridge](https://github.com/windsnow1025/LLM-Bridge)
|
|
30
30
|
|
|
@@ -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 |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# LLM Bridge
|
|
2
2
|
|
|
3
|
-
LLM Bridge is a unified
|
|
3
|
+
LLM Bridge is a unified API wrapper for native interactions with various LLM providers.
|
|
4
4
|
|
|
5
5
|
GitHub: [https://github.com/windsnow1025/LLM-Bridge](https://github.com/windsnow1025/LLM-Bridge)
|
|
6
6
|
|
|
@@ -24,7 +24,7 @@ The features listed represent the maximum capabilities of each API type supporte
|
|
|
24
24
|
|
|
25
25
|
| API Type | Input Format | Capabilities | Output Format |
|
|
26
26
|
|----------|--------------------------------|---------------------------------------------------------|-------------------|
|
|
27
|
-
| OpenAI | Text, Image, PDF | Thinking, Web Search, Code Execution
|
|
27
|
+
| OpenAI | Text, Image, PDF | Thinking, Web Search, Code Execution, Structured Output | Text, Image |
|
|
28
28
|
| Gemini | Text, Image, Video, Audio, PDF | Thinking, Web Search, Code Execution, Structured Output | Text, Image, File |
|
|
29
29
|
| Claude | Text, Image, PDF | Thinking, Web Search, Code Execution | Text, File |
|
|
30
30
|
| Grok | Text, Image | | Text |
|
|
@@ -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:
|
|
@@ -3,18 +3,19 @@ from openai.types.responses import ResponseInputTextParam, ResponseInputImagePar
|
|
|
3
3
|
|
|
4
4
|
from llm_bridge.logic.chat_generate import media_processor
|
|
5
5
|
from llm_bridge.logic.message_preprocess.file_type_checker import get_file_type, get_filename_without_timestamp
|
|
6
|
-
from llm_bridge.type.message import Message, ContentType
|
|
6
|
+
from llm_bridge.type.message import Message, ContentType, Role
|
|
7
7
|
from llm_bridge.type.model_message.openai_responses_message import OpenAIResponsesMessage
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
async def convert_message_to_openai_responses(message: Message) -> OpenAIResponsesMessage:
|
|
11
|
-
role = message.role
|
|
11
|
+
role = message.role
|
|
12
12
|
content: list[ResponseInputContentParam | ResponseOutputTextParam] = []
|
|
13
|
+
contains_pdf = False
|
|
13
14
|
|
|
14
15
|
for content_item in message.contents:
|
|
15
16
|
if content_item.type == ContentType.Text:
|
|
16
|
-
if role ==
|
|
17
|
-
text_content = ResponseOutputTextParam(type="output_text", text=content_item.data)
|
|
17
|
+
if role == Role.Assistant:
|
|
18
|
+
text_content = ResponseOutputTextParam(type="output_text", text=content_item.data, annotations=[])
|
|
18
19
|
else:
|
|
19
20
|
text_content = ResponseInputTextParam(type="input_text", text=content_item.data)
|
|
20
21
|
content.append(text_content)
|
|
@@ -30,6 +31,7 @@ async def convert_message_to_openai_responses(message: Message) -> OpenAIRespons
|
|
|
30
31
|
)
|
|
31
32
|
content.append(image_content)
|
|
32
33
|
elif sub_type == "pdf":
|
|
34
|
+
contains_pdf = True
|
|
33
35
|
file_data, _ = await media_processor.get_base64_content_from_url(file_url)
|
|
34
36
|
pdf_content = ResponseInputFileParam(
|
|
35
37
|
type="input_file",
|
|
@@ -52,7 +54,11 @@ async def convert_message_to_openai_responses(message: Message) -> OpenAIRespons
|
|
|
52
54
|
)
|
|
53
55
|
content.append(text_content)
|
|
54
56
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
+
# Force system role to user if the message contains a PDF
|
|
58
|
+
if role == Role.System and contains_pdf:
|
|
59
|
+
role = Role.User
|
|
60
|
+
|
|
61
|
+
if role in (Role.User, Role.System):
|
|
62
|
+
return EasyInputMessageParam(role=role.value, content=content)
|
|
57
63
|
else:
|
|
58
|
-
return ResponseOutputMessageParam(role=role, content=content)
|
|
64
|
+
return ResponseOutputMessageParam(role=role.value, content=content)
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "LLM-Bridge"
|
|
7
|
-
version = "1.15.
|
|
7
|
+
version = "1.15.9"
|
|
8
8
|
dependencies = [
|
|
9
9
|
"fastapi",
|
|
10
10
|
"httpx",
|
|
@@ -33,9 +33,9 @@ classifiers = [
|
|
|
33
33
|
|
|
34
34
|
[dependency-groups]
|
|
35
35
|
dev = [
|
|
36
|
-
"pytest",
|
|
37
|
-
"pytest-asyncio",
|
|
38
|
-
"python-dotenv", #dotenv
|
|
36
|
+
"pytest==9.0.2",
|
|
37
|
+
"pytest-asyncio==1.3.0",
|
|
38
|
+
"python-dotenv==1.2.1", #dotenv
|
|
39
39
|
]
|
|
40
40
|
|
|
41
41
|
[tool.pytest.ini_options]
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
from llm_bridge import *
|
|
2
|
+
|
|
3
|
+
# Standard JSON Schema
|
|
4
|
+
# structured_output_schema = {
|
|
5
|
+
# "$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
6
|
+
# "$id": "https://example.com/product.schema.json",
|
|
7
|
+
# "title": "Product",
|
|
8
|
+
# "description": "A product from Acme's catalog",
|
|
9
|
+
# "type": "object",
|
|
10
|
+
# "properties": {
|
|
11
|
+
# "productId": {
|
|
12
|
+
# "description": "The unique identifier for a product",
|
|
13
|
+
# "type": "integer"
|
|
14
|
+
# },
|
|
15
|
+
# "productName": {
|
|
16
|
+
# "description": "Name of the product",
|
|
17
|
+
# "type": "string"
|
|
18
|
+
# },
|
|
19
|
+
# "price": {
|
|
20
|
+
# "description": "The price of the product",
|
|
21
|
+
# "type": "number",
|
|
22
|
+
# "exclusiveMinimum": 0
|
|
23
|
+
# },
|
|
24
|
+
# "tags": {
|
|
25
|
+
# "description": "Tags for the product",
|
|
26
|
+
# "type": "array",
|
|
27
|
+
# "items": {
|
|
28
|
+
# "type": "string"
|
|
29
|
+
# },
|
|
30
|
+
# "minItems": 1,
|
|
31
|
+
# "uniqueItems": True
|
|
32
|
+
# }
|
|
33
|
+
# },
|
|
34
|
+
# "required": [
|
|
35
|
+
# "productId",
|
|
36
|
+
# "productName",
|
|
37
|
+
# "price"
|
|
38
|
+
# ],
|
|
39
|
+
# "additionalProperties": False
|
|
40
|
+
# }
|
|
41
|
+
|
|
42
|
+
# OpenAI Responses API JSON Schema
|
|
43
|
+
structured_output_schema = {
|
|
44
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
45
|
+
"$id": "https://example.com/product.schema.json",
|
|
46
|
+
"title": "Product",
|
|
47
|
+
"description": "A product from Acme's catalog",
|
|
48
|
+
"type": "object",
|
|
49
|
+
"properties": {
|
|
50
|
+
"productId": {
|
|
51
|
+
"description": "The unique identifier for a product",
|
|
52
|
+
"type": "integer"
|
|
53
|
+
},
|
|
54
|
+
"productName": {
|
|
55
|
+
"description": "Name of the product",
|
|
56
|
+
"type": "string"
|
|
57
|
+
},
|
|
58
|
+
"price": {
|
|
59
|
+
"description": "The price of the product",
|
|
60
|
+
"type": "number",
|
|
61
|
+
"exclusiveMinimum": 0
|
|
62
|
+
},
|
|
63
|
+
"tags": {
|
|
64
|
+
"description": "Tags for the product",
|
|
65
|
+
"type": "array",
|
|
66
|
+
"items": {
|
|
67
|
+
"type": "string"
|
|
68
|
+
},
|
|
69
|
+
"minItems": 1,
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"required": [
|
|
73
|
+
"productId",
|
|
74
|
+
"productName",
|
|
75
|
+
"price",
|
|
76
|
+
"tags"
|
|
77
|
+
],
|
|
78
|
+
"additionalProperties": False
|
|
79
|
+
}
|
|
80
|
+
# structured_output_schema = None
|
|
81
|
+
|
|
82
|
+
messages = [
|
|
83
|
+
Message(
|
|
84
|
+
role=Role.System,
|
|
85
|
+
contents=[
|
|
86
|
+
Content(type=ContentType.Text, data="You are a helpful assistant."),
|
|
87
|
+
# Content(type=ContentType.File, data="https://www.windsnow1025.com/minio/windsnow/uploads/1/1746209841847-A%20Tutorial%20on%20Spectral%20Clustering.pdf")
|
|
88
|
+
]
|
|
89
|
+
),
|
|
90
|
+
# Message(
|
|
91
|
+
# role=Role.User,
|
|
92
|
+
# contents=[
|
|
93
|
+
# Content(type=ContentType.Text, data="Hello")
|
|
94
|
+
# ]
|
|
95
|
+
# ),
|
|
96
|
+
# Message(
|
|
97
|
+
# role=Role.Assistant,
|
|
98
|
+
# contents=[
|
|
99
|
+
# Content(type=ContentType.Text, data="Hello! How can I assist you today?")
|
|
100
|
+
# ]
|
|
101
|
+
# ),
|
|
102
|
+
Message(
|
|
103
|
+
role=Role.User,
|
|
104
|
+
contents=[
|
|
105
|
+
# Simple Question
|
|
106
|
+
# Content(type=ContentType.Text, data="What's this?"),
|
|
107
|
+
|
|
108
|
+
# Thinking
|
|
109
|
+
# Content(type=ContentType.Text, data="Explain the concept of Occam's Razor and provide a simple, everyday example."),
|
|
110
|
+
|
|
111
|
+
# Web Search
|
|
112
|
+
# Content(type=ContentType.Text, data="What's the weather in NYC today?"),
|
|
113
|
+
|
|
114
|
+
# Image Understanding
|
|
115
|
+
# Content(type=ContentType.File, data="https://www.gstatic.com/webp/gallery3/1.png"),
|
|
116
|
+
# Content(type=ContentType.Text, data="What is in this image?"),
|
|
117
|
+
|
|
118
|
+
# Image Generation
|
|
119
|
+
# Content(type=ContentType.Text, data="Please generate an image of a cat."),
|
|
120
|
+
|
|
121
|
+
# URL Context
|
|
122
|
+
# Content(type=ContentType.Text, data="What is in https://www.windsnow1025.com/"),
|
|
123
|
+
|
|
124
|
+
# Code Execution
|
|
125
|
+
# Content(type=ContentType.Text, data="What is the sum of the first 50 prime numbers? Generate and run code for the calculation, and make sure you get all 50."),
|
|
126
|
+
|
|
127
|
+
# File Output
|
|
128
|
+
# Content(type=ContentType.Text, data="Create a matplotlib visualization and save it as output.png"),
|
|
129
|
+
|
|
130
|
+
# Structured Output
|
|
131
|
+
Content(type=ContentType.Text, data="Please generate a product."),
|
|
132
|
+
]
|
|
133
|
+
),
|
|
134
|
+
# Message(
|
|
135
|
+
# role=Role.User,
|
|
136
|
+
# contents=[
|
|
137
|
+
# Content(type=ContentType.File, data="https://www.windsnow1025.com/minio/windsnow/uploads/1/1769429581512-Test.txt"),
|
|
138
|
+
# # Content(type=ContentType.File, data="https://www.windsnow1025.com/minio/windsnow/uploads/1/1746208707489-image.png"),
|
|
139
|
+
# # Content(type=ContentType.File, data="https://www.windsnow1025.com/minio/windsnow/uploads/1/1746209841847-A%20Tutorial%20on%20Spectral%20Clustering.pdf"),
|
|
140
|
+
# # Content(type=ContentType.File, data="https://www.windsnow1025.com/minio/windsnow/uploads/1/1746212253473-file_example_MP3_700KB.mp3"),
|
|
141
|
+
# # Content(type=ContentType.File, data="https://www.windsnow1025.com/minio/windsnow/uploads/1/1746212980820-file_example_MP4_480_1_5MG.mp4"),
|
|
142
|
+
# Content(type=ContentType.Text, data="What's this?"),
|
|
143
|
+
# ]
|
|
144
|
+
# ),
|
|
145
|
+
]
|
|
146
|
+
|
|
147
|
+
# See /llm_bridge/resources/model_prices.json for available models
|
|
148
|
+
model = "gpt-5.2"
|
|
149
|
+
# model = "gpt-5.1"
|
|
150
|
+
# model = "gpt-5-pro"
|
|
151
|
+
# model = "gpt-5"
|
|
152
|
+
# model = "gpt-4.1"
|
|
153
|
+
# model = "gpt-5-codex"
|
|
154
|
+
# model = "gemini-3-pro-preview"
|
|
155
|
+
# model = "gemini-3-pro-image-preview"
|
|
156
|
+
# model = "gemini-3-flash-preview"
|
|
157
|
+
# model = "grok-4-1-fast-reasoning"
|
|
158
|
+
# model = "claude-sonnet-4-5"
|
|
159
|
+
# model = "claude-opus-4-5"
|
|
160
|
+
|
|
161
|
+
# api_type = "Gemini-Vertex"
|
|
162
|
+
# api_type = "Gemini-Free"
|
|
163
|
+
# api_type = "Gemini-Paid"
|
|
164
|
+
api_type = "OpenAI"
|
|
165
|
+
# api_type = "OpenAI-Azure"
|
|
166
|
+
# api_type = "OpenAI-GitHub"
|
|
167
|
+
# api_type = "Claude"
|
|
168
|
+
# api_type = "Grok"
|
|
169
|
+
|
|
170
|
+
temperature = 0
|
|
171
|
+
stream = True
|
|
172
|
+
# stream = False
|
|
173
|
+
thought = True
|
|
174
|
+
# thought = False
|
|
175
|
+
# code_execution = True
|
|
176
|
+
code_execution = False
|
|
@@ -357,7 +357,7 @@ wheels = [
|
|
|
357
357
|
|
|
358
358
|
[[package]]
|
|
359
359
|
name = "llm-bridge"
|
|
360
|
-
version = "1.15.
|
|
360
|
+
version = "1.15.9"
|
|
361
361
|
source = { editable = "." }
|
|
362
362
|
dependencies = [
|
|
363
363
|
{ name = "anthropic" },
|
|
@@ -397,9 +397,9 @@ requires-dist = [
|
|
|
397
397
|
|
|
398
398
|
[package.metadata.requires-dev]
|
|
399
399
|
dev = [
|
|
400
|
-
{ name = "pytest" },
|
|
401
|
-
{ name = "pytest-asyncio" },
|
|
402
|
-
{ name = "python-dotenv" },
|
|
400
|
+
{ name = "pytest", specifier = "==9.0.2" },
|
|
401
|
+
{ name = "pytest-asyncio", specifier = "==1.3.0" },
|
|
402
|
+
{ name = "python-dotenv", specifier = "==1.2.1" },
|
|
403
403
|
]
|
|
404
404
|
|
|
405
405
|
[[package]]
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
from llm_bridge import *
|
|
2
|
-
|
|
3
|
-
structured_output_schema = {
|
|
4
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
5
|
-
"$id": "https://example.com/product.schema.json",
|
|
6
|
-
"title": "Product",
|
|
7
|
-
"description": "A product from Acme's catalog",
|
|
8
|
-
"type": "object",
|
|
9
|
-
"properties": {
|
|
10
|
-
"productId": {
|
|
11
|
-
"description": "The unique identifier for a product",
|
|
12
|
-
"type": "integer"
|
|
13
|
-
},
|
|
14
|
-
"productName": {
|
|
15
|
-
"description": "Name of the product",
|
|
16
|
-
"type": "string"
|
|
17
|
-
},
|
|
18
|
-
"price": {
|
|
19
|
-
"description": "The price of the product",
|
|
20
|
-
"type": "number",
|
|
21
|
-
"exclusiveMinimum": 0
|
|
22
|
-
},
|
|
23
|
-
"tags": {
|
|
24
|
-
"description": "Tags for the product",
|
|
25
|
-
"type": "array",
|
|
26
|
-
"items": {
|
|
27
|
-
"type": "string"
|
|
28
|
-
},
|
|
29
|
-
"minItems": 1,
|
|
30
|
-
"uniqueItems": True
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
"required": [
|
|
34
|
-
"productId",
|
|
35
|
-
"productName",
|
|
36
|
-
"price"
|
|
37
|
-
]
|
|
38
|
-
}
|
|
39
|
-
structured_output_schema = None
|
|
40
|
-
|
|
41
|
-
messages = [
|
|
42
|
-
Message(
|
|
43
|
-
role=Role.System,
|
|
44
|
-
contents=[
|
|
45
|
-
Content(type=ContentType.Text, data="You are a helpful assistant.")
|
|
46
|
-
]
|
|
47
|
-
),
|
|
48
|
-
Message(
|
|
49
|
-
role=Role.User,
|
|
50
|
-
contents=[
|
|
51
|
-
Content(type=ContentType.Text, data="Hello")
|
|
52
|
-
]
|
|
53
|
-
),
|
|
54
|
-
Message(
|
|
55
|
-
role=Role.Assistant,
|
|
56
|
-
contents=[
|
|
57
|
-
Content(type=ContentType.Text, data="Hello! How can I assist you today?")
|
|
58
|
-
]
|
|
59
|
-
),
|
|
60
|
-
# Message(
|
|
61
|
-
# role=Role.User,
|
|
62
|
-
# contents=[
|
|
63
|
-
# # Thinking
|
|
64
|
-
# # Content(type=ContentType.Text, data="Explain the concept of Occam's Razor and provide a simple, everyday example."),
|
|
65
|
-
#
|
|
66
|
-
# # Web Search
|
|
67
|
-
# # Content(type=ContentType.Text, data="What's the weather in NYC today?"),
|
|
68
|
-
#
|
|
69
|
-
# # Image Understanding
|
|
70
|
-
# # Content(type=ContentType.File, data="https://www.gstatic.com/webp/gallery3/1.png"),
|
|
71
|
-
# # Content(type=ContentType.Text, data="What is in this image?"),
|
|
72
|
-
#
|
|
73
|
-
# # Image Generation
|
|
74
|
-
# # Content(type=ContentType.Text, data="Please generate an image of a cat."),
|
|
75
|
-
#
|
|
76
|
-
# # URL Context
|
|
77
|
-
# # Content(type=ContentType.Text, data="What is in https://www.windsnow1025.com/"),
|
|
78
|
-
#
|
|
79
|
-
# # Code Execution
|
|
80
|
-
# # Content(type=ContentType.Text, data="What is the sum of the first 50 prime numbers? Generate and run code for the calculation, and make sure you get all 50."),
|
|
81
|
-
#
|
|
82
|
-
# # File Output
|
|
83
|
-
# # Content(type=ContentType.Text, data="Create a matplotlib visualization and save it as output.png"),
|
|
84
|
-
#
|
|
85
|
-
# # Structured Output
|
|
86
|
-
# # Content(type=ContentType.Text, data="Please generate a product."),
|
|
87
|
-
# ]
|
|
88
|
-
# ),
|
|
89
|
-
Message(
|
|
90
|
-
role=Role.User,
|
|
91
|
-
contents=[
|
|
92
|
-
Content(type=ContentType.File, data="https://www.windsnow1025.com/minio/windsnow/uploads/1/1769429581512-Test.txt"),
|
|
93
|
-
# Content(type=ContentType.File, data="https://www.windsnow1025.com/minio/windsnow/uploads/1/1746208707489-image.png"),
|
|
94
|
-
# Content(type=ContentType.File, data="https://www.windsnow1025.com/minio/windsnow/uploads/1/1746209841847-A%20Tutorial%20on%20Spectral%20Clustering.pdf"),
|
|
95
|
-
# Content(type=ContentType.File, data="https://www.windsnow1025.com/minio/windsnow/uploads/1/1746212253473-file_example_MP3_700KB.mp3"),
|
|
96
|
-
# Content(type=ContentType.File, data="https://www.windsnow1025.com/minio/windsnow/uploads/1/1746212980820-file_example_MP4_480_1_5MG.mp4"),
|
|
97
|
-
# Content(type=ContentType.File, data="https://www.windsnow1025.com/minio/windsnow/uploads/1/1753804900037-Calculus.docx"),
|
|
98
|
-
Content(type=ContentType.Text, data="What's this?"),
|
|
99
|
-
]
|
|
100
|
-
),
|
|
101
|
-
]
|
|
102
|
-
# See /llm_bridge/resources/model_prices.json for available models
|
|
103
|
-
# model = "gpt-5.2"
|
|
104
|
-
# model = "gpt-5.1"
|
|
105
|
-
# model = "gpt-5-pro"
|
|
106
|
-
# model = "gpt-5"
|
|
107
|
-
# model = "gpt-4.1"
|
|
108
|
-
# model = "gpt-5-codex"
|
|
109
|
-
# model = "gemini-3-pro-preview"
|
|
110
|
-
# model = "gemini-3-pro-image-preview"
|
|
111
|
-
model = "gemini-3-flash-preview"
|
|
112
|
-
# model = "grok-4-1-fast-reasoning"
|
|
113
|
-
# model = "claude-sonnet-4-5"
|
|
114
|
-
# model = "claude-opus-4-5"
|
|
115
|
-
api_type = "Gemini-Vertex"
|
|
116
|
-
# api_type = "Gemini-Free"
|
|
117
|
-
# api_type = "Gemini-Paid"
|
|
118
|
-
# api_type = "OpenAI"
|
|
119
|
-
# api_type = "OpenAI-Azure"
|
|
120
|
-
# api_type = "OpenAI-GitHub"
|
|
121
|
-
# api_type = "Claude"
|
|
122
|
-
# api_type = "Grok"
|
|
123
|
-
temperature = 0
|
|
124
|
-
stream = True
|
|
125
|
-
# stream = False
|
|
126
|
-
thought = True
|
|
127
|
-
# thought = False
|
|
128
|
-
code_execution = True
|
|
129
|
-
# code_execution = False
|
|
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
|
{llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/client/implementations/claude/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/client/implementations/gemini/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/client/implementations/openai/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/client/implementations/printing_status.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/logic/chat_generate/chat_message_converter.py
RENAMED
|
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
|
{llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/logic/message_preprocess/code_file_extensions.py
RENAMED
|
File without changes
|
{llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/logic/message_preprocess/document_processor.py
RENAMED
|
File without changes
|
{llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/logic/message_preprocess/file_type_checker.py
RENAMED
|
File without changes
|
{llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/logic/message_preprocess/message_preprocessor.py
RENAMED
|
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
|
{llm_bridge-1.15.7 → llm_bridge-1.15.9}/llm_bridge/type/model_message/openai_responses_message.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|