LLM-Bridge 2.1.0__tar.gz → 2.1.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.
Files changed (97) hide show
  1. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/PKG-INFO +1 -1
  2. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/llm_bridge/client/chat_client.py +1 -1
  3. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/llm_bridge/client/implementations/claude/stream_claude_client.py +1 -1
  4. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/llm_bridge/client/implementations/gemini/gemini_response_handler.py +1 -2
  5. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/llm_bridge/client/implementations/gemini/stream_gemini_client.py +1 -1
  6. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/llm_bridge/client/implementations/openai_completion/stream_openai_completion_client.py +1 -1
  7. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/llm_bridge/client/implementations/openai_responses/stream_openai_responses_client.py +1 -1
  8. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/llm_bridge/client/implementations/xai/stream_xai_client.py +1 -1
  9. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/llm_bridge/client/model_client/claude_client.py +4 -4
  10. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/llm_bridge/client/model_client/gemini_client.py +1 -1
  11. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/llm_bridge/client/model_client/openai_completion_client.py +2 -1
  12. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/llm_bridge/client/model_client/openai_responses_client.py +1 -1
  13. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/llm_bridge/client/model_client/xai_client.py +1 -1
  14. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/llm_bridge/logic/chat_generate/model_client_factory/claude_client_factory.py +3 -9
  15. llm_bridge-2.1.2/llm_bridge/type/chat_response.py +22 -0
  16. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/llm_bridge/type/message.py +1 -1
  17. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/llm_bridge/type/model_message/claude_message.py +2 -3
  18. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/llm_bridge/type/model_message/gemini_message.py +2 -3
  19. llm_bridge-2.1.2/llm_bridge/type/model_message/openai_completion_message.py +12 -0
  20. llm_bridge-2.1.2/llm_bridge/type/model_message/openai_responses_message.py +10 -0
  21. llm_bridge-2.1.2/llm_bridge/type/model_message/xai_message.py +5 -0
  22. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/pyproject.toml +1 -1
  23. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/usage/batch/batch.py +3 -5
  24. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/usage/workflow.py +2 -1
  25. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/uv.lock +1 -1
  26. llm_bridge-2.1.0/MANIFEST.in +0 -1
  27. llm_bridge-2.1.0/llm_bridge/type/chat_response.py +0 -23
  28. llm_bridge-2.1.0/llm_bridge/type/model_message/openai_completion_message.py +0 -14
  29. llm_bridge-2.1.0/llm_bridge/type/model_message/openai_responses_message.py +0 -12
  30. llm_bridge-2.1.0/llm_bridge/type/model_message/xai_message.py +0 -7
  31. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/.gitattributes +0 -0
  32. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/.github/workflows/pypi-publish.yaml +0 -0
  33. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/.github/workflows/python-test.yaml +0 -0
  34. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/.gitignore +0 -0
  35. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/.run/batch.run.xml +0 -0
  36. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/.run/pytest.run.xml +0 -0
  37. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/.run/single.run.xml +0 -0
  38. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/LICENSE +0 -0
  39. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/README.md +0 -0
  40. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/llm_bridge/__init__.py +0 -0
  41. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/llm_bridge/client/__init__.py +0 -0
  42. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/llm_bridge/client/implementations/__init__.py +0 -0
  43. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/llm_bridge/client/implementations/claude/__init__.py +0 -0
  44. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/llm_bridge/client/implementations/claude/claude_response_handler.py +0 -0
  45. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/llm_bridge/client/implementations/claude/claude_token_counter.py +0 -0
  46. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/llm_bridge/client/implementations/claude/non_stream_claude_client.py +0 -0
  47. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/llm_bridge/client/implementations/gemini/__init__.py +0 -0
  48. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/llm_bridge/client/implementations/gemini/gemini_token_counter.py +0 -0
  49. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/llm_bridge/client/implementations/gemini/non_stream_gemini_client.py +0 -0
  50. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/llm_bridge/client/implementations/openai_completion/__init__.py +0 -0
  51. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/llm_bridge/client/implementations/openai_completion/non_stream_openai_completion_client.py +0 -0
  52. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/llm_bridge/client/implementations/openai_responses/__init__.py +0 -0
  53. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/llm_bridge/client/implementations/openai_responses/non_stream_openai_responses_client.py +0 -0
  54. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/llm_bridge/client/implementations/openai_responses/openai_responses_response_handler.py +0 -0
  55. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/llm_bridge/client/implementations/xai/__init__.py +0 -0
  56. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/llm_bridge/client/implementations/xai/non_stream_xai_client.py +0 -0
  57. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/llm_bridge/client/model_client/__init__.py +0 -0
  58. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/llm_bridge/logic/__init__.py +0 -0
  59. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/llm_bridge/logic/chat_generate/__init__.py +0 -0
  60. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/llm_bridge/logic/chat_generate/chat_client_factory.py +0 -0
  61. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/llm_bridge/logic/chat_generate/chat_message_converter.py +0 -0
  62. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/llm_bridge/logic/chat_generate/media_processor.py +0 -0
  63. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/llm_bridge/logic/chat_generate/model_client_factory/__init__.py +0 -0
  64. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/llm_bridge/logic/chat_generate/model_client_factory/gemini_client_factory.py +0 -0
  65. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/llm_bridge/logic/chat_generate/model_client_factory/openai_completion_client_factory.py +0 -0
  66. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/llm_bridge/logic/chat_generate/model_client_factory/openai_responses_client_factory.py +0 -0
  67. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/llm_bridge/logic/chat_generate/model_client_factory/xai_client_factory.py +0 -0
  68. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/llm_bridge/logic/chat_generate/model_message_converter/__init__.py +0 -0
  69. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/llm_bridge/logic/chat_generate/model_message_converter/claude_message_converter.py +0 -0
  70. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/llm_bridge/logic/chat_generate/model_message_converter/gemini_message_converter.py +0 -0
  71. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/llm_bridge/logic/chat_generate/model_message_converter/openai_completion_message_converter.py +0 -0
  72. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/llm_bridge/logic/chat_generate/model_message_converter/openai_responses_message_converter.py +0 -0
  73. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/llm_bridge/logic/chat_generate/model_message_converter/xai_message_converter.py +0 -0
  74. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/llm_bridge/logic/file_fetch.py +0 -0
  75. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/llm_bridge/logic/message_process/__init__.py +0 -0
  76. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/llm_bridge/logic/message_process/code_file_extensions.py +0 -0
  77. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/llm_bridge/logic/message_process/document_processor.py +0 -0
  78. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/llm_bridge/logic/message_process/file_type_checker.py +0 -0
  79. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/llm_bridge/logic/message_process/message_processor.py +0 -0
  80. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/llm_bridge/logic/model_prices.py +0 -0
  81. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/llm_bridge/resources/__init__.py +0 -0
  82. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/llm_bridge/resources/model_prices.json +0 -0
  83. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/llm_bridge/type/__init__.py +0 -0
  84. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/llm_bridge/type/model_message/__init__.py +0 -0
  85. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/llm_bridge/type/serializer.py +0 -0
  86. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/tests/__init__.py +0 -0
  87. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/tests/file_type_checker_test.py +0 -0
  88. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/tests/model_prices_test.py +0 -0
  89. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/usage/.env.example +0 -0
  90. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/usage/__init__.py +0 -0
  91. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/usage/batch/__init__.py +0 -0
  92. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/usage/batch/config.py +0 -0
  93. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/usage/keys.py +0 -0
  94. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/usage/messages.py +0 -0
  95. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/usage/single/__init__.py +0 -0
  96. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/usage/single/config.py +0 -0
  97. {llm_bridge-2.1.0 → llm_bridge-2.1.2}/usage/single/single.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: LLM-Bridge
3
- Version: 2.1.0
3
+ Version: 2.1.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
@@ -1,4 +1,4 @@
1
- from typing import AsyncGenerator
1
+ from collections.abc import AsyncGenerator
2
2
 
3
3
  from llm_bridge.type.chat_response import ChatResponse
4
4
 
@@ -1,6 +1,6 @@
1
1
  import logging
2
2
  import re
3
- from typing import AsyncGenerator
3
+ from collections.abc import AsyncGenerator
4
4
 
5
5
  import httpx
6
6
  from fastapi import HTTPException
@@ -1,5 +1,4 @@
1
1
  import mimetypes
2
- from typing import Optional
3
2
 
4
3
  from google.genai import types
5
4
  from google.genai.types import Part
@@ -22,7 +21,7 @@ class GeminiResponseHandler:
22
21
  code: str = ""
23
22
  code_output: str = ""
24
23
  files: list[File] = []
25
- display: Optional[str] = None
24
+ display: str | None = None
26
25
  input_tokens, cumulative_output_tokens = await count_gemini_tokens(response)
27
26
 
28
27
  parts: list[Part] = []
@@ -1,6 +1,6 @@
1
1
  import logging
2
2
  import re
3
- from typing import AsyncGenerator, AsyncIterator
3
+ from collections.abc import AsyncGenerator, AsyncIterator
4
4
 
5
5
  import httpx
6
6
  from fastapi import HTTPException
@@ -1,6 +1,6 @@
1
1
  import logging
2
2
  import re
3
- from typing import AsyncGenerator
3
+ from collections.abc import AsyncGenerator
4
4
 
5
5
  import httpx
6
6
  import openai
@@ -1,6 +1,6 @@
1
1
  import logging
2
2
  import re
3
- from typing import AsyncGenerator
3
+ from collections.abc import AsyncGenerator
4
4
 
5
5
  import httpx
6
6
  import openai
@@ -1,6 +1,6 @@
1
1
  import logging
2
2
  import re
3
- from typing import AsyncGenerator
3
+ from collections.abc import AsyncGenerator
4
4
 
5
5
  from fastapi import HTTPException
6
6
  from xai_sdk.aio.chat import Chat
@@ -1,4 +1,4 @@
1
- from typing import AsyncGenerator
1
+ from collections.abc import AsyncGenerator
2
2
 
3
3
  import anthropic
4
4
  from anthropic import Omit
@@ -17,9 +17,9 @@ class ClaudeClient(ChatClient):
17
17
  model: str,
18
18
  messages: list[ClaudeMessage],
19
19
  system: str,
20
- client: anthropic.AsyncAnthropic,
21
20
  max_tokens: int,
22
- betas: list[AnthropicBetaParam],
21
+ client: anthropic.AsyncAnthropic,
22
+ betas: list[AnthropicBetaParam] | Omit,
23
23
  tools: list[BetaToolUnionParam],
24
24
  cache_control: BetaCacheControlEphemeralParam,
25
25
  thinking: BetaThinkingConfigParam | Omit,
@@ -28,8 +28,8 @@ class ClaudeClient(ChatClient):
28
28
  self.model = model
29
29
  self.messages = messages
30
30
  self.system = system
31
- self.client = client
32
31
  self.max_tokens = max_tokens
32
+ self.client = client
33
33
  self.betas = betas
34
34
  self.tools = tools
35
35
  self.cache_control = cache_control
@@ -1,4 +1,4 @@
1
- from typing import AsyncGenerator
1
+ from collections.abc import AsyncGenerator
2
2
 
3
3
  from google import genai
4
4
  from google.genai import types
@@ -1,4 +1,5 @@
1
- from typing import AsyncGenerator, Literal
1
+ from collections.abc import AsyncGenerator
2
+ from typing import Literal
2
3
 
3
4
  import openai.lib.azure
4
5
  import openai
@@ -1,4 +1,4 @@
1
- from typing import AsyncGenerator, Iterable
1
+ from collections.abc import AsyncGenerator, Iterable
2
2
 
3
3
  import openai.lib.azure
4
4
  import openai
@@ -1,4 +1,4 @@
1
- from typing import AsyncGenerator
1
+ from collections.abc import AsyncGenerator
2
2
 
3
3
  import xai_sdk
4
4
  from xai_sdk.proto import chat_pb2
@@ -59,13 +59,7 @@ async def create_claude_client(
59
59
  if thought:
60
60
  thinking = BetaThinkingConfigAdaptiveParam(type="adaptive", display="summarized")
61
61
 
62
- betas: list[AnthropicBetaParam] = [
63
- "context-1m-2025-08-07",
64
- "output-128k-2025-02-19",
65
- "code-execution-2025-08-25",
66
- "files-api-2025-04-14",
67
- "structured-outputs-2025-11-13",
68
- ]
62
+ betas: list[AnthropicBetaParam] | Omit = omit
69
63
 
70
64
  tools: list[BetaToolUnionParam] = []
71
65
  if web_search:
@@ -101,8 +95,8 @@ async def create_claude_client(
101
95
  model=model,
102
96
  messages=claude_messages,
103
97
  system=system,
104
- client=client,
105
98
  max_tokens=max_tokens,
99
+ client=client,
106
100
  betas=betas,
107
101
  tools=tools,
108
102
  cache_control=cache_control,
@@ -114,8 +108,8 @@ async def create_claude_client(
114
108
  model=model,
115
109
  messages=claude_messages,
116
110
  system=system,
117
- client=client,
118
111
  max_tokens=max_tokens,
112
+ client=client,
119
113
  betas=betas,
120
114
  tools=tools,
121
115
  cache_control=cache_control,
@@ -0,0 +1,22 @@
1
+ from dataclasses import dataclass
2
+
3
+
4
+ @dataclass
5
+ class File:
6
+ name: str
7
+ data: str
8
+ type: str
9
+
10
+
11
+ @dataclass
12
+ class ChatResponse:
13
+ text: str | None = None
14
+ audio: str | None = None
15
+ thought: str | None = None
16
+ code: str | None = None
17
+ code_output: str | None = None
18
+ files: list[File] | None = None
19
+ display: str | None = None
20
+ error: str | None = None
21
+ input_tokens: int | None = 0
22
+ output_tokens: int | None = 0
@@ -1,5 +1,5 @@
1
1
  from dataclasses import dataclass
2
- from enum import Enum, StrEnum
2
+ from enum import StrEnum
3
3
 
4
4
 
5
5
  class Role(StrEnum):
@@ -1,5 +1,4 @@
1
1
  from enum import StrEnum
2
- from typing import TypeAlias
3
2
 
4
3
  from anthropic.types import MessageParam, TextBlockParam, ImageBlockParam, DocumentBlockParam
5
4
 
@@ -9,9 +8,9 @@ class ClaudeRole(StrEnum):
9
8
  Assistant = "assistant"
10
9
 
11
10
 
12
- ClaudeContent: TypeAlias = TextBlockParam | ImageBlockParam | DocumentBlockParam
11
+ type ClaudeContent = TextBlockParam | ImageBlockParam | DocumentBlockParam
13
12
 
14
- ClaudeMessage: TypeAlias = MessageParam
13
+ type ClaudeMessage = MessageParam
15
14
 
16
15
  # class MessageParam(TypedDict, total=False):
17
16
  # content: Required[
@@ -1,5 +1,4 @@
1
1
  from enum import StrEnum
2
- from typing import TypeAlias
3
2
 
4
3
  from google.genai import types
5
4
 
@@ -9,6 +8,6 @@ class GeminiRole(StrEnum):
9
8
  Model = "model"
10
9
 
11
10
 
12
- GeminiContent: TypeAlias = types.Part
11
+ type GeminiContent = types.Part
13
12
 
14
- GeminiMessage: TypeAlias = types.Content
13
+ type GeminiMessage = types.Content
@@ -0,0 +1,12 @@
1
+ from openai.types.chat import ChatCompletionSystemMessageParam, ChatCompletionUserMessageParam, \
2
+ ChatCompletionAssistantMessageParam
3
+ from openai.types.chat.chat_completion_content_part_param import ChatCompletionContentPartParam
4
+
5
+ from llm_bridge.type.message import Role
6
+
7
+ type OpenAICompletionRole = Role
8
+
9
+ type OpenAICompletionContent = ChatCompletionContentPartParam
10
+
11
+ # type OpenAICompletionMessage = ChatCompletionMessageParam
12
+ type OpenAICompletionMessage = ChatCompletionSystemMessageParam | ChatCompletionUserMessageParam | ChatCompletionAssistantMessageParam
@@ -0,0 +1,10 @@
1
+ from openai.types.responses import EasyInputMessageParam, ResponseOutputMessageParam, ResponseInputContentParam, \
2
+ ResponseOutputTextParam
3
+
4
+ from llm_bridge.type.message import Role
5
+
6
+ type OpenAIResponsesRole = Role
7
+
8
+ type OpenAIResponsesContent = ResponseInputContentParam | ResponseOutputTextParam
9
+
10
+ type OpenAIResponsesMessage = EasyInputMessageParam | ResponseOutputMessageParam
@@ -0,0 +1,5 @@
1
+ from xai_sdk.chat import chat_pb2
2
+
3
+ type XAIContent = chat_pb2.Content
4
+
5
+ type XAIMessage = chat_pb2.Message
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "LLM-Bridge"
7
- version = "2.1.0"
7
+ version = "2.1.2"
8
8
  dependencies = [
9
9
  "fastapi",
10
10
  "httpx",
@@ -55,13 +55,11 @@ async def test_model(
55
55
 
56
56
  for attempt in range(1, MaxRetries + 1):
57
57
  try:
58
- latency = await asyncio.wait_for(
59
- measure_first_chunk_latency(api_type, model, config),
60
- timeout=TimeoutSeconds,
61
- )
58
+ async with asyncio.timeout(TimeoutSeconds):
59
+ latency = await measure_first_chunk_latency(api_type, model, config)
62
60
  print(f" [{attempt}/{MaxRetries}] OK {api_type:28s} {model:35s} [{config.name:10s}] {latency:8.3f}s")
63
61
  break
64
- except asyncio.TimeoutError:
62
+ except TimeoutError:
65
63
  error = f"TIMEOUT ({TimeoutSeconds}s)"
66
64
  print(f" [{attempt}/{MaxRetries}] TIMEOUT {api_type:28s} {model:35s} [{config.name:10s}]")
67
65
  except Exception as e:
@@ -1,4 +1,5 @@
1
- from typing import AsyncGenerator, Any
1
+ from collections.abc import AsyncGenerator
2
+ from typing import Any
2
3
 
3
4
  from llm_bridge import *
4
5
 
@@ -748,7 +748,7 @@ wheels = [
748
748
 
749
749
  [[package]]
750
750
  name = "llm-bridge"
751
- version = "2.1.0"
751
+ version = "2.1.2"
752
752
  source = { editable = "." }
753
753
  dependencies = [
754
754
  { name = "anthropic" },
@@ -1 +0,0 @@
1
- include llm_bridge/resources/*.json
@@ -1,23 +0,0 @@
1
- from dataclasses import dataclass
2
- from typing import Optional
3
-
4
-
5
- @dataclass
6
- class File:
7
- name: str
8
- data: str
9
- type: str
10
-
11
-
12
- @dataclass
13
- class ChatResponse:
14
- text: Optional[str] = None
15
- audio: Optional[str] = None
16
- thought: Optional[str] = None
17
- code: Optional[str] = None
18
- code_output: Optional[str] = None
19
- files: Optional[list[File]] = None
20
- display: Optional[str] = None
21
- error: Optional[str] = None
22
- input_tokens: Optional[int] = 0
23
- output_tokens: Optional[int] = 0
@@ -1,14 +0,0 @@
1
- from typing import TypeAlias
2
-
3
- from openai.types.chat import ChatCompletionSystemMessageParam, ChatCompletionUserMessageParam, \
4
- ChatCompletionAssistantMessageParam
5
- from openai.types.chat.chat_completion_content_part_param import ChatCompletionContentPartParam
6
-
7
- from llm_bridge.type.message import Role
8
-
9
- OpenAICompletionRole: TypeAlias = Role
10
-
11
- OpenAICompletionContent: TypeAlias = ChatCompletionContentPartParam
12
-
13
- # OpenAICompletionMessage: TypeAlias = ChatCompletionMessageParam
14
- OpenAICompletionMessage: TypeAlias = ChatCompletionSystemMessageParam | ChatCompletionUserMessageParam | ChatCompletionAssistantMessageParam
@@ -1,12 +0,0 @@
1
- from typing import TypeAlias
2
-
3
- from openai.types.responses import EasyInputMessageParam, ResponseOutputMessageParam, ResponseInputContentParam, \
4
- ResponseOutputTextParam
5
-
6
- from llm_bridge.type.message import Role
7
-
8
- OpenAIResponsesRole: TypeAlias = Role
9
-
10
- OpenAIResponsesContent: TypeAlias = ResponseInputContentParam | ResponseOutputTextParam
11
-
12
- OpenAIResponsesMessage: TypeAlias = EasyInputMessageParam | ResponseOutputMessageParam
@@ -1,7 +0,0 @@
1
- from typing import TypeAlias
2
-
3
- from xai_sdk.chat import chat_pb2
4
-
5
- XAIContent: TypeAlias = chat_pb2.Content
6
-
7
- XAIMessage: TypeAlias = chat_pb2.Message
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes