gllm-inference-binary 0.5.1.post1__cp311-cp311-win_amd64.whl → 0.5.2__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.
Potentially problematic release.
This version of gllm-inference-binary might be problematic. Click here for more details.
- gllm_inference/constants.pyi +1 -0
- gllm_inference/em_invoker/azure_openai_em_invoker.pyi +4 -4
- gllm_inference/em_invoker/em_invoker.pyi +5 -5
- gllm_inference/em_invoker/google_em_invoker.pyi +4 -4
- gllm_inference/em_invoker/langchain_em_invoker.pyi +4 -3
- gllm_inference/em_invoker/openai_compatible_em_invoker.pyi +4 -3
- gllm_inference/em_invoker/openai_em_invoker.pyi +4 -3
- gllm_inference/em_invoker/twelevelabs_em_invoker.pyi +4 -3
- gllm_inference/em_invoker/voyage_em_invoker.pyi +4 -3
- gllm_inference/lm_invoker/anthropic_lm_invoker.pyi +4 -3
- gllm_inference/lm_invoker/azure_openai_lm_invoker.pyi +4 -4
- gllm_inference/lm_invoker/bedrock_lm_invoker.pyi +4 -3
- gllm_inference/lm_invoker/datasaur_lm_invoker.pyi +4 -4
- gllm_inference/lm_invoker/google_lm_invoker.pyi +4 -4
- gllm_inference/lm_invoker/langchain_lm_invoker.pyi +4 -3
- gllm_inference/lm_invoker/litellm_lm_invoker.pyi +4 -3
- gllm_inference/lm_invoker/lm_invoker.pyi +4 -4
- gllm_inference/lm_invoker/openai_compatible_lm_invoker.pyi +7 -5
- gllm_inference/lm_invoker/openai_lm_invoker.pyi +4 -3
- gllm_inference.cp311-win_amd64.pyd +0 -0
- {gllm_inference_binary-0.5.1.post1.dist-info → gllm_inference_binary-0.5.2.dist-info}/METADATA +1 -1
- {gllm_inference_binary-0.5.1.post1.dist-info → gllm_inference_binary-0.5.2.dist-info}/RECORD +23 -23
- {gllm_inference_binary-0.5.1.post1.dist-info → gllm_inference_binary-0.5.2.dist-info}/WHEEL +0 -0
gllm_inference/constants.pyi
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from _typeshed import Incomplete
|
|
2
2
|
from gllm_core.utils.retry import RetryConfig as RetryConfig
|
|
3
|
-
from gllm_inference.constants import DEFAULT_AZURE_OPENAI_API_VERSION as DEFAULT_AZURE_OPENAI_API_VERSION
|
|
3
|
+
from gllm_inference.constants import DEFAULT_AZURE_OPENAI_API_VERSION as DEFAULT_AZURE_OPENAI_API_VERSION, INVOKER_DEFAULT_RETRY_CONFIG as INVOKER_DEFAULT_RETRY_CONFIG
|
|
4
4
|
from gllm_inference.em_invoker.openai_em_invoker import OpenAIEMInvoker as OpenAIEMInvoker
|
|
5
5
|
from gllm_inference.schema import ModelId as ModelId, ModelProvider as ModelProvider
|
|
6
6
|
from typing import Any
|
|
@@ -67,7 +67,7 @@ class AzureOpenAIEMInvoker(OpenAIEMInvoker):
|
|
|
67
67
|
```
|
|
68
68
|
'''
|
|
69
69
|
client: Incomplete
|
|
70
|
-
def __init__(self, azure_endpoint: str, azure_deployment: str, api_key: str | None = None, api_version: str = ..., model_kwargs: dict[str, Any] | None = None, default_hyperparameters: dict[str, Any] | None = None, retry_config: RetryConfig
|
|
70
|
+
def __init__(self, azure_endpoint: str, azure_deployment: str, api_key: str | None = None, api_version: str = ..., model_kwargs: dict[str, Any] | None = None, default_hyperparameters: dict[str, Any] | None = None, retry_config: RetryConfig = ...) -> None:
|
|
71
71
|
"""Initializes a new instance of the AzureOpenAIEMInvoker class.
|
|
72
72
|
|
|
73
73
|
Args:
|
|
@@ -80,6 +80,6 @@ class AzureOpenAIEMInvoker(OpenAIEMInvoker):
|
|
|
80
80
|
model_kwargs (dict[str, Any] | None, optional): Additional model parameters. Defaults to None.
|
|
81
81
|
default_hyperparameters (dict[str, Any] | None, optional): Default hyperparameters for invoking the model.
|
|
82
82
|
Defaults to None.
|
|
83
|
-
retry_config (RetryConfig
|
|
84
|
-
Defaults to
|
|
83
|
+
retry_config (RetryConfig, optional): The retry configuration for the embedding model.
|
|
84
|
+
Defaults to a default config with no retry and 30.0 seconds timeout.
|
|
85
85
|
"""
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import abc
|
|
2
2
|
from _typeshed import Incomplete
|
|
3
3
|
from abc import ABC
|
|
4
|
-
from gllm_core.utils.retry import RetryConfig
|
|
5
|
-
from gllm_inference.constants import DOCUMENT_MIME_TYPES as DOCUMENT_MIME_TYPES
|
|
4
|
+
from gllm_core.utils.retry import RetryConfig as RetryConfig
|
|
5
|
+
from gllm_inference.constants import DOCUMENT_MIME_TYPES as DOCUMENT_MIME_TYPES, INVOKER_DEFAULT_RETRY_CONFIG as INVOKER_DEFAULT_RETRY_CONFIG
|
|
6
6
|
from gllm_inference.exceptions import parse_error_message as parse_error_message
|
|
7
7
|
from gllm_inference.schema import Attachment as Attachment, AttachmentType as AttachmentType, EMContent as EMContent, ModelId as ModelId, Vector as Vector
|
|
8
8
|
from typing import Any
|
|
@@ -21,7 +21,7 @@ class BaseEMInvoker(ABC, metaclass=abc.ABCMeta):
|
|
|
21
21
|
"""
|
|
22
22
|
default_hyperparameters: Incomplete
|
|
23
23
|
retry_config: Incomplete
|
|
24
|
-
def __init__(self, model_id: ModelId, default_hyperparameters: dict[str, Any] | None = None, supported_attachments: set[str] | None = None, retry_config: RetryConfig
|
|
24
|
+
def __init__(self, model_id: ModelId, default_hyperparameters: dict[str, Any] | None = None, supported_attachments: set[str] | None = None, retry_config: RetryConfig = ...) -> None:
|
|
25
25
|
"""Initializes a new instance of the BaseEMInvoker class.
|
|
26
26
|
|
|
27
27
|
Args:
|
|
@@ -30,8 +30,8 @@ class BaseEMInvoker(ABC, metaclass=abc.ABCMeta):
|
|
|
30
30
|
embedding model. Defaults to None, in which case an empty dictionary is used.
|
|
31
31
|
supported_attachments (set[str] | None, optional): A set of supported attachment types. Defaults to None,
|
|
32
32
|
in which case an empty set is used (indicating that no attachments are supported).
|
|
33
|
-
retry_config (RetryConfig
|
|
34
|
-
Defaults to
|
|
33
|
+
retry_config (RetryConfig, optional): The retry configuration for the embedding model.
|
|
34
|
+
Defaults to a default config with no retry and 30.0 seconds timeout.
|
|
35
35
|
"""
|
|
36
36
|
@property
|
|
37
37
|
def model_id(self) -> str:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from _typeshed import Incomplete
|
|
2
2
|
from gllm_core.utils.retry import RetryConfig as RetryConfig
|
|
3
|
-
from gllm_inference.constants import GOOGLE_SCOPES as GOOGLE_SCOPES
|
|
3
|
+
from gllm_inference.constants import GOOGLE_SCOPES as GOOGLE_SCOPES, INVOKER_DEFAULT_RETRY_CONFIG as INVOKER_DEFAULT_RETRY_CONFIG
|
|
4
4
|
from gllm_inference.em_invoker.em_invoker import BaseEMInvoker as BaseEMInvoker
|
|
5
5
|
from gllm_inference.schema import ModelId as ModelId, ModelProvider as ModelProvider, Vector as Vector
|
|
6
6
|
from typing import Any
|
|
@@ -97,7 +97,7 @@ class GoogleEMInvoker(BaseEMInvoker):
|
|
|
97
97
|
```
|
|
98
98
|
'''
|
|
99
99
|
client_params: Incomplete
|
|
100
|
-
def __init__(self, model_name: str, api_key: str | None = None, credentials_path: str | None = None, project_id: str | None = None, location: str = 'us-central1', model_kwargs: dict[str, Any] | None = None, default_hyperparameters: dict[str, Any] | None = None, retry_config: RetryConfig
|
|
100
|
+
def __init__(self, model_name: str, api_key: str | None = None, credentials_path: str | None = None, project_id: str | None = None, location: str = 'us-central1', model_kwargs: dict[str, Any] | None = None, default_hyperparameters: dict[str, Any] | None = None, retry_config: RetryConfig = ...) -> None:
|
|
101
101
|
'''Initializes a new instance of the GoogleEMInvoker class.
|
|
102
102
|
|
|
103
103
|
Args:
|
|
@@ -114,8 +114,8 @@ class GoogleEMInvoker(BaseEMInvoker):
|
|
|
114
114
|
Defaults to None.
|
|
115
115
|
default_hyperparameters (dict[str, Any] | None, optional): Default hyperparameters for invoking the model.
|
|
116
116
|
Defaults to None.
|
|
117
|
-
retry_config (RetryConfig
|
|
118
|
-
Defaults to
|
|
117
|
+
retry_config (RetryConfig, optional): The retry configuration for the embedding model.
|
|
118
|
+
Defaults to a default config with no retry and 30.0 seconds timeout.
|
|
119
119
|
|
|
120
120
|
Note:
|
|
121
121
|
If neither `api_key` nor `credentials_path` is provided, Google Gen AI will be used by default.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from _typeshed import Incomplete
|
|
2
2
|
from gllm_core.utils.retry import RetryConfig as RetryConfig
|
|
3
|
+
from gllm_inference.constants import INVOKER_DEFAULT_RETRY_CONFIG as INVOKER_DEFAULT_RETRY_CONFIG
|
|
3
4
|
from gllm_inference.em_invoker.em_invoker import BaseEMInvoker as BaseEMInvoker
|
|
4
5
|
from gllm_inference.schema import ModelId as ModelId, ModelProvider as ModelProvider, Vector as Vector
|
|
5
6
|
from gllm_inference.utils import load_langchain_model as load_langchain_model, parse_model_data as parse_model_data
|
|
@@ -19,7 +20,7 @@ class LangChainEMInvoker(BaseEMInvoker):
|
|
|
19
20
|
retry_config (RetryConfig): The retry configuration for the embedding model.
|
|
20
21
|
"""
|
|
21
22
|
model: Incomplete
|
|
22
|
-
def __init__(self, model: Embeddings | None = None, model_class_path: str | None = None, model_name: str | None = None, model_kwargs: dict[str, Any] | None = None, default_hyperparameters: dict[str, Any] | None = None, retry_config: RetryConfig
|
|
23
|
+
def __init__(self, model: Embeddings | None = None, model_class_path: str | None = None, model_name: str | None = None, model_kwargs: dict[str, Any] | None = None, default_hyperparameters: dict[str, Any] | None = None, retry_config: RetryConfig = ...) -> None:
|
|
23
24
|
'''Initializes a new instance of the LangChainEMInvoker class.
|
|
24
25
|
|
|
25
26
|
Args:
|
|
@@ -34,6 +35,6 @@ class LangChainEMInvoker(BaseEMInvoker):
|
|
|
34
35
|
`model_class_path` is provided. Defaults to None.
|
|
35
36
|
default_hyperparameters (dict[str, Any] | None, optional): Default hyperparameters for invoking the model.
|
|
36
37
|
Defaults to None.
|
|
37
|
-
retry_config (RetryConfig
|
|
38
|
-
Defaults to
|
|
38
|
+
retry_config (RetryConfig, optional): The retry configuration for the embedding model.
|
|
39
|
+
Defaults to a default config with no retry and 30.0 seconds timeout.
|
|
39
40
|
'''
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from _typeshed import Incomplete
|
|
2
2
|
from gllm_core.utils.retry import RetryConfig as RetryConfig
|
|
3
|
+
from gllm_inference.constants import INVOKER_DEFAULT_RETRY_CONFIG as INVOKER_DEFAULT_RETRY_CONFIG
|
|
3
4
|
from gllm_inference.em_invoker.openai_em_invoker import OpenAIEMInvoker as OpenAIEMInvoker
|
|
4
5
|
from gllm_inference.schema import ModelId as ModelId, ModelProvider as ModelProvider
|
|
5
6
|
from typing import Any
|
|
@@ -74,7 +75,7 @@ class OpenAICompatibleEMInvoker(OpenAIEMInvoker):
|
|
|
74
75
|
```
|
|
75
76
|
'''
|
|
76
77
|
client: Incomplete
|
|
77
|
-
def __init__(self, model_name: str, base_url: str, api_key: str | None = None, model_kwargs: dict[str, Any] | None = None, default_hyperparameters: dict[str, Any] | None = None, retry_config: RetryConfig
|
|
78
|
+
def __init__(self, model_name: str, base_url: str, api_key: str | None = None, model_kwargs: dict[str, Any] | None = None, default_hyperparameters: dict[str, Any] | None = None, retry_config: RetryConfig = ...) -> None:
|
|
78
79
|
"""Initializes a new instance of the OpenAICompatibleEMInvoker class.
|
|
79
80
|
|
|
80
81
|
Args:
|
|
@@ -85,6 +86,6 @@ class OpenAICompatibleEMInvoker(OpenAIEMInvoker):
|
|
|
85
86
|
model_kwargs (dict[str, Any] | None, optional): Additional model parameters. Defaults to None.
|
|
86
87
|
default_hyperparameters (dict[str, Any] | None, optional): Default hyperparameters for invoking the model.
|
|
87
88
|
Defaults to None.
|
|
88
|
-
retry_config (RetryConfig
|
|
89
|
-
Defaults to
|
|
89
|
+
retry_config (RetryConfig, optional): The retry configuration for the embedding model.
|
|
90
|
+
Defaults to a default config with no retry and 30.0 seconds timeout.
|
|
90
91
|
"""
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from _typeshed import Incomplete
|
|
2
2
|
from gllm_core.utils.retry import RetryConfig as RetryConfig
|
|
3
|
+
from gllm_inference.constants import INVOKER_DEFAULT_RETRY_CONFIG as INVOKER_DEFAULT_RETRY_CONFIG
|
|
3
4
|
from gllm_inference.em_invoker.em_invoker import BaseEMInvoker as BaseEMInvoker
|
|
4
5
|
from gllm_inference.schema import ModelId as ModelId, ModelProvider as ModelProvider, Vector as Vector
|
|
5
6
|
from typing import Any
|
|
@@ -68,7 +69,7 @@ class OpenAIEMInvoker(BaseEMInvoker):
|
|
|
68
69
|
```
|
|
69
70
|
'''
|
|
70
71
|
client: Incomplete
|
|
71
|
-
def __init__(self, model_name: str, api_key: str | None = None, model_kwargs: dict[str, Any] | None = None, default_hyperparameters: dict[str, Any] | None = None, retry_config: RetryConfig
|
|
72
|
+
def __init__(self, model_name: str, api_key: str | None = None, model_kwargs: dict[str, Any] | None = None, default_hyperparameters: dict[str, Any] | None = None, retry_config: RetryConfig = ...) -> None:
|
|
72
73
|
"""Initializes a new instance of the OpenAIEMInvoker class.
|
|
73
74
|
|
|
74
75
|
Args:
|
|
@@ -79,6 +80,6 @@ class OpenAIEMInvoker(BaseEMInvoker):
|
|
|
79
80
|
Defaults to None.
|
|
80
81
|
default_hyperparameters (dict[str, Any] | None, optional): Default hyperparameters for invoking the model.
|
|
81
82
|
Defaults to None.
|
|
82
|
-
retry_config (RetryConfig
|
|
83
|
-
Defaults to
|
|
83
|
+
retry_config (RetryConfig, optional): The retry configuration for the embedding model.
|
|
84
|
+
Defaults to a default config with no retry and 30.0 seconds timeout.
|
|
84
85
|
"""
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from _typeshed import Incomplete
|
|
2
2
|
from gllm_core.utils.retry import RetryConfig as RetryConfig
|
|
3
|
+
from gllm_inference.constants import INVOKER_DEFAULT_RETRY_CONFIG as INVOKER_DEFAULT_RETRY_CONFIG
|
|
3
4
|
from gllm_inference.em_invoker.em_invoker import BaseEMInvoker as BaseEMInvoker
|
|
4
5
|
from gllm_inference.em_invoker.schema.twelvelabs import InputType as InputType, Key as Key, OutputType as OutputType
|
|
5
6
|
from gllm_inference.schema import Attachment as Attachment, AttachmentType as AttachmentType, EMContent as EMContent, ModelId as ModelId, ModelProvider as ModelProvider, Vector as Vector
|
|
@@ -82,7 +83,7 @@ class TwelveLabsEMInvoker(BaseEMInvoker):
|
|
|
82
83
|
```
|
|
83
84
|
'''
|
|
84
85
|
client: Incomplete
|
|
85
|
-
def __init__(self, model_name: str, api_key: str | None = None, model_kwargs: dict[str, Any] | None = None, default_hyperparameters: dict[str, Any] | None = None, retry_config: RetryConfig
|
|
86
|
+
def __init__(self, model_name: str, api_key: str | None = None, model_kwargs: dict[str, Any] | None = None, default_hyperparameters: dict[str, Any] | None = None, retry_config: RetryConfig = ...) -> None:
|
|
86
87
|
"""Initializes a new instance of the TwelveLabsEMInvoker class.
|
|
87
88
|
|
|
88
89
|
Args:
|
|
@@ -93,6 +94,6 @@ class TwelveLabsEMInvoker(BaseEMInvoker):
|
|
|
93
94
|
Defaults to None.
|
|
94
95
|
default_hyperparameters (dict[str, Any] | None, optional): Default hyperparameters for invoking the model.
|
|
95
96
|
Defaults to None.
|
|
96
|
-
retry_config (RetryConfig
|
|
97
|
-
Defaults to
|
|
97
|
+
retry_config (RetryConfig, optional): The retry configuration for the embedding model.
|
|
98
|
+
Defaults to a default config with no retry and 30.0 seconds timeout.
|
|
98
99
|
"""
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from _typeshed import Incomplete
|
|
2
2
|
from gllm_core.utils.retry import RetryConfig as RetryConfig
|
|
3
|
+
from gllm_inference.constants import INVOKER_DEFAULT_RETRY_CONFIG as INVOKER_DEFAULT_RETRY_CONFIG
|
|
3
4
|
from gllm_inference.em_invoker.em_invoker import BaseEMInvoker as BaseEMInvoker
|
|
4
5
|
from gllm_inference.em_invoker.schema.voyage import InputType as InputType, Key as Key
|
|
5
6
|
from gllm_inference.schema import Attachment as Attachment, AttachmentType as AttachmentType, EMContent as EMContent, ModelId as ModelId, ModelProvider as ModelProvider, Vector as Vector
|
|
@@ -84,7 +85,7 @@ class VoyageEMInvoker(BaseEMInvoker):
|
|
|
84
85
|
```
|
|
85
86
|
'''
|
|
86
87
|
client: Incomplete
|
|
87
|
-
def __init__(self, model_name: str, api_key: str | None = None, model_kwargs: dict[str, Any] | None = None, default_hyperparameters: dict[str, Any] | None = None, retry_config: RetryConfig
|
|
88
|
+
def __init__(self, model_name: str, api_key: str | None = None, model_kwargs: dict[str, Any] | None = None, default_hyperparameters: dict[str, Any] | None = None, retry_config: RetryConfig = ...) -> None:
|
|
88
89
|
"""Initializes a new instance of the VoyageEMInvoker class.
|
|
89
90
|
|
|
90
91
|
Args:
|
|
@@ -95,6 +96,6 @@ class VoyageEMInvoker(BaseEMInvoker):
|
|
|
95
96
|
Defaults to None.
|
|
96
97
|
default_hyperparameters (dict[str, Any] | None, optional): Default hyperparameters for invoking the model.
|
|
97
98
|
Defaults to None.
|
|
98
|
-
retry_config (RetryConfig
|
|
99
|
-
Defaults to
|
|
99
|
+
retry_config (RetryConfig, optional): The retry configuration for the embedding model.
|
|
100
|
+
Defaults to a default config with no retry and 30.0 seconds timeout.
|
|
100
101
|
"""
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from _typeshed import Incomplete
|
|
2
2
|
from gllm_core.event import EventEmitter as EventEmitter
|
|
3
3
|
from gllm_core.utils.retry import RetryConfig as RetryConfig
|
|
4
|
+
from gllm_inference.constants import INVOKER_DEFAULT_RETRY_CONFIG as INVOKER_DEFAULT_RETRY_CONFIG
|
|
4
5
|
from gllm_inference.lm_invoker.lm_invoker import BaseLMInvoker as BaseLMInvoker
|
|
5
6
|
from gllm_inference.lm_invoker.schema.anthropic import InputType as InputType, Key as Key, OutputType as OutputType
|
|
6
7
|
from gllm_inference.schema import Attachment as Attachment, AttachmentType as AttachmentType, EmitDataType as EmitDataType, LMOutput as LMOutput, Message as Message, ModelId as ModelId, ModelProvider as ModelProvider, Reasoning as Reasoning, ResponseSchema as ResponseSchema, TokenUsage as TokenUsage, ToolCall as ToolCall, ToolResult as ToolResult
|
|
@@ -221,7 +222,7 @@ class AnthropicLMInvoker(BaseLMInvoker):
|
|
|
221
222
|
client: Incomplete
|
|
222
223
|
thinking: Incomplete
|
|
223
224
|
thinking_budget: Incomplete
|
|
224
|
-
def __init__(self, model_name: str, api_key: str | None = None, model_kwargs: dict[str, Any] | None = None, default_hyperparameters: dict[str, Any] | None = None, tools: list[Tool] | None = None, response_schema: ResponseSchema | None = None, output_analytics: bool = False, retry_config: RetryConfig
|
|
225
|
+
def __init__(self, model_name: str, api_key: str | None = None, model_kwargs: dict[str, Any] | None = None, default_hyperparameters: dict[str, Any] | None = None, tools: list[Tool] | None = None, response_schema: ResponseSchema | None = None, output_analytics: bool = False, retry_config: RetryConfig = ..., thinking: bool = False, thinking_budget: int = ...) -> None:
|
|
225
226
|
"""Initializes the AnthropicLmInvoker instance.
|
|
226
227
|
|
|
227
228
|
Args:
|
|
@@ -236,8 +237,8 @@ class AnthropicLMInvoker(BaseLMInvoker):
|
|
|
236
237
|
output a structured response as defined by the schema. Supports both Pydantic BaseModel and JSON schema
|
|
237
238
|
dictionary. Defaults to None.
|
|
238
239
|
output_analytics (bool, optional): Whether to output the invocation analytics. Defaults to False.
|
|
239
|
-
retry_config (RetryConfig
|
|
240
|
-
Defaults to
|
|
240
|
+
retry_config (RetryConfig, optional): The retry configuration for the language model.
|
|
241
|
+
Defaults to a default config with no retry and 30.0 seconds timeout.
|
|
241
242
|
thinking (bool, optional): Whether to enable thinking. Only allowed for thinking models. Defaults to False.
|
|
242
243
|
thinking_budget (int, optional): The tokens allocated for the thinking process. Must be greater than or
|
|
243
244
|
equal to 1024. Only allowed for thinking models. Defaults to DEFAULT_THINKING_BUDGET.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from _typeshed import Incomplete
|
|
2
2
|
from gllm_core.utils.retry import RetryConfig as RetryConfig
|
|
3
|
-
from gllm_inference.constants import DEFAULT_AZURE_OPENAI_API_VERSION as DEFAULT_AZURE_OPENAI_API_VERSION
|
|
3
|
+
from gllm_inference.constants import DEFAULT_AZURE_OPENAI_API_VERSION as DEFAULT_AZURE_OPENAI_API_VERSION, INVOKER_DEFAULT_RETRY_CONFIG as INVOKER_DEFAULT_RETRY_CONFIG
|
|
4
4
|
from gllm_inference.lm_invoker.openai_lm_invoker import OpenAILMInvoker as OpenAILMInvoker, ReasoningEffort as ReasoningEffort, ReasoningSummary as ReasoningSummary
|
|
5
5
|
from gllm_inference.schema import ModelId as ModelId, ModelProvider as ModelProvider, ResponseSchema as ResponseSchema
|
|
6
6
|
from langchain_core.tools import Tool as Tool
|
|
@@ -218,7 +218,7 @@ class AzureOpenAILMInvoker(OpenAILMInvoker):
|
|
|
218
218
|
Defaults to an empty list.
|
|
219
219
|
'''
|
|
220
220
|
client: Incomplete
|
|
221
|
-
def __init__(self, azure_endpoint: str, azure_deployment: str, api_key: str | None = None, api_version: str = ..., model_kwargs: dict[str, Any] | None = None, default_hyperparameters: dict[str, Any] | None = None, tools: list[Tool] | None = None, response_schema: ResponseSchema | None = None, output_analytics: bool = False, retry_config: RetryConfig
|
|
221
|
+
def __init__(self, azure_endpoint: str, azure_deployment: str, api_key: str | None = None, api_version: str = ..., model_kwargs: dict[str, Any] | None = None, default_hyperparameters: dict[str, Any] | None = None, tools: list[Tool] | None = None, response_schema: ResponseSchema | None = None, output_analytics: bool = False, retry_config: RetryConfig = ..., reasoning_effort: ReasoningEffort | None = None, reasoning_summary: ReasoningSummary | None = None) -> None:
|
|
222
222
|
"""Initializes a new instance of the AzureOpenAILMInvoker class.
|
|
223
223
|
|
|
224
224
|
Args:
|
|
@@ -237,8 +237,8 @@ class AzureOpenAILMInvoker(OpenAILMInvoker):
|
|
|
237
237
|
output a structured response as defined by the schema. Supports both Pydantic BaseModel and JSON schema
|
|
238
238
|
dictionary. Defaults to None.
|
|
239
239
|
output_analytics (bool, optional): Whether to output the invocation analytics. Defaults to False.
|
|
240
|
-
retry_config (RetryConfig
|
|
241
|
-
Defaults to
|
|
240
|
+
retry_config (RetryConfig, optional): The retry configuration for the language model.
|
|
241
|
+
Defaults to a default config with no retry and 30.0 seconds timeout.
|
|
242
242
|
reasoning_effort (ReasoningEffort | None, optional): The reasoning effort for reasoning models. Not allowed
|
|
243
243
|
for non-reasoning models. If None, the model will perform medium reasoning effort. Defaults to None.
|
|
244
244
|
reasoning_summary (ReasoningSummary | None, optional): The reasoning summary level for reasoning models.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from _typeshed import Incomplete
|
|
2
2
|
from gllm_core.event import EventEmitter as EventEmitter
|
|
3
3
|
from gllm_core.utils.retry import RetryConfig as RetryConfig
|
|
4
|
+
from gllm_inference.constants import INVOKER_DEFAULT_RETRY_CONFIG as INVOKER_DEFAULT_RETRY_CONFIG
|
|
4
5
|
from gllm_inference.lm_invoker.lm_invoker import BaseLMInvoker as BaseLMInvoker
|
|
5
6
|
from gllm_inference.lm_invoker.schema.bedrock import InputType as InputType, Key as Key, OutputType as OutputType
|
|
6
7
|
from gllm_inference.schema import Attachment as Attachment, AttachmentType as AttachmentType, LMOutput as LMOutput, Message as Message, ModelId as ModelId, ModelProvider as ModelProvider, ResponseSchema as ResponseSchema, TokenUsage as TokenUsage, ToolCall as ToolCall, ToolResult as ToolResult
|
|
@@ -179,7 +180,7 @@ class BedrockLMInvoker(BaseLMInvoker):
|
|
|
179
180
|
'''
|
|
180
181
|
session: Incomplete
|
|
181
182
|
client_kwargs: Incomplete
|
|
182
|
-
def __init__(self, model_name: str, access_key_id: str | None = None, secret_access_key: str | None = None, region_name: str = 'us-east-1', model_kwargs: dict[str, Any] | None = None, default_hyperparameters: dict[str, Any] | None = None, tools: list[Tool] | None = None, response_schema: ResponseSchema | None = None, output_analytics: bool = False, retry_config: RetryConfig
|
|
183
|
+
def __init__(self, model_name: str, access_key_id: str | None = None, secret_access_key: str | None = None, region_name: str = 'us-east-1', model_kwargs: dict[str, Any] | None = None, default_hyperparameters: dict[str, Any] | None = None, tools: list[Tool] | None = None, response_schema: ResponseSchema | None = None, output_analytics: bool = False, retry_config: RetryConfig = ...) -> None:
|
|
183
184
|
'''Initializes the BedrockLMInvoker instance.
|
|
184
185
|
|
|
185
186
|
Args:
|
|
@@ -197,8 +198,8 @@ class BedrockLMInvoker(BaseLMInvoker):
|
|
|
197
198
|
output a structured response as defined by the schema. Supports both Pydantic BaseModel and JSON schema
|
|
198
199
|
dictionary. Defaults to None.
|
|
199
200
|
output_analytics (bool, optional): Whether to output the invocation analytics. Defaults to False.
|
|
200
|
-
retry_config (RetryConfig
|
|
201
|
-
Defaults to
|
|
201
|
+
retry_config (RetryConfig, optional): The retry configuration for the language model.
|
|
202
|
+
Defaults to a default config with no retry and 30.0 seconds timeout.
|
|
202
203
|
|
|
203
204
|
Raises:
|
|
204
205
|
ValueError: If `response_schema` is provided, but `tools` are also provided.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from _typeshed import Incomplete
|
|
2
2
|
from gllm_core.event import EventEmitter as EventEmitter
|
|
3
3
|
from gllm_core.utils.retry import RetryConfig as RetryConfig
|
|
4
|
-
from gllm_inference.constants import DOCUMENT_MIME_TYPES as DOCUMENT_MIME_TYPES
|
|
4
|
+
from gllm_inference.constants import DOCUMENT_MIME_TYPES as DOCUMENT_MIME_TYPES, INVOKER_DEFAULT_RETRY_CONFIG as INVOKER_DEFAULT_RETRY_CONFIG
|
|
5
5
|
from gllm_inference.lm_invoker.openai_compatible_lm_invoker import OpenAICompatibleLMInvoker as OpenAICompatibleLMInvoker
|
|
6
6
|
from gllm_inference.lm_invoker.schema.datasaur import InputType as InputType, Key as Key
|
|
7
7
|
from gllm_inference.schema import Attachment as Attachment, AttachmentType as AttachmentType, LMOutput as LMOutput, Message as Message, ModelId as ModelId, ModelProvider as ModelProvider, ResponseSchema as ResponseSchema, ToolCall as ToolCall, ToolResult as ToolResult
|
|
@@ -121,7 +121,7 @@ class DatasaurLMInvoker(OpenAICompatibleLMInvoker):
|
|
|
121
121
|
'''
|
|
122
122
|
client: Incomplete
|
|
123
123
|
citations: Incomplete
|
|
124
|
-
def __init__(self, base_url: str, api_key: str | None = None, model_kwargs: dict[str, Any] | None = None, default_hyperparameters: dict[str, Any] | None = None, output_analytics: bool = False, retry_config: RetryConfig
|
|
124
|
+
def __init__(self, base_url: str, api_key: str | None = None, model_kwargs: dict[str, Any] | None = None, default_hyperparameters: dict[str, Any] | None = None, output_analytics: bool = False, retry_config: RetryConfig = ..., citations: bool = False) -> None:
|
|
125
125
|
"""Initializes a new instance of the DatasaurLMInvoker class.
|
|
126
126
|
|
|
127
127
|
Args:
|
|
@@ -132,8 +132,8 @@ class DatasaurLMInvoker(OpenAICompatibleLMInvoker):
|
|
|
132
132
|
default_hyperparameters (dict[str, Any] | None, optional): Default hyperparameters for invoking the model.
|
|
133
133
|
Defaults to None.
|
|
134
134
|
output_analytics (bool, optional): Whether to output the invocation analytics. Defaults to False.
|
|
135
|
-
retry_config (RetryConfig
|
|
136
|
-
Defaults to
|
|
135
|
+
retry_config (RetryConfig, optional): The retry configuration for the language model.
|
|
136
|
+
Defaults to a default config with no retry and 30.0 seconds timeout.
|
|
137
137
|
citations (bool, optional): Whether to output the citations. Defaults to False.
|
|
138
138
|
|
|
139
139
|
Raises:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from _typeshed import Incomplete
|
|
2
2
|
from gllm_core.event import EventEmitter as EventEmitter
|
|
3
3
|
from gllm_core.utils.retry import RetryConfig as RetryConfig
|
|
4
|
-
from gllm_inference.constants import GOOGLE_SCOPES as GOOGLE_SCOPES
|
|
4
|
+
from gllm_inference.constants import GOOGLE_SCOPES as GOOGLE_SCOPES, INVOKER_DEFAULT_RETRY_CONFIG as INVOKER_DEFAULT_RETRY_CONFIG
|
|
5
5
|
from gllm_inference.lm_invoker.lm_invoker import BaseLMInvoker as BaseLMInvoker
|
|
6
6
|
from gllm_inference.lm_invoker.schema.google import InputType as InputType, Key as Key
|
|
7
7
|
from gllm_inference.schema import Attachment as Attachment, AttachmentType as AttachmentType, EmitDataType as EmitDataType, LMOutput as LMOutput, Message as Message, MessageRole as MessageRole, ModelId as ModelId, ModelProvider as ModelProvider, Reasoning as Reasoning, ResponseSchema as ResponseSchema, TokenUsage as TokenUsage, ToolCall as ToolCall, ToolResult as ToolResult
|
|
@@ -250,7 +250,7 @@ class GoogleLMInvoker(BaseLMInvoker):
|
|
|
250
250
|
client_params: Incomplete
|
|
251
251
|
thinking: Incomplete
|
|
252
252
|
thinking_budget: Incomplete
|
|
253
|
-
def __init__(self, model_name: str, api_key: str | None = None, credentials_path: str | None = None, project_id: str | None = None, location: str = 'us-central1', model_kwargs: dict[str, Any] | None = None, default_hyperparameters: dict[str, Any] | None = None, tools: list[Tool] | None = None, response_schema: ResponseSchema | None = None, output_analytics: bool = False, retry_config: RetryConfig
|
|
253
|
+
def __init__(self, model_name: str, api_key: str | None = None, credentials_path: str | None = None, project_id: str | None = None, location: str = 'us-central1', model_kwargs: dict[str, Any] | None = None, default_hyperparameters: dict[str, Any] | None = None, tools: list[Tool] | None = None, response_schema: ResponseSchema | None = None, output_analytics: bool = False, retry_config: RetryConfig = ..., thinking: bool | None = None, thinking_budget: int = ...) -> None:
|
|
254
254
|
'''Initializes a new instance of the GoogleLMInvoker class.
|
|
255
255
|
|
|
256
256
|
Args:
|
|
@@ -273,8 +273,8 @@ class GoogleLMInvoker(BaseLMInvoker):
|
|
|
273
273
|
output a structured response as defined by the schema. Supports both Pydantic BaseModel and JSON schema
|
|
274
274
|
dictionary. Defaults to None.
|
|
275
275
|
output_analytics (bool, optional): Whether to output the invocation analytics. Defaults to False.
|
|
276
|
-
retry_config (RetryConfig
|
|
277
|
-
Defaults to
|
|
276
|
+
retry_config (RetryConfig, optional): The retry configuration for the language model.
|
|
277
|
+
Defaults to a default config with no retry and 30.0 seconds timeout.
|
|
278
278
|
thinking (bool | None, optional): Whether to enable thinking. Only allowed for thinking models.
|
|
279
279
|
Defaults to True for Gemini 2.5 Pro models and False for other models.
|
|
280
280
|
thinking_budget (int, optional): The tokens allowed for thinking process. Only allowed for thinking models.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from _typeshed import Incomplete
|
|
2
2
|
from gllm_core.event import EventEmitter as EventEmitter
|
|
3
3
|
from gllm_core.utils.retry import RetryConfig as RetryConfig
|
|
4
|
+
from gllm_inference.constants import INVOKER_DEFAULT_RETRY_CONFIG as INVOKER_DEFAULT_RETRY_CONFIG
|
|
4
5
|
from gllm_inference.lm_invoker.lm_invoker import BaseLMInvoker as BaseLMInvoker
|
|
5
6
|
from gllm_inference.lm_invoker.schema.langchain import InputType as InputType, Key as Key
|
|
6
7
|
from gllm_inference.schema import Attachment as Attachment, AttachmentType as AttachmentType, LMOutput as LMOutput, Message as Message, MessageRole as MessageRole, ModelId as ModelId, ModelProvider as ModelProvider, ResponseSchema as ResponseSchema, TokenUsage as TokenUsage, ToolCall as ToolCall, ToolResult as ToolResult
|
|
@@ -203,7 +204,7 @@ class LangChainLMInvoker(BaseLMInvoker):
|
|
|
203
204
|
Defaults to an empty list.
|
|
204
205
|
'''
|
|
205
206
|
model: Incomplete
|
|
206
|
-
def __init__(self, model: BaseChatModel | None = None, model_class_path: str | None = None, model_name: str | None = None, model_kwargs: dict[str, Any] | None = None, default_hyperparameters: dict[str, Any] | None = None, tools: list[Tool] | None = None, response_schema: ResponseSchema | None = None, output_analytics: bool = False, retry_config: RetryConfig
|
|
207
|
+
def __init__(self, model: BaseChatModel | None = None, model_class_path: str | None = None, model_name: str | None = None, model_kwargs: dict[str, Any] | None = None, default_hyperparameters: dict[str, Any] | None = None, tools: list[Tool] | None = None, response_schema: ResponseSchema | None = None, output_analytics: bool = False, retry_config: RetryConfig = ...) -> None:
|
|
207
208
|
'''Initializes a new instance of the LangChainLMInvoker class.
|
|
208
209
|
|
|
209
210
|
Args:
|
|
@@ -223,8 +224,8 @@ class LangChainLMInvoker(BaseLMInvoker):
|
|
|
223
224
|
output a structured response as defined by the schema. Supports both Pydantic BaseModel and JSON schema
|
|
224
225
|
dictionary. Defaults to None.
|
|
225
226
|
output_analytics (bool, optional): Whether to output the invocation analytics. Defaults to False.
|
|
226
|
-
retry_config (RetryConfig
|
|
227
|
-
Defaults to
|
|
227
|
+
retry_config (RetryConfig, optional): The retry configuration for the language model.
|
|
228
|
+
Defaults to a default config with no retry and 30.0 seconds timeout.
|
|
228
229
|
|
|
229
230
|
Raises:
|
|
230
231
|
ValueError: If `response_schema` is provided, but `tools` are also provided.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from _typeshed import Incomplete
|
|
2
2
|
from gllm_core.event import EventEmitter as EventEmitter
|
|
3
3
|
from gllm_core.utils.retry import RetryConfig as RetryConfig
|
|
4
|
+
from gllm_inference.constants import INVOKER_DEFAULT_RETRY_CONFIG as INVOKER_DEFAULT_RETRY_CONFIG
|
|
4
5
|
from gllm_inference.lm_invoker.openai_compatible_lm_invoker import OpenAICompatibleLMInvoker as OpenAICompatibleLMInvoker
|
|
5
6
|
from gllm_inference.lm_invoker.openai_lm_invoker import ReasoningEffort as ReasoningEffort
|
|
6
7
|
from gllm_inference.schema import AttachmentType as AttachmentType, LMOutput as LMOutput, ModelId as ModelId, ModelProvider as ModelProvider, ResponseSchema as ResponseSchema
|
|
@@ -227,7 +228,7 @@ class LiteLLMLMInvoker(OpenAICompatibleLMInvoker):
|
|
|
227
228
|
Defaults to an empty list.
|
|
228
229
|
'''
|
|
229
230
|
completion: Incomplete
|
|
230
|
-
def __init__(self, model_id: str, default_hyperparameters: dict[str, Any] | None = None, tools: list[Tool] | None = None, response_schema: ResponseSchema | None = None, output_analytics: bool = False, retry_config: RetryConfig
|
|
231
|
+
def __init__(self, model_id: str, default_hyperparameters: dict[str, Any] | None = None, tools: list[Tool] | None = None, response_schema: ResponseSchema | None = None, output_analytics: bool = False, retry_config: RetryConfig = ..., reasoning_effort: ReasoningEffort | None = None) -> None:
|
|
231
232
|
"""Initializes a new instance of the LiteLLMLMInvoker class.
|
|
232
233
|
|
|
233
234
|
Args:
|
|
@@ -239,8 +240,8 @@ class LiteLLMLMInvoker(OpenAICompatibleLMInvoker):
|
|
|
239
240
|
output a structured response as defined by the schema. Supports both Pydantic BaseModel and JSON schema
|
|
240
241
|
dictionary. Defaults to None.
|
|
241
242
|
output_analytics (bool, optional): Whether to output the invocation analytics. Defaults to False.
|
|
242
|
-
retry_config (RetryConfig
|
|
243
|
-
Defaults to
|
|
243
|
+
retry_config (RetryConfig, optional): The retry configuration for the language model.
|
|
244
|
+
Defaults to a default config with no retry and 30.0 seconds timeout.
|
|
244
245
|
reasoning_effort (ReasoningEffort | None, optional): The reasoning effort for reasoning models.
|
|
245
246
|
Defaults to None.
|
|
246
247
|
"""
|
|
@@ -3,7 +3,7 @@ from _typeshed import Incomplete
|
|
|
3
3
|
from abc import ABC
|
|
4
4
|
from gllm_core.event import EventEmitter as EventEmitter
|
|
5
5
|
from gllm_core.utils.retry import RetryConfig
|
|
6
|
-
from gllm_inference.constants import DOCUMENT_MIME_TYPES as DOCUMENT_MIME_TYPES
|
|
6
|
+
from gllm_inference.constants import DOCUMENT_MIME_TYPES as DOCUMENT_MIME_TYPES, INVOKER_DEFAULT_RETRY_CONFIG as INVOKER_DEFAULT_RETRY_CONFIG
|
|
7
7
|
from gllm_inference.exceptions import parse_error_message as parse_error_message
|
|
8
8
|
from gllm_inference.schema import Attachment as Attachment, AttachmentType as AttachmentType, EmitDataType as EmitDataType, LMOutput as LMOutput, Message as Message, MessageContent as MessageContent, MessageRole as MessageRole, ModelId as ModelId, Reasoning as Reasoning, ResponseSchema as ResponseSchema, ToolCall as ToolCall, ToolResult as ToolResult
|
|
9
9
|
from langchain_core.tools import Tool as Tool
|
|
@@ -46,7 +46,7 @@ class BaseLMInvoker(ABC, metaclass=abc.ABCMeta):
|
|
|
46
46
|
response_schema: Incomplete
|
|
47
47
|
output_analytics: Incomplete
|
|
48
48
|
retry_config: Incomplete
|
|
49
|
-
def __init__(self, model_id: ModelId, default_hyperparameters: dict[str, Any] | None = None, supported_attachments: set[str] | None = None, tools: list[Tool] | None = None, response_schema: ResponseSchema | None = None, output_analytics: bool = False, retry_config: RetryConfig
|
|
49
|
+
def __init__(self, model_id: ModelId, default_hyperparameters: dict[str, Any] | None = None, supported_attachments: set[str] | None = None, tools: list[Tool] | None = None, response_schema: ResponseSchema | None = None, output_analytics: bool = False, retry_config: RetryConfig = ...) -> None:
|
|
50
50
|
"""Initializes a new instance of the BaseLMInvoker class.
|
|
51
51
|
|
|
52
52
|
Args:
|
|
@@ -61,8 +61,8 @@ class BaseLMInvoker(ABC, metaclass=abc.ABCMeta):
|
|
|
61
61
|
output a structured response as defined by the schema. Supports both Pydantic BaseModel and JSON schema
|
|
62
62
|
dictionary. Defaults to None.
|
|
63
63
|
output_analytics (bool, optional): Whether to output the invocation analytics. Defaults to False.
|
|
64
|
-
retry_config (RetryConfig
|
|
65
|
-
Defaults to
|
|
64
|
+
retry_config (RetryConfig, optional): The retry configuration for the language model.
|
|
65
|
+
Defaults to a default config with no retry and 30.0 seconds timeout.
|
|
66
66
|
"""
|
|
67
67
|
@property
|
|
68
68
|
def model_id(self) -> str:
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from _typeshed import Incomplete
|
|
2
2
|
from gllm_core.event import EventEmitter as EventEmitter
|
|
3
3
|
from gllm_core.utils.retry import RetryConfig as RetryConfig
|
|
4
|
+
from gllm_inference.constants import INVOKER_DEFAULT_RETRY_CONFIG as INVOKER_DEFAULT_RETRY_CONFIG
|
|
4
5
|
from gllm_inference.lm_invoker.lm_invoker import BaseLMInvoker as BaseLMInvoker
|
|
5
6
|
from gllm_inference.lm_invoker.schema.openai_compatible import InputType as InputType, Key as Key, ReasoningEffort as ReasoningEffort
|
|
6
7
|
from gllm_inference.schema import Attachment as Attachment, AttachmentType as AttachmentType, EmitDataType as EmitDataType, LMOutput as LMOutput, Message as Message, MessageRole as MessageRole, ModelId as ModelId, ModelProvider as ModelProvider, Reasoning as Reasoning, ResponseSchema as ResponseSchema, TokenUsage as TokenUsage, ToolCall as ToolCall, ToolResult as ToolResult
|
|
@@ -230,14 +231,15 @@ class OpenAICompatibleLMInvoker(BaseLMInvoker):
|
|
|
230
231
|
Defaults to an empty list.
|
|
231
232
|
'''
|
|
232
233
|
client: Incomplete
|
|
233
|
-
def __init__(self, model_name: str, base_url: str, api_key: str | None = None, model_kwargs: dict[str, Any] | None = None, default_hyperparameters: dict[str, Any] | None = None, tools: list[Tool] | None = None, response_schema: ResponseSchema | None = None, output_analytics: bool = False, retry_config: RetryConfig
|
|
234
|
-
|
|
234
|
+
def __init__(self, model_name: str, base_url: str, api_key: str | None = None, model_kwargs: dict[str, Any] | None = None, default_hyperparameters: dict[str, Any] | None = None, tools: list[Tool] | None = None, response_schema: ResponseSchema | None = None, output_analytics: bool = False, retry_config: RetryConfig = ..., reasoning_effort: ReasoningEffort | None = None) -> None:
|
|
235
|
+
'''Initializes a new instance of the OpenAICompatibleLMInvoker class.
|
|
235
236
|
|
|
236
237
|
Args:
|
|
237
238
|
model_name (str): The name of the language model hosted on the OpenAI compatible endpoint.
|
|
238
239
|
base_url (str): The base URL for the OpenAI compatible endpoint.
|
|
239
240
|
api_key (str | None, optional): The API key for authenticating with the OpenAI compatible endpoint.
|
|
240
241
|
Defaults to None, in which case the `OPENAI_API_KEY` environment variable will be used.
|
|
242
|
+
If the endpoint does not require an API key, a dummy value can be passed (e.g. "<empty>").
|
|
241
243
|
model_kwargs (dict[str, Any] | None, optional): Additional model parameters. Defaults to None.
|
|
242
244
|
default_hyperparameters (dict[str, Any] | None, optional): Default hyperparameters for invoking the model.
|
|
243
245
|
Defaults to None.
|
|
@@ -247,10 +249,10 @@ class OpenAICompatibleLMInvoker(BaseLMInvoker):
|
|
|
247
249
|
output a structured response as defined by the schema. Supports both Pydantic BaseModel and JSON schema
|
|
248
250
|
dictionary. Defaults to None.
|
|
249
251
|
output_analytics (bool, optional): Whether to output the invocation analytics. Defaults to False.
|
|
250
|
-
retry_config (RetryConfig
|
|
251
|
-
Defaults to
|
|
252
|
+
retry_config (RetryConfig, optional): The retry configuration for the language model.
|
|
253
|
+
Defaults to a default config with no retry and 30.0 seconds timeout.
|
|
252
254
|
reasoning_effort (str | None, optional): The reasoning effort for the language model. Defaults to None.
|
|
253
|
-
|
|
255
|
+
'''
|
|
254
256
|
def set_response_schema(self, response_schema: ResponseSchema | None) -> None:
|
|
255
257
|
"""Sets the response schema for the language model hosted on the OpenAI compatible endpoint.
|
|
256
258
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from _typeshed import Incomplete
|
|
2
2
|
from gllm_core.event import EventEmitter as EventEmitter
|
|
3
3
|
from gllm_core.utils.retry import RetryConfig as RetryConfig
|
|
4
|
+
from gllm_inference.constants import INVOKER_DEFAULT_RETRY_CONFIG as INVOKER_DEFAULT_RETRY_CONFIG
|
|
4
5
|
from gllm_inference.lm_invoker.lm_invoker import BaseLMInvoker as BaseLMInvoker
|
|
5
6
|
from gllm_inference.lm_invoker.schema.openai import InputType as InputType, Key as Key, OutputType as OutputType, ReasoningEffort as ReasoningEffort, ReasoningSummary as ReasoningSummary
|
|
6
7
|
from gllm_inference.schema import Attachment as Attachment, AttachmentType as AttachmentType, CodeExecResult as CodeExecResult, EmitDataType as EmitDataType, LMOutput as LMOutput, Message as Message, MessageRole as MessageRole, ModelId as ModelId, ModelProvider as ModelProvider, Reasoning as Reasoning, ResponseSchema as ResponseSchema, TokenUsage as TokenUsage, ToolCall as ToolCall, ToolResult as ToolResult
|
|
@@ -318,7 +319,7 @@ class OpenAILMInvoker(BaseLMInvoker):
|
|
|
318
319
|
enabled and the language model decides to execute any codes. Defaults to an empty list.
|
|
319
320
|
'''
|
|
320
321
|
client: Incomplete
|
|
321
|
-
def __init__(self, model_name: str, api_key: str | None = None, model_kwargs: dict[str, Any] | None = None, default_hyperparameters: dict[str, Any] | None = None, tools: list[Tool] | None = None, response_schema: ResponseSchema | None = None, output_analytics: bool = False, retry_config: RetryConfig
|
|
322
|
+
def __init__(self, model_name: str, api_key: str | None = None, model_kwargs: dict[str, Any] | None = None, default_hyperparameters: dict[str, Any] | None = None, tools: list[Tool] | None = None, response_schema: ResponseSchema | None = None, output_analytics: bool = False, retry_config: RetryConfig = ..., reasoning_effort: ReasoningEffort | None = None, reasoning_summary: ReasoningSummary | None = None, code_interpreter: bool = False, web_search: bool = False) -> None:
|
|
322
323
|
"""Initializes a new instance of the OpenAILMInvoker class.
|
|
323
324
|
|
|
324
325
|
Args:
|
|
@@ -334,8 +335,8 @@ class OpenAILMInvoker(BaseLMInvoker):
|
|
|
334
335
|
output a structured response as defined by the schema. Supports both Pydantic BaseModel and JSON schema
|
|
335
336
|
dictionary. Defaults to None.
|
|
336
337
|
output_analytics (bool, optional): Whether to output the invocation analytics. Defaults to False.
|
|
337
|
-
retry_config (RetryConfig
|
|
338
|
-
Defaults to
|
|
338
|
+
retry_config (RetryConfig, optional): The retry configuration for the language model.
|
|
339
|
+
Defaults to a default config with no retry and 30.0 seconds timeout.
|
|
339
340
|
reasoning_effort (ReasoningEffort | None, optional): The reasoning effort for reasoning models. Not allowed
|
|
340
341
|
for non-reasoning models. If None, the model will perform medium reasoning effort. Defaults to None.
|
|
341
342
|
reasoning_summary (ReasoningSummary | None, optional): The reasoning summary level for reasoning models.
|
|
Binary file
|
{gllm_inference_binary-0.5.1.post1.dist-info → gllm_inference_binary-0.5.2.dist-info}/RECORD
RENAMED
|
@@ -8,35 +8,35 @@ gllm_inference/catalog/__init__.pyi,sha256=HWgPKWIzprpMHRKe_qN9BZSIQhVhrqiyjLjIX
|
|
|
8
8
|
gllm_inference/catalog/catalog.pyi,sha256=eWPqgQKi-SJGHabi_XOTEKpAj96OSRypKsb5ZEC1VWU,4911
|
|
9
9
|
gllm_inference/catalog/lm_request_processor_catalog.pyi,sha256=ymRYDQ0VY3Pmh--IeZBIZPkNqY76YoPrakLryU_txF8,4699
|
|
10
10
|
gllm_inference/catalog/prompt_builder_catalog.pyi,sha256=ONWUArce7jNA1SmQWixYf-mTfVpD4kCARxiTqitQlB0,3244
|
|
11
|
-
gllm_inference/constants.pyi,sha256=
|
|
11
|
+
gllm_inference/constants.pyi,sha256=w2aD7b56mE3xgjiXHbXXgl8ckBI6IZpSCtEGmYBJps8,238
|
|
12
12
|
gllm_inference/em_invoker/__init__.pyi,sha256=eZifmg3ZS3YdFUwbGPTurrfF4oV_MAPvqErJe7oTpZI,882
|
|
13
|
-
gllm_inference/em_invoker/azure_openai_em_invoker.pyi,sha256=
|
|
14
|
-
gllm_inference/em_invoker/em_invoker.pyi,sha256
|
|
15
|
-
gllm_inference/em_invoker/google_em_invoker.pyi,sha256=
|
|
13
|
+
gllm_inference/em_invoker/azure_openai_em_invoker.pyi,sha256=6i8K7C8OaaBXUIXAEKB_wTT02EdRoCrh2aaZRFHUVes,4572
|
|
14
|
+
gllm_inference/em_invoker/em_invoker.pyi,sha256=-EZfzt6TR6gbN4j4Xa4I_F6Yw0qjpAP_nTNh26TDhTw,4401
|
|
15
|
+
gllm_inference/em_invoker/google_em_invoker.pyi,sha256=4bKLMYEZOwOQQav4C3hpCTpx35HlusJsCjGt555M4VE,6204
|
|
16
16
|
gllm_inference/em_invoker/langchain/__init__.pyi,sha256=aOTlRvS9aG1tBErjsmhe75s4Sq-g2z9ArfGqNW7QyEs,151
|
|
17
17
|
gllm_inference/em_invoker/langchain/em_invoker_embeddings.pyi,sha256=gEX21gJLngUh9fZo8v6Vbh0gpWFFqS2S-dGNZSrDjFQ,2409
|
|
18
|
-
gllm_inference/em_invoker/langchain_em_invoker.pyi,sha256=
|
|
19
|
-
gllm_inference/em_invoker/openai_compatible_em_invoker.pyi,sha256=
|
|
20
|
-
gllm_inference/em_invoker/openai_em_invoker.pyi,sha256=
|
|
18
|
+
gllm_inference/em_invoker/langchain_em_invoker.pyi,sha256=CU8ZQNsmy9Wty9zfrkEHWmcXIi14zuEGu3VkVqqrYjk,2667
|
|
19
|
+
gllm_inference/em_invoker/openai_compatible_em_invoker.pyi,sha256=rpzZIrUGNRnEnG4bEoRlq6lL-WVcsNiH0NqBC_ZPvhc,4943
|
|
20
|
+
gllm_inference/em_invoker/openai_em_invoker.pyi,sha256=SGcsPYQtMmuHhsThELX41DCIJg3u37rDhmynobCQc_I,4205
|
|
21
21
|
gllm_inference/em_invoker/schema/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
22
22
|
gllm_inference/em_invoker/schema/twelvelabs.pyi,sha256=E7sl1OumEzx_Dj8SeiJ6i8AFuRKzAmRVGfIRCk3gv_0,349
|
|
23
23
|
gllm_inference/em_invoker/schema/voyage.pyi,sha256=mL0D2lqqudL1S-eVF5K4uBt0xuMjvYtVrQzLx0-6gq0,230
|
|
24
|
-
gllm_inference/em_invoker/twelevelabs_em_invoker.pyi,sha256=
|
|
25
|
-
gllm_inference/em_invoker/voyage_em_invoker.pyi,sha256=
|
|
24
|
+
gllm_inference/em_invoker/twelevelabs_em_invoker.pyi,sha256=FAddCLN41p5HI8ppDvZxD6IYbXky-MMflLA1YR0vHWQ,5113
|
|
25
|
+
gllm_inference/em_invoker/voyage_em_invoker.pyi,sha256=YlkNRgqeVHRj8jiaPANoTDBtb0OwEIieyHg477JGk5A,5183
|
|
26
26
|
gllm_inference/exceptions/__init__.pyi,sha256=2F05RytXZIKaOJScb1pD0O0bATIQHVeEAYYNX4y5N2A,981
|
|
27
27
|
gllm_inference/exceptions/error_parser.pyi,sha256=ggmh8DJXdwFJInNLrP24WVJt_4raxbAVxzXRQgBpndA,2441
|
|
28
28
|
gllm_inference/exceptions/exceptions.pyi,sha256=ViXvIzm7tLcstjqfwC6nPziDg0UAmoUAWZVWrAJyp3w,4763
|
|
29
29
|
gllm_inference/lm_invoker/__init__.pyi,sha256=g-wu6W6ly_WAVPLDWKjt4J5cMo-CJ1x5unuObVSUnug,1115
|
|
30
|
-
gllm_inference/lm_invoker/anthropic_lm_invoker.pyi,sha256=
|
|
31
|
-
gllm_inference/lm_invoker/azure_openai_lm_invoker.pyi,sha256=
|
|
32
|
-
gllm_inference/lm_invoker/bedrock_lm_invoker.pyi,sha256=
|
|
33
|
-
gllm_inference/lm_invoker/datasaur_lm_invoker.pyi,sha256
|
|
34
|
-
gllm_inference/lm_invoker/google_lm_invoker.pyi,sha256=
|
|
35
|
-
gllm_inference/lm_invoker/langchain_lm_invoker.pyi,sha256=
|
|
36
|
-
gllm_inference/lm_invoker/litellm_lm_invoker.pyi,sha256=
|
|
37
|
-
gllm_inference/lm_invoker/lm_invoker.pyi,sha256=
|
|
38
|
-
gllm_inference/lm_invoker/openai_compatible_lm_invoker.pyi,sha256
|
|
39
|
-
gllm_inference/lm_invoker/openai_lm_invoker.pyi,sha256
|
|
30
|
+
gllm_inference/lm_invoker/anthropic_lm_invoker.pyi,sha256=HyINBTG8L0dBUsUwS3Qk_gi96N68xUAzsKZVjjljvMU,14986
|
|
31
|
+
gllm_inference/lm_invoker/azure_openai_lm_invoker.pyi,sha256=CeM8ZUvVkdxdJuHpI9vEMRMRSR4JDfwedR4wFNM2unU,14672
|
|
32
|
+
gllm_inference/lm_invoker/bedrock_lm_invoker.pyi,sha256=nwygWzm1UxTPkMlCU1OR7cT-ZlWV6IVwYeQQBXgqWF4,12581
|
|
33
|
+
gllm_inference/lm_invoker/datasaur_lm_invoker.pyi,sha256=whLQ8u5CD8Dm8_NmuAuMZnnqfoQf7cEmA_zqxYgUhZM,9228
|
|
34
|
+
gllm_inference/lm_invoker/google_lm_invoker.pyi,sha256=OZjfJEBqBwsDn9VsQp7TiCOtX8s-96XpOEA-poBU6IE,16716
|
|
35
|
+
gllm_inference/lm_invoker/langchain_lm_invoker.pyi,sha256=ax9PNEwcxXRLMWo4z6dXi3S7Us18Jpf0QXpkmpjRcWY,13324
|
|
36
|
+
gllm_inference/lm_invoker/litellm_lm_invoker.pyi,sha256=UEmLLkoWEb9xNPJys06SgXJgnx6cIn-Iv2uXkio3MoA,13334
|
|
37
|
+
gllm_inference/lm_invoker/lm_invoker.pyi,sha256=4FRpzg4kbIHdc_dTPrBDXLVBio9X7xlQ1G20L6L8wBQ,7716
|
|
38
|
+
gllm_inference/lm_invoker/openai_compatible_lm_invoker.pyi,sha256=-AXP9npujdMvEaw9ogzHS2aQT_5fbM-iJcKGL0zi0Tc,15073
|
|
39
|
+
gllm_inference/lm_invoker/openai_lm_invoker.pyi,sha256=E24JioweRTmp7MXu0dDJHda8936kN1gxyQXiQ0UmDoc,19735
|
|
40
40
|
gllm_inference/lm_invoker/schema/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
41
41
|
gllm_inference/lm_invoker/schema/anthropic.pyi,sha256=MJHHyqMGQgj9tURyewuVlmxHxiAzU9qzmJEiK5IUoWw,1020
|
|
42
42
|
gllm_inference/lm_invoker/schema/bedrock.pyi,sha256=H3attoGWhBA725W4FpXw7Mty46N9jHKjw9PT-0lMEJs,975
|
|
@@ -86,8 +86,8 @@ gllm_inference/utils/__init__.pyi,sha256=RBTWDu1TDPpTd17fixcPYFv2L_vp4-IAOX0Isxg
|
|
|
86
86
|
gllm_inference/utils/langchain.pyi,sha256=4AwFiVAO0ZpdgmqeC4Pb5NJwBt8vVr0MSUqLeCdTscc,1194
|
|
87
87
|
gllm_inference/utils/validation.pyi,sha256=-RdMmb8afH7F7q4Ao7x6FbwaDfxUHn3hA3WiOgzB-3s,397
|
|
88
88
|
gllm_inference.build/.gitignore,sha256=aEiIwOuxfzdCmLZe4oB1JsBmCUxwG8x-u-HBCV9JT8E,1
|
|
89
|
-
gllm_inference.cp311-win_amd64.pyd,sha256=
|
|
89
|
+
gllm_inference.cp311-win_amd64.pyd,sha256=MaxIJ8cWOQSmVsJuc4Q13P2gJ_yYcYAmCs_GloP1y1M,2654720
|
|
90
90
|
gllm_inference.pyi,sha256=VEcscbPCJ-6lXU4jV3YYXwwumk9kWxpCAsS84ssKG6o,3295
|
|
91
|
-
gllm_inference_binary-0.5.
|
|
92
|
-
gllm_inference_binary-0.5.
|
|
93
|
-
gllm_inference_binary-0.5.
|
|
91
|
+
gllm_inference_binary-0.5.2.dist-info/METADATA,sha256=g7UfIlC7oMewzWaJ8cI7SKlNYdEKL11XARSYJGpyEbM,4531
|
|
92
|
+
gllm_inference_binary-0.5.2.dist-info/WHEEL,sha256=-FZBVKyKauScY3vLa8vJR6hBCpAJfFykw2MOwlNKr1g,98
|
|
93
|
+
gllm_inference_binary-0.5.2.dist-info/RECORD,,
|
|
File without changes
|