LLM-Bridge 2.0.0a2__tar.gz → 2.0.2__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-2.0.0a2 → llm_bridge-2.0.2}/PKG-INFO +4 -14
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/README.md +3 -13
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/client/implementations/xai/stream_xai_client.py +6 -1
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/resources/model_prices.json +6 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/pyproject.toml +1 -1
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/uv.lock +1 -1
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/.gitattributes +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/.github/workflows/pypi-publish.yaml +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/.github/workflows/python-test.yaml +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/.gitignore +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/.run/batch.run.xml +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/.run/pytest.run.xml +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/.run/single.run.xml +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/LICENSE +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/MANIFEST.in +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/__init__.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/client/__init__.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/client/chat_client.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/client/implementations/__init__.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/client/implementations/claude/__init__.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/client/implementations/claude/claude_response_handler.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/client/implementations/claude/claude_token_counter.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/client/implementations/claude/non_stream_claude_client.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/client/implementations/claude/stream_claude_client.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/client/implementations/gemini/__init__.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/client/implementations/gemini/gemini_response_handler.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/client/implementations/gemini/gemini_token_counter.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/client/implementations/gemini/non_stream_gemini_client.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/client/implementations/gemini/stream_gemini_client.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/client/implementations/openai_completion/__init__.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/client/implementations/openai_completion/non_stream_openai_completion_client.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/client/implementations/openai_completion/stream_openai_completion_client.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/client/implementations/openai_responses/__init__.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/client/implementations/openai_responses/non_stream_openai_responses_client.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/client/implementations/openai_responses/openai_responses_response_handler.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/client/implementations/openai_responses/stream_openai_responses_client.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/client/implementations/xai/__init__.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/client/implementations/xai/non_stream_xai_client.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/client/implementations/xai/xai_response_handler.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/client/model_client/__init__.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/client/model_client/claude_client.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/client/model_client/gemini_client.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/client/model_client/openai_completion_client.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/client/model_client/openai_responses_client.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/client/model_client/xai_client.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/logic/__init__.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/logic/chat_generate/__init__.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/logic/chat_generate/chat_client_factory.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/logic/chat_generate/chat_message_converter.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/logic/chat_generate/media_processor.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/logic/chat_generate/model_client_factory/__init__.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/logic/chat_generate/model_client_factory/claude_client_factory.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/logic/chat_generate/model_client_factory/gemini_client_factory.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/logic/chat_generate/model_client_factory/openai_completion_client_factory.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/logic/chat_generate/model_client_factory/openai_responses_client_factory.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/logic/chat_generate/model_client_factory/xai_client_factory.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/logic/chat_generate/model_message_converter/__init__.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/logic/chat_generate/model_message_converter/claude_message_converter.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/logic/chat_generate/model_message_converter/gemini_message_converter.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/logic/chat_generate/model_message_converter/openai_completion_message_converter.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/logic/chat_generate/model_message_converter/openai_responses_message_converter.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/logic/chat_generate/model_message_converter/xai_message_converter.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/logic/file_fetch.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/logic/message_process/__init__.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/logic/message_process/code_file_extensions.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/logic/message_process/document_processor.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/logic/message_process/file_type_checker.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/logic/message_process/message_processor.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/logic/model_prices.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/resources/__init__.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/type/__init__.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/type/chat_response.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/type/message.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/type/model_message/__init__.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/type/model_message/claude_message.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/type/model_message/gemini_message.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/type/model_message/openai_completion_message.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/type/model_message/openai_responses_message.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/type/model_message/xai_message.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/type/serializer.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/tests/__init__.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/tests/file_type_checker_test.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/tests/model_prices_test.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/usage/.env.example +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/usage/__init__.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/usage/batch/__init__.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/usage/batch/batch.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/usage/batch/config.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/usage/keys.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/usage/messages.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/usage/single/__init__.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/usage/single/config.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/usage/single/single.py +0 -0
- {llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/usage/workflow.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: LLM-Bridge
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.2
|
|
4
4
|
Summary: A library that wraps multiple LLM providers into a consistent API while using each provider's native SDK internally, supporting multimodal I/O, file processing, and stream output.
|
|
5
5
|
Author-email: windsnow1025 <windsnow1025@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -31,15 +31,10 @@ PyPI: [https://pypi.org/project/LLM-Bridge/](https://pypi.org/project/LLM-Bridge
|
|
|
31
31
|
|
|
32
32
|
## Workflow and Features
|
|
33
33
|
|
|
34
|
-
1. **
|
|
35
|
-
2. **Chat Client Factory**: creates a client for the specific LLM API with model parameters
|
|
34
|
+
1. **Chat Client Factory**: creates a client for the specific LLM API with model parameters
|
|
36
35
|
1. **Model Message Converter**: converts general messages to model messages
|
|
37
|
-
1. **Media Processor**: converts general media
|
|
38
|
-
|
|
39
|
-
- **Model Thoughts**: captures the model's thinking process
|
|
40
|
-
- **Code Execution**: generates and executes Python code
|
|
41
|
-
- **Web Search**: generates response from search results
|
|
42
|
-
- **Token Counter**: tracks and reports input and output token usage
|
|
36
|
+
1. **Media Processor**: converts general media to model compatible formats.
|
|
37
|
+
2. **Chat Client**: generate stream or non-stream responses
|
|
43
38
|
|
|
44
39
|
### Supported Features for API Types
|
|
45
40
|
|
|
@@ -53,11 +48,6 @@ The features listed represent the maximum capabilities of each API type supporte
|
|
|
53
48
|
| Anthropic | Text, Image, PDF | Thinking, Web Search, Code Execution, Structured Output | Text, File |
|
|
54
49
|
| xAI | Text, Image, PDF, Audio, Video, docx, xlsx, pptx | Thinking, Web Search, Code Execution, Structured Output | Text |
|
|
55
50
|
|
|
56
|
-
#### Planned Features
|
|
57
|
-
|
|
58
|
-
- More features for API Types
|
|
59
|
-
- Native support for Grok
|
|
60
|
-
|
|
61
51
|
## Development
|
|
62
52
|
|
|
63
53
|
### Python uv
|
|
@@ -8,15 +8,10 @@ PyPI: [https://pypi.org/project/LLM-Bridge/](https://pypi.org/project/LLM-Bridge
|
|
|
8
8
|
|
|
9
9
|
## Workflow and Features
|
|
10
10
|
|
|
11
|
-
1. **
|
|
12
|
-
2. **Chat Client Factory**: creates a client for the specific LLM API with model parameters
|
|
11
|
+
1. **Chat Client Factory**: creates a client for the specific LLM API with model parameters
|
|
13
12
|
1. **Model Message Converter**: converts general messages to model messages
|
|
14
|
-
1. **Media Processor**: converts general media
|
|
15
|
-
|
|
16
|
-
- **Model Thoughts**: captures the model's thinking process
|
|
17
|
-
- **Code Execution**: generates and executes Python code
|
|
18
|
-
- **Web Search**: generates response from search results
|
|
19
|
-
- **Token Counter**: tracks and reports input and output token usage
|
|
13
|
+
1. **Media Processor**: converts general media to model compatible formats.
|
|
14
|
+
2. **Chat Client**: generate stream or non-stream responses
|
|
20
15
|
|
|
21
16
|
### Supported Features for API Types
|
|
22
17
|
|
|
@@ -30,11 +25,6 @@ The features listed represent the maximum capabilities of each API type supporte
|
|
|
30
25
|
| Anthropic | Text, Image, PDF | Thinking, Web Search, Code Execution, Structured Output | Text, File |
|
|
31
26
|
| xAI | Text, Image, PDF, Audio, Video, docx, xlsx, pptx | Thinking, Web Search, Code Execution, Structured Output | Text |
|
|
32
27
|
|
|
33
|
-
#### Planned Features
|
|
34
|
-
|
|
35
|
-
- More features for API Types
|
|
36
|
-
- Native support for Grok
|
|
37
|
-
|
|
38
28
|
## Development
|
|
39
29
|
|
|
40
30
|
### Python uv
|
{llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/client/implementations/xai/stream_xai_client.py
RENAMED
|
@@ -33,12 +33,17 @@ class StreamXAIClient(XAIClient):
|
|
|
33
33
|
raise HTTPException(status_code=error_code, detail=str(e))
|
|
34
34
|
|
|
35
35
|
try:
|
|
36
|
+
prev_cumulative_output_tokens: int = 0
|
|
36
37
|
async for response, chunk in chat.stream():
|
|
38
|
+
cumulative_output_tokens = chunk.proto.usage.completion_tokens
|
|
39
|
+
output_tokens = cumulative_output_tokens - prev_cumulative_output_tokens
|
|
40
|
+
prev_cumulative_output_tokens = cumulative_output_tokens
|
|
41
|
+
|
|
37
42
|
yield ChatResponse(
|
|
38
43
|
text=chunk.content,
|
|
39
44
|
thought=chunk.reasoning_content,
|
|
40
45
|
input_tokens=chunk.proto.usage.prompt_tokens,
|
|
41
|
-
output_tokens=
|
|
46
|
+
output_tokens=output_tokens,
|
|
42
47
|
)
|
|
43
48
|
except Exception as e:
|
|
44
49
|
logging.exception(e)
|
|
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
|
|
File without changes
|
{llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/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-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/client/implementations/gemini/__init__.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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/client/model_client/openai_completion_client.py
RENAMED
|
File without changes
|
{llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/client/model_client/openai_responses_client.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/logic/chat_generate/chat_client_factory.py
RENAMED
|
File without changes
|
{llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/logic/message_process/code_file_extensions.py
RENAMED
|
File without changes
|
{llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/logic/message_process/document_processor.py
RENAMED
|
File without changes
|
{llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/logic/message_process/file_type_checker.py
RENAMED
|
File without changes
|
{llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/logic/message_process/message_processor.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
|
{llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/llm_bridge/type/model_message/openai_completion_message.py
RENAMED
|
File without changes
|
{llm_bridge-2.0.0a2 → llm_bridge-2.0.2}/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
|
|
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
|