gllm-inference-binary 0.5.40__cp311-cp311-win_amd64.whl → 0.5.66__cp311-cp311-win_amd64.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.
- gllm_inference/builder/_build_invoker.pyi +28 -0
- gllm_inference/builder/build_em_invoker.pyi +12 -16
- gllm_inference/builder/build_lm_invoker.pyi +65 -17
- gllm_inference/constants.pyi +3 -2
- gllm_inference/em_invoker/__init__.pyi +3 -1
- gllm_inference/em_invoker/bedrock_em_invoker.pyi +16 -4
- gllm_inference/em_invoker/cohere_em_invoker.pyi +127 -0
- gllm_inference/em_invoker/jina_em_invoker.pyi +103 -0
- gllm_inference/em_invoker/schema/bedrock.pyi +7 -0
- gllm_inference/em_invoker/schema/cohere.pyi +20 -0
- gllm_inference/em_invoker/schema/jina.pyi +29 -0
- gllm_inference/exceptions/provider_error_map.pyi +1 -0
- gllm_inference/lm_invoker/__init__.pyi +3 -1
- gllm_inference/lm_invoker/anthropic_lm_invoker.pyi +95 -109
- gllm_inference/lm_invoker/azure_openai_lm_invoker.pyi +92 -109
- gllm_inference/lm_invoker/batch/batch_operations.pyi +2 -1
- gllm_inference/lm_invoker/bedrock_lm_invoker.pyi +52 -65
- gllm_inference/lm_invoker/datasaur_lm_invoker.pyi +36 -36
- gllm_inference/lm_invoker/google_lm_invoker.pyi +195 -110
- gllm_inference/lm_invoker/langchain_lm_invoker.pyi +52 -64
- gllm_inference/lm_invoker/litellm_lm_invoker.pyi +86 -106
- gllm_inference/lm_invoker/lm_invoker.pyi +20 -1
- gllm_inference/lm_invoker/openai_chat_completions_lm_invoker.pyi +87 -107
- gllm_inference/lm_invoker/openai_lm_invoker.pyi +237 -186
- gllm_inference/lm_invoker/portkey_lm_invoker.pyi +296 -0
- gllm_inference/lm_invoker/schema/google.pyi +12 -0
- gllm_inference/lm_invoker/schema/openai.pyi +22 -0
- gllm_inference/lm_invoker/schema/portkey.pyi +31 -0
- gllm_inference/lm_invoker/sea_lion_lm_invoker.pyi +48 -0
- gllm_inference/lm_invoker/xai_lm_invoker.pyi +94 -131
- gllm_inference/model/__init__.pyi +5 -1
- gllm_inference/model/em/cohere_em.pyi +17 -0
- gllm_inference/model/em/jina_em.pyi +22 -0
- gllm_inference/model/lm/anthropic_lm.pyi +2 -0
- gllm_inference/model/lm/google_lm.pyi +1 -0
- gllm_inference/model/lm/sea_lion_lm.pyi +16 -0
- gllm_inference/model/lm/xai_lm.pyi +19 -0
- gllm_inference/prompt_builder/format_strategy/__init__.pyi +4 -0
- gllm_inference/prompt_builder/format_strategy/format_strategy.pyi +55 -0
- gllm_inference/prompt_builder/format_strategy/jinja_format_strategy.pyi +45 -0
- gllm_inference/prompt_builder/format_strategy/string_format_strategy.pyi +20 -0
- gllm_inference/prompt_builder/prompt_builder.pyi +23 -6
- gllm_inference/schema/__init__.pyi +4 -3
- gllm_inference/schema/activity.pyi +13 -11
- gllm_inference/schema/attachment.pyi +20 -6
- gllm_inference/schema/enums.pyi +30 -1
- gllm_inference/schema/events.pyi +69 -73
- gllm_inference/schema/formatter.pyi +31 -0
- gllm_inference/schema/lm_output.pyi +245 -23
- gllm_inference/schema/model_id.pyi +27 -3
- gllm_inference/utils/validation.pyi +3 -0
- gllm_inference.cp311-win_amd64.pyd +0 -0
- gllm_inference.pyi +23 -13
- {gllm_inference_binary-0.5.40.dist-info → gllm_inference_binary-0.5.66.dist-info}/METADATA +10 -6
- {gllm_inference_binary-0.5.40.dist-info → gllm_inference_binary-0.5.66.dist-info}/RECORD +57 -40
- {gllm_inference_binary-0.5.40.dist-info → gllm_inference_binary-0.5.66.dist-info}/WHEEL +0 -0
- {gllm_inference_binary-0.5.40.dist-info → gllm_inference_binary-0.5.66.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
from
|
|
1
|
+
from _typeshed import Incomplete
|
|
2
|
+
from gllm_core.schema import Chunk
|
|
2
3
|
from gllm_inference.schema.attachment import Attachment as Attachment
|
|
3
4
|
from gllm_inference.schema.code_exec_result import CodeExecResult as CodeExecResult
|
|
5
|
+
from gllm_inference.schema.enums import LMOutputType as LMOutputType
|
|
4
6
|
from gllm_inference.schema.mcp import MCPCall as MCPCall
|
|
5
7
|
from gllm_inference.schema.reasoning import Reasoning as Reasoning
|
|
6
8
|
from gllm_inference.schema.token_usage import TokenUsage as TokenUsage
|
|
@@ -8,37 +10,257 @@ from gllm_inference.schema.tool_call import ToolCall as ToolCall
|
|
|
8
10
|
from pydantic import BaseModel
|
|
9
11
|
from typing import Any
|
|
10
12
|
|
|
13
|
+
LMOutputData = str | dict[str, Any] | BaseModel | Attachment | ToolCall | Reasoning | Chunk | CodeExecResult | MCPCall
|
|
14
|
+
logger: Incomplete
|
|
15
|
+
|
|
16
|
+
class LMOutputItem(BaseModel):
|
|
17
|
+
"""Defines the output item of a language model.
|
|
18
|
+
|
|
19
|
+
Attributes:
|
|
20
|
+
type (str): The type of the output item.
|
|
21
|
+
output (LMOutputData): The output data of the output item.
|
|
22
|
+
"""
|
|
23
|
+
type: str
|
|
24
|
+
output: LMOutputData
|
|
25
|
+
|
|
11
26
|
class LMOutput(BaseModel):
|
|
12
27
|
"""Defines the output of a language model.
|
|
13
28
|
|
|
14
29
|
Attributes:
|
|
15
|
-
|
|
16
|
-
attachments (list[Attachment]): The attachments, if the language model decides to output attachments.
|
|
17
|
-
Defaults to an empty list.
|
|
18
|
-
tool_calls (list[ToolCall]): The tool calls, if the language model decides to invoke tools.
|
|
19
|
-
Defaults to an empty list.
|
|
20
|
-
structured_output (dict[str, Any] | BaseModel | None): The structured output, if a response schema is defined
|
|
21
|
-
for the language model. Defaults to None.
|
|
30
|
+
outputs (list[LMOutputItem]): The outputs of the language model in sequential order. Defaults to an empty list.
|
|
22
31
|
token_usage (TokenUsage | None): The token usage analytics, if requested. Defaults to None.
|
|
23
32
|
duration (float | None): The duration of the invocation in seconds, if requested. Defaults to None.
|
|
24
33
|
finish_details (dict[str, Any]): The details about how the generation finished, if requested.
|
|
25
34
|
Defaults to an empty dictionary.
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
35
|
+
|
|
36
|
+
text (str): The first text response.
|
|
37
|
+
structured_output (dict[str, Any] | BaseModel | None): The first structured output.
|
|
38
|
+
|
|
39
|
+
texts (list[str]): The texts from the outputs.
|
|
40
|
+
structured_outputs (list[dict[str, Any] | BaseModel]): The structured outputs from the outputs.
|
|
41
|
+
attachments (list[Attachment]): The attachments from the outputs.
|
|
42
|
+
tool_calls (list[ToolCall]): The tool calls from the outputs.
|
|
43
|
+
thinkings (list[Reasoning]): The thinkings from the outputs.
|
|
44
|
+
citations (list[Chunk]): The citations from the outputs.
|
|
45
|
+
code_exec_results (list[CodeExecResult]): The code exec results from the outputs.
|
|
46
|
+
mcp_calls (list[MCPCall]): The MCP calls from the outputs.
|
|
47
|
+
|
|
48
|
+
response (str): Deprecated. Replaced by `text`.
|
|
49
|
+
reasoning (list[Reasoning]): Deprecated. Replaced by `thinkings`.
|
|
33
50
|
"""
|
|
34
|
-
|
|
35
|
-
attachments: list[Attachment]
|
|
36
|
-
tool_calls: list[ToolCall]
|
|
37
|
-
structured_output: dict[str, Any] | BaseModel | None
|
|
51
|
+
outputs: list[LMOutputItem]
|
|
38
52
|
token_usage: TokenUsage | None
|
|
39
53
|
duration: float | None
|
|
40
54
|
finish_details: dict[str, Any]
|
|
41
|
-
reasoning: list[Reasoning]
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
55
|
+
def __init__(self, *, outputs: list[LMOutputItem] | None = None, token_usage: TokenUsage | None = None, duration: float | None = None, finish_details: dict[str, Any] | None = None, response: str = '', structured_output: dict[str, Any] | BaseModel | None = None, tool_calls: list[ToolCall] | None = None, reasoning: list[Reasoning] | None = None, attachments: list[Attachment] | None = None, citations: list[Chunk] | None = None, code_exec_results: list[CodeExecResult] | None = None, mcp_calls: list[MCPCall] | None = None) -> None:
|
|
56
|
+
"""Initialize the LMOutput.
|
|
57
|
+
|
|
58
|
+
This constructor is created for backward compatibility with the legacy method to initialize the LMOutput.
|
|
59
|
+
This constructor will be removed in v0.6.
|
|
60
|
+
|
|
61
|
+
Args:
|
|
62
|
+
outputs (list[LMOutputItem] | None, optional): The output items. Defaults to an empty list.
|
|
63
|
+
token_usage (TokenUsage | None, optional): The token usage analytics. Defaults to None.
|
|
64
|
+
duration (float | None, optional): The duration of the invocation in seconds. Defaults to None.
|
|
65
|
+
finish_details (dict[str, Any] | None, optional): The details about how the generation finished.
|
|
66
|
+
Defaults to an empty dictionary.
|
|
67
|
+
response (str, optional): The first text response. Defaults to an empty string.
|
|
68
|
+
structured_output (dict[str, Any] | BaseModel | None, optional): The first structured output.
|
|
69
|
+
Defaults to None.
|
|
70
|
+
tool_calls (list[ToolCall] | None, optional): The tool calls. Defaults to None.
|
|
71
|
+
reasoning (list[Reasoning] | None, optional): The thinkings. Defaults to None.
|
|
72
|
+
attachments (list[Attachment] | None, optional): The attachments. Defaults to None.
|
|
73
|
+
citations (list[Chunk] | None, optional): The citations. Defaults to None.
|
|
74
|
+
code_exec_results (list[CodeExecResult] | None, optional): The code exec results. Defaults to None.
|
|
75
|
+
mcp_calls (list[MCPCall] | None, optional): The MCP calls. Defaults to None.
|
|
76
|
+
"""
|
|
77
|
+
@property
|
|
78
|
+
def response(self) -> str:
|
|
79
|
+
"""Deprecated property to get the first text response from the LMOutput.
|
|
80
|
+
|
|
81
|
+
Returns:
|
|
82
|
+
str: The first text response from the LMOutput.
|
|
83
|
+
"""
|
|
84
|
+
@response.setter
|
|
85
|
+
def response(self, value: str) -> None:
|
|
86
|
+
"""Deprecated setter to set the first text response to the LMOutput.
|
|
87
|
+
|
|
88
|
+
Args:
|
|
89
|
+
value (str): The first text response to set.
|
|
90
|
+
"""
|
|
91
|
+
@property
|
|
92
|
+
def text(self) -> str:
|
|
93
|
+
"""Get the first text from the LMOutput.
|
|
94
|
+
|
|
95
|
+
Returns:
|
|
96
|
+
str: The first text from the LMOutput.
|
|
97
|
+
"""
|
|
98
|
+
@property
|
|
99
|
+
def structured_output(self) -> dict[str, Any] | BaseModel | None:
|
|
100
|
+
"""Deprecated property to get the first structured output from the LMOutput.
|
|
101
|
+
|
|
102
|
+
Returns:
|
|
103
|
+
dict[str, Any] | BaseModel | None: The first structured output from the LMOutput.
|
|
104
|
+
"""
|
|
105
|
+
@structured_output.setter
|
|
106
|
+
def structured_output(self, value: dict[str, Any] | BaseModel) -> None:
|
|
107
|
+
"""Deprecated setter to set the first structured output to the LMOutput.
|
|
108
|
+
|
|
109
|
+
Args:
|
|
110
|
+
value (dict[str, Any] | BaseModel): The first structured output to set.
|
|
111
|
+
"""
|
|
112
|
+
@property
|
|
113
|
+
def texts(self) -> list[str]:
|
|
114
|
+
"""Get the texts from the LMOutput.
|
|
115
|
+
|
|
116
|
+
Returns:
|
|
117
|
+
list[str]: The texts from the LMOutput.
|
|
118
|
+
"""
|
|
119
|
+
@property
|
|
120
|
+
def structured_outputs(self) -> list[dict[str, Any] | BaseModel]:
|
|
121
|
+
"""Get the structured outputs from the LMOutput.
|
|
122
|
+
|
|
123
|
+
Returns:
|
|
124
|
+
list[dict[str, Any] | BaseModel]: The structured outputs from the LMOutput.
|
|
125
|
+
"""
|
|
126
|
+
@property
|
|
127
|
+
def attachments(self) -> list[Attachment]:
|
|
128
|
+
"""Get the attachments from the LMOutput.
|
|
129
|
+
|
|
130
|
+
Returns:
|
|
131
|
+
list[Attachment]: The attachments from the LMOutput.
|
|
132
|
+
"""
|
|
133
|
+
@attachments.setter
|
|
134
|
+
def attachments(self, value: list[Attachment]) -> None:
|
|
135
|
+
"""Deprecated setter to set the attachments to the LMOutput.
|
|
136
|
+
|
|
137
|
+
Args:
|
|
138
|
+
value (list[Attachment]): The attachments to set.
|
|
139
|
+
"""
|
|
140
|
+
@property
|
|
141
|
+
def tool_calls(self) -> list[ToolCall]:
|
|
142
|
+
"""Get the tool calls from the LMOutput.
|
|
143
|
+
|
|
144
|
+
Returns:
|
|
145
|
+
list[ToolCall]: The tool calls from the LMOutput.
|
|
146
|
+
"""
|
|
147
|
+
@tool_calls.setter
|
|
148
|
+
def tool_calls(self, value: list[ToolCall]) -> None:
|
|
149
|
+
"""Deprecated setter to set the tool calls to the LMOutput.
|
|
150
|
+
|
|
151
|
+
Args:
|
|
152
|
+
value (list[ToolCall]): The tool calls to set.
|
|
153
|
+
"""
|
|
154
|
+
@property
|
|
155
|
+
def reasoning(self) -> list[Reasoning]:
|
|
156
|
+
"""Deprecated property to get the thinkings from the LMOutput.
|
|
157
|
+
|
|
158
|
+
Returns:
|
|
159
|
+
list[Reasoning]: The thinkings from the LMOutput.
|
|
160
|
+
"""
|
|
161
|
+
@reasoning.setter
|
|
162
|
+
def reasoning(self, value: list[Reasoning]) -> None:
|
|
163
|
+
"""Deprecated setter to set the thinkings to the LMOutput.
|
|
164
|
+
|
|
165
|
+
Args:
|
|
166
|
+
value (list[Reasoning]): The thinkings to set.
|
|
167
|
+
"""
|
|
168
|
+
@property
|
|
169
|
+
def thinkings(self) -> list[Reasoning]:
|
|
170
|
+
"""Get the thinkings from the LMOutput.
|
|
171
|
+
|
|
172
|
+
Returns:
|
|
173
|
+
list[Reasoning]: The thinkings from the LMOutput.
|
|
174
|
+
"""
|
|
175
|
+
@property
|
|
176
|
+
def citations(self) -> list[Chunk]:
|
|
177
|
+
"""Get the citations from the LMOutput.
|
|
178
|
+
|
|
179
|
+
Returns:
|
|
180
|
+
list[Chunk]: The citations from the LMOutput.
|
|
181
|
+
"""
|
|
182
|
+
@citations.setter
|
|
183
|
+
def citations(self, value: list[Chunk]) -> None:
|
|
184
|
+
"""Deprecated setter to set the citations to the LMOutput.
|
|
185
|
+
|
|
186
|
+
Args:
|
|
187
|
+
value (list[Chunk]): The citations to set.
|
|
188
|
+
"""
|
|
189
|
+
@property
|
|
190
|
+
def code_exec_results(self) -> list[CodeExecResult]:
|
|
191
|
+
"""Get the code exec results from the LMOutput.
|
|
192
|
+
|
|
193
|
+
Returns:
|
|
194
|
+
list[CodeExecResult]: The code exec results from the LMOutput.
|
|
195
|
+
"""
|
|
196
|
+
@code_exec_results.setter
|
|
197
|
+
def code_exec_results(self, value: list[CodeExecResult]) -> None:
|
|
198
|
+
"""Deprecated setter to set the code exec results to the LMOutput.
|
|
199
|
+
|
|
200
|
+
Args:
|
|
201
|
+
value (list[CodeExecResult]): The code exec results to set.
|
|
202
|
+
"""
|
|
203
|
+
@property
|
|
204
|
+
def mcp_calls(self) -> list[MCPCall]:
|
|
205
|
+
"""Get the MCP calls from the LMOutput.
|
|
206
|
+
|
|
207
|
+
Returns:
|
|
208
|
+
list[MCPCall]: The MCP calls from the LMOutput.
|
|
209
|
+
"""
|
|
210
|
+
@mcp_calls.setter
|
|
211
|
+
def mcp_calls(self, value: list[MCPCall]) -> None:
|
|
212
|
+
"""Deprecated setter to set the MCP calls to the LMOutput.
|
|
213
|
+
|
|
214
|
+
Args:
|
|
215
|
+
value (list[MCPCall]): The MCP calls to set.
|
|
216
|
+
"""
|
|
217
|
+
def add_text(self, text: str | list[str]) -> None:
|
|
218
|
+
"""Add an output or a list of outputs to the LMOutput.
|
|
219
|
+
|
|
220
|
+
Args:
|
|
221
|
+
text (str | list[str]): The text or a list of texts to add.
|
|
222
|
+
"""
|
|
223
|
+
def add_attachment(self, attachment: Attachment | list[Attachment]) -> None:
|
|
224
|
+
"""Add an attachment or a list of attachments to the LMOutput.
|
|
225
|
+
|
|
226
|
+
Args:
|
|
227
|
+
attachment (Attachment | list[Attachment]): The attachment or a list of attachments to add.
|
|
228
|
+
"""
|
|
229
|
+
def add_tool_call(self, tool_call: ToolCall | list[ToolCall]) -> None:
|
|
230
|
+
"""Add a tool call or a list of tool calls to the LMOutput.
|
|
231
|
+
|
|
232
|
+
Args:
|
|
233
|
+
tool_call (ToolCall | list[ToolCall]): The tool call or a list of tool calls to add.
|
|
234
|
+
"""
|
|
235
|
+
def add_structured(self, structured: dict[str, Any] | BaseModel | list[dict[str, Any] | BaseModel]) -> None:
|
|
236
|
+
"""Add a structured output or a list of structured outputs to the LMOutput.
|
|
237
|
+
|
|
238
|
+
Args:
|
|
239
|
+
structured (dict[str, Any] | BaseModel | list[dict[str, Any] | BaseModel]): The structured output
|
|
240
|
+
or a list of structured outputs to add.
|
|
241
|
+
"""
|
|
242
|
+
def add_thinking(self, thinking: Reasoning | list[Reasoning]) -> None:
|
|
243
|
+
"""Add a thinking or a list of thoughts to the LMOutput.
|
|
244
|
+
|
|
245
|
+
Args:
|
|
246
|
+
thinking (Reasoning | list[Reasoning]): The thinking or a list of thoughts to add.
|
|
247
|
+
"""
|
|
248
|
+
def add_citation(self, citation: Chunk | list[Chunk]) -> None:
|
|
249
|
+
"""Add a citation or a list of citations to the LMOutput.
|
|
250
|
+
|
|
251
|
+
Args:
|
|
252
|
+
citation (Chunk | list[Chunk]): The citation or a list of citations to add.
|
|
253
|
+
"""
|
|
254
|
+
def add_code_exec_result(self, code_exec_result: CodeExecResult | list[CodeExecResult]) -> None:
|
|
255
|
+
"""Add a code exec result or a list of code exec results to the LMOutput.
|
|
256
|
+
|
|
257
|
+
Args:
|
|
258
|
+
code_exec_result (CodeExecResult | list[CodeExecResult]): The code exec result or a list of code exec
|
|
259
|
+
results to add.
|
|
260
|
+
"""
|
|
261
|
+
def add_mcp_call(self, mcp_call: MCPCall | list[MCPCall]) -> None:
|
|
262
|
+
"""Add an MCP call or a list of MCP calls to the LMOutput.
|
|
263
|
+
|
|
264
|
+
Args:
|
|
265
|
+
mcp_call (MCPCall | list[MCPCall]): The MCP call or a list of MCP calls to add.
|
|
266
|
+
"""
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
from _typeshed import Incomplete
|
|
2
2
|
from enum import StrEnum
|
|
3
|
-
from gllm_inference.utils import validate_string_enum as validate_string_enum
|
|
4
3
|
from pydantic import BaseModel
|
|
5
4
|
|
|
6
5
|
PROVIDER_SEPARATOR: str
|
|
@@ -12,19 +11,23 @@ class ModelProvider(StrEnum):
|
|
|
12
11
|
ANTHROPIC = 'anthropic'
|
|
13
12
|
AZURE_OPENAI = 'azure-openai'
|
|
14
13
|
BEDROCK = 'bedrock'
|
|
14
|
+
COHERE = 'cohere'
|
|
15
15
|
DATASAUR = 'datasaur'
|
|
16
16
|
GOOGLE = 'google'
|
|
17
|
+
JINA = 'jina'
|
|
17
18
|
LANGCHAIN = 'langchain'
|
|
18
19
|
LITELLM = 'litellm'
|
|
19
20
|
OPENAI = 'openai'
|
|
21
|
+
PORTKEY = 'portkey'
|
|
20
22
|
OPENAI_CHAT_COMPLETIONS = 'openai-chat-completions'
|
|
21
23
|
OPENAI_COMPATIBLE = 'openai-compatible'
|
|
24
|
+
SEA_LION = 'sea-lion'
|
|
22
25
|
TWELVELABS = 'twelvelabs'
|
|
23
26
|
VOYAGE = 'voyage'
|
|
24
27
|
XAI = 'xai'
|
|
25
28
|
|
|
26
|
-
|
|
27
|
-
|
|
29
|
+
PROVIDERS_OPTIONAL_PATH: Incomplete
|
|
30
|
+
PROVIDERS_SUPPORT_PATH: Incomplete
|
|
28
31
|
|
|
29
32
|
class ModelId(BaseModel):
|
|
30
33
|
'''Defines a representation of a valid model id.
|
|
@@ -45,6 +48,16 @@ class ModelId(BaseModel):
|
|
|
45
48
|
model_id = ModelId.from_string("bedrock/us.anthropic.claude-sonnet-4-20250514-v1:0")
|
|
46
49
|
```
|
|
47
50
|
|
|
51
|
+
# Using Cohere
|
|
52
|
+
```python
|
|
53
|
+
model_id = ModelId.from_string("cohere/embed-english-v3.0")
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
# Using Cohere with custom endpoint
|
|
57
|
+
```python
|
|
58
|
+
model_id = ModelId.from_string("cohere/https://my-cohere-url:8000/v1:my-model-name")
|
|
59
|
+
```
|
|
60
|
+
|
|
48
61
|
# Using Datasaur
|
|
49
62
|
```python
|
|
50
63
|
model_id = ModelId.from_string("datasaur/https://deployment.datasaur.ai/api/deployment/teamId/deploymentId/")
|
|
@@ -55,6 +68,16 @@ class ModelId(BaseModel):
|
|
|
55
68
|
model_id = ModelId.from_string("google/gemini-2.5-flash-lite")
|
|
56
69
|
```
|
|
57
70
|
|
|
71
|
+
# Using Jina
|
|
72
|
+
```python
|
|
73
|
+
model_id = ModelId.from_string("jina/jina-embeddings-v2-large")
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
# Using Jina with custom endpoint
|
|
77
|
+
```python
|
|
78
|
+
model_id = ModelId.from_string("jina/https://my-jina-url:8000/v1:my-model-name")
|
|
79
|
+
```
|
|
80
|
+
|
|
58
81
|
# Using OpenAI
|
|
59
82
|
```python
|
|
60
83
|
model_id = ModelId.from_string("openai/gpt-5-nano")
|
|
@@ -94,6 +117,7 @@ class ModelId(BaseModel):
|
|
|
94
117
|
```python
|
|
95
118
|
model_id = ModelId.from_string("langchain/langchain_openai.ChatOpenAI:gpt-4o-mini")
|
|
96
119
|
```
|
|
120
|
+
|
|
97
121
|
For the list of supported providers, please refer to the following table:
|
|
98
122
|
https://python.langchain.com/docs/integrations/chat/#featured-providers
|
|
99
123
|
|
|
Binary file
|
gllm_inference.pyi
CHANGED
|
@@ -14,7 +14,9 @@ import gllm_core
|
|
|
14
14
|
import gllm_core.utils
|
|
15
15
|
import gllm_inference.em_invoker.AzureOpenAIEMInvoker
|
|
16
16
|
import gllm_inference.em_invoker.BedrockEMInvoker
|
|
17
|
+
import gllm_inference.em_invoker.CohereEMInvoker
|
|
17
18
|
import gllm_inference.em_invoker.GoogleEMInvoker
|
|
19
|
+
import gllm_inference.em_invoker.JinaEMInvoker
|
|
18
20
|
import gllm_inference.em_invoker.LangChainEMInvoker
|
|
19
21
|
import gllm_inference.em_invoker.OpenAICompatibleEMInvoker
|
|
20
22
|
import gllm_inference.em_invoker.OpenAIEMInvoker
|
|
@@ -30,6 +32,8 @@ import gllm_inference.lm_invoker.LiteLLMLMInvoker
|
|
|
30
32
|
import gllm_inference.lm_invoker.OpenAIChatCompletionsLMInvoker
|
|
31
33
|
import gllm_inference.lm_invoker.OpenAICompatibleLMInvoker
|
|
32
34
|
import gllm_inference.lm_invoker.OpenAILMInvoker
|
|
35
|
+
import gllm_inference.lm_invoker.PortkeyLMInvoker
|
|
36
|
+
import gllm_inference.lm_invoker.SeaLionLMInvoker
|
|
33
37
|
import gllm_inference.lm_invoker.XAILMInvoker
|
|
34
38
|
import gllm_inference.prompt_builder.PromptBuilder
|
|
35
39
|
import gllm_inference.output_parser.JSONOutputParser
|
|
@@ -45,24 +49,26 @@ import gllm_inference.schema.ModelId
|
|
|
45
49
|
import gllm_inference.schema.ModelProvider
|
|
46
50
|
import gllm_inference.schema.TruncationConfig
|
|
47
51
|
import asyncio
|
|
52
|
+
import base64
|
|
48
53
|
import enum
|
|
49
54
|
import gllm_inference.exceptions.BaseInvokerError
|
|
50
55
|
import gllm_inference.exceptions.convert_http_status_to_base_invoker_error
|
|
56
|
+
import gllm_inference.schema.Attachment
|
|
57
|
+
import gllm_inference.schema.AttachmentType
|
|
58
|
+
import gllm_inference.schema.EMContent
|
|
51
59
|
import gllm_inference.schema.Vector
|
|
52
60
|
import aioboto3
|
|
61
|
+
import cohere
|
|
53
62
|
import asyncio.CancelledError
|
|
54
63
|
import gllm_inference.exceptions.convert_to_base_invoker_error
|
|
55
|
-
import gllm_inference.schema.Attachment
|
|
56
|
-
import gllm_inference.schema.AttachmentType
|
|
57
|
-
import gllm_inference.schema.EMContent
|
|
58
64
|
import gllm_inference.schema.TruncateSide
|
|
59
65
|
import google
|
|
60
66
|
import google.auth
|
|
61
67
|
import google.genai
|
|
62
68
|
import google.genai.types
|
|
63
|
-
import
|
|
64
|
-
import
|
|
65
|
-
import
|
|
69
|
+
import httpx
|
|
70
|
+
import gllm_inference.exceptions.ProviderInternalError
|
|
71
|
+
import gllm_core.utils.concurrency
|
|
66
72
|
import langchain_core
|
|
67
73
|
import langchain_core.embeddings
|
|
68
74
|
import gllm_inference.exceptions.InvokerRuntimeError
|
|
@@ -71,14 +77,14 @@ import gllm_inference.utils.load_langchain_model
|
|
|
71
77
|
import gllm_inference.utils.parse_model_data
|
|
72
78
|
import openai
|
|
73
79
|
import io
|
|
74
|
-
import httpx
|
|
75
80
|
import twelvelabs
|
|
76
|
-
import base64
|
|
77
81
|
import sys
|
|
78
82
|
import voyageai
|
|
79
83
|
import voyageai.client_async
|
|
80
84
|
import http
|
|
81
85
|
import http.HTTPStatus
|
|
86
|
+
import __future__
|
|
87
|
+
import uuid
|
|
82
88
|
import gllm_core.constants
|
|
83
89
|
import gllm_core.event
|
|
84
90
|
import gllm_core.schema
|
|
@@ -108,10 +114,7 @@ import inspect
|
|
|
108
114
|
import time
|
|
109
115
|
import jsonschema
|
|
110
116
|
import gllm_inference.lm_invoker.batch.BatchOperations
|
|
111
|
-
import gllm_inference.schema.Activity
|
|
112
117
|
import gllm_inference.schema.MessageContent
|
|
113
|
-
import gllm_inference.utils.validate_string_enum
|
|
114
|
-
import __future__
|
|
115
118
|
import gllm_inference.schema.ActivityEvent
|
|
116
119
|
import gllm_inference.schema.CodeEvent
|
|
117
120
|
import gllm_inference.schema.CodeExecResult
|
|
@@ -120,26 +123,33 @@ import gllm_inference.schema.MCPCallActivity
|
|
|
120
123
|
import gllm_inference.schema.MCPListToolsActivity
|
|
121
124
|
import gllm_inference.schema.MCPServer
|
|
122
125
|
import gllm_inference.schema.WebSearchActivity
|
|
126
|
+
import logging
|
|
127
|
+
import portkey_ai
|
|
123
128
|
import xai_sdk
|
|
124
129
|
import xai_sdk.chat
|
|
125
130
|
import xai_sdk.search
|
|
126
131
|
import xai_sdk.proto
|
|
127
132
|
import xai_sdk.proto.v5
|
|
128
133
|
import xai_sdk.proto.v5.chat_pb2
|
|
134
|
+
import jinja2
|
|
135
|
+
import jinja2.sandbox
|
|
136
|
+
import gllm_inference.schema.JinjaEnvType
|
|
137
|
+
import gllm_inference.prompt_builder.format_strategy.JinjaFormatStrategy
|
|
138
|
+
import gllm_inference.prompt_builder.format_strategy.StringFormatStrategy
|
|
139
|
+
import gllm_inference.schema.HistoryFormatter
|
|
129
140
|
import transformers
|
|
130
141
|
import gllm_inference.prompt_formatter.HuggingFacePromptFormatter
|
|
131
|
-
import logging
|
|
132
142
|
import traceback
|
|
133
143
|
import gllm_inference.realtime_chat.input_streamer.KeyboardInputStreamer
|
|
134
144
|
import gllm_inference.realtime_chat.output_streamer.ConsoleOutputStreamer
|
|
135
145
|
import google.genai.live
|
|
136
146
|
import gllm_core.utils.logger_manager
|
|
137
147
|
import mimetypes
|
|
138
|
-
import uuid
|
|
139
148
|
import pathlib
|
|
140
149
|
import filetype
|
|
141
150
|
import magic
|
|
142
151
|
import requests
|
|
152
|
+
import gllm_core.schema.chunk
|
|
143
153
|
import binascii
|
|
144
154
|
import fnmatch
|
|
145
155
|
import importlib
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: gllm-inference-binary
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.66
|
|
4
4
|
Summary: A library containing components related to model inferences in Gen AI applications.
|
|
5
|
-
Author-email: Henry Wicaksono <henry.wicaksono@gdplabs.id>,
|
|
5
|
+
Author-email: Henry Wicaksono <henry.wicaksono@gdplabs.id>, "Delfia N. A. Putri" <delfia.n.a.putri@gdplabs.id>
|
|
6
6
|
Requires-Python: <3.14,>=3.11
|
|
7
7
|
Description-Content-Type: text/markdown
|
|
8
8
|
Requires-Dist: poetry<3.0.0,>=2.1.3
|
|
9
|
-
Requires-Dist: gllm-core-binary<0.4.0,>=0.3.
|
|
9
|
+
Requires-Dist: gllm-core-binary<0.4.0,>=0.3.23
|
|
10
10
|
Requires-Dist: aiohttp<4.0.0,>=3.12.14
|
|
11
11
|
Requires-Dist: filetype<2.0.0,>=1.2.0
|
|
12
12
|
Requires-Dist: httpx<0.29.0,>=0.28.0
|
|
@@ -30,17 +30,21 @@ Provides-Extra: anthropic
|
|
|
30
30
|
Requires-Dist: anthropic<0.61.0,>=0.60.0; extra == "anthropic"
|
|
31
31
|
Provides-Extra: bedrock
|
|
32
32
|
Requires-Dist: aioboto3<16.0.0,>=15.0.0; extra == "bedrock"
|
|
33
|
+
Provides-Extra: cohere
|
|
34
|
+
Requires-Dist: cohere<6.0.0,>=5.18.0; extra == "cohere"
|
|
33
35
|
Provides-Extra: datasaur
|
|
34
|
-
Requires-Dist: openai<
|
|
36
|
+
Requires-Dist: openai<3.0.0,>=2.7.0; extra == "datasaur"
|
|
35
37
|
Provides-Extra: google
|
|
36
38
|
Requires-Dist: google-genai<=1.36,>=1.23; extra == "google"
|
|
37
39
|
Provides-Extra: huggingface
|
|
38
40
|
Requires-Dist: huggingface-hub<0.31.0,>=0.30.0; extra == "huggingface"
|
|
39
41
|
Requires-Dist: transformers<5.0.0,>=4.52.0; extra == "huggingface"
|
|
40
|
-
Provides-Extra: openai
|
|
41
|
-
Requires-Dist: openai<2.0.0,>=1.98.0; extra == "openai"
|
|
42
42
|
Provides-Extra: litellm
|
|
43
43
|
Requires-Dist: litellm<2.0.0,>=1.69.2; extra == "litellm"
|
|
44
|
+
Provides-Extra: openai
|
|
45
|
+
Requires-Dist: openai<3.0.0,>=2.7.0; extra == "openai"
|
|
46
|
+
Provides-Extra: portkey-ai
|
|
47
|
+
Requires-Dist: portkey-ai<2.0.0,>=1.14.4; extra == "portkey-ai"
|
|
44
48
|
Provides-Extra: twelvelabs
|
|
45
49
|
Requires-Dist: twelvelabs<0.5.0,>=0.4.4; extra == "twelvelabs"
|
|
46
50
|
Provides-Extra: voyage
|