gllm-inference-binary 0.5.2__cp313-cp313-macosx_13_0_x86_64.whl → 0.5.4__cp313-cp313-macosx_13_0_x86_64.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 -1
- 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 +3 -4
- gllm_inference/em_invoker/openai_compatible_em_invoker.pyi +3 -4
- gllm_inference/em_invoker/openai_em_invoker.pyi +3 -4
- gllm_inference/em_invoker/twelevelabs_em_invoker.pyi +3 -4
- gllm_inference/em_invoker/voyage_em_invoker.pyi +3 -4
- gllm_inference/lm_invoker/anthropic_lm_invoker.pyi +3 -4
- gllm_inference/lm_invoker/azure_openai_lm_invoker.pyi +4 -4
- gllm_inference/lm_invoker/bedrock_lm_invoker.pyi +3 -4
- 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 +3 -4
- gllm_inference/lm_invoker/litellm_lm_invoker.pyi +3 -4
- gllm_inference/lm_invoker/lm_invoker.pyi +4 -4
- gllm_inference/lm_invoker/openai_compatible_lm_invoker.pyi +3 -4
- gllm_inference/lm_invoker/openai_lm_invoker.pyi +3 -4
- gllm_inference/schema/attachment.pyi +12 -0
- gllm_inference.cpython-313-darwin.so +0 -0
- {gllm_inference_binary-0.5.2.dist-info → gllm_inference_binary-0.5.4.dist-info}/METADATA +1 -1
- {gllm_inference_binary-0.5.2.dist-info → gllm_inference_binary-0.5.4.dist-info}/RECORD +24 -24
- {gllm_inference_binary-0.5.2.dist-info → gllm_inference_binary-0.5.4.dist-info}/WHEEL +0 -0
gllm_inference/constants.pyi
CHANGED
|
@@ -3,6 +3,6 @@ from _typeshed import Incomplete
|
|
|
3
3
|
DEFAULT_AZURE_OPENAI_API_VERSION: str
|
|
4
4
|
DOCUMENT_MIME_TYPES: Incomplete
|
|
5
5
|
GOOGLE_SCOPES: Incomplete
|
|
6
|
-
|
|
6
|
+
INVOKER_DEFAULT_TIMEOUT: float
|
|
7
7
|
HEX_REPR_LENGTH: int
|
|
8
8
|
HTTP_STATUS_CODE_PATTERNS: Incomplete
|
|
@@ -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
|
|
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 = None) -> 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, optional): The retry configuration for the embedding model.
|
|
84
|
-
Defaults to a default config with no retry and 30.0 seconds timeout.
|
|
83
|
+
retry_config (RetryConfig | None, optional): The retry configuration for the embedding model.
|
|
84
|
+
Defaults to None, in which case a default config with no retry and 30.0 seconds timeout will be used.
|
|
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
|
|
5
|
+
from gllm_inference.constants import DOCUMENT_MIME_TYPES as DOCUMENT_MIME_TYPES, INVOKER_DEFAULT_TIMEOUT as INVOKER_DEFAULT_TIMEOUT
|
|
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 = None) -> 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, optional): The retry configuration for the embedding model.
|
|
34
|
-
Defaults to a default config with no retry and 30.0 seconds timeout.
|
|
33
|
+
retry_config (RetryConfig | None, optional): The retry configuration for the embedding model.
|
|
34
|
+
Defaults to None, in which case a default config with no retry and 30.0 seconds timeout will be used.
|
|
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
|
|
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 = None) -> 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, optional): The retry configuration for the embedding model.
|
|
118
|
-
Defaults to a default config with no retry and 30.0 seconds timeout.
|
|
117
|
+
retry_config (RetryConfig | None, optional): The retry configuration for the embedding model.
|
|
118
|
+
Defaults to None, in which case a default config with no retry and 30.0 seconds timeout will be used.
|
|
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,6 +1,5 @@
|
|
|
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
|
|
4
3
|
from gllm_inference.em_invoker.em_invoker import BaseEMInvoker as BaseEMInvoker
|
|
5
4
|
from gllm_inference.schema import ModelId as ModelId, ModelProvider as ModelProvider, Vector as Vector
|
|
6
5
|
from gllm_inference.utils import load_langchain_model as load_langchain_model, parse_model_data as parse_model_data
|
|
@@ -20,7 +19,7 @@ class LangChainEMInvoker(BaseEMInvoker):
|
|
|
20
19
|
retry_config (RetryConfig): The retry configuration for the embedding model.
|
|
21
20
|
"""
|
|
22
21
|
model: Incomplete
|
|
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 =
|
|
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 | None = None) -> None:
|
|
24
23
|
'''Initializes a new instance of the LangChainEMInvoker class.
|
|
25
24
|
|
|
26
25
|
Args:
|
|
@@ -35,6 +34,6 @@ class LangChainEMInvoker(BaseEMInvoker):
|
|
|
35
34
|
`model_class_path` is provided. Defaults to None.
|
|
36
35
|
default_hyperparameters (dict[str, Any] | None, optional): Default hyperparameters for invoking the model.
|
|
37
36
|
Defaults to None.
|
|
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.
|
|
37
|
+
retry_config (RetryConfig | None, optional): The retry configuration for the embedding model.
|
|
38
|
+
Defaults to None, in which case a default config with no retry and 30.0 seconds timeout will be used.
|
|
40
39
|
'''
|
|
@@ -1,6 +1,5 @@
|
|
|
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
|
|
4
3
|
from gllm_inference.em_invoker.openai_em_invoker import OpenAIEMInvoker as OpenAIEMInvoker
|
|
5
4
|
from gllm_inference.schema import ModelId as ModelId, ModelProvider as ModelProvider
|
|
6
5
|
from typing import Any
|
|
@@ -75,7 +74,7 @@ class OpenAICompatibleEMInvoker(OpenAIEMInvoker):
|
|
|
75
74
|
```
|
|
76
75
|
'''
|
|
77
76
|
client: Incomplete
|
|
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 =
|
|
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 | None = None) -> None:
|
|
79
78
|
"""Initializes a new instance of the OpenAICompatibleEMInvoker class.
|
|
80
79
|
|
|
81
80
|
Args:
|
|
@@ -86,6 +85,6 @@ class OpenAICompatibleEMInvoker(OpenAIEMInvoker):
|
|
|
86
85
|
model_kwargs (dict[str, Any] | None, optional): Additional model parameters. Defaults to None.
|
|
87
86
|
default_hyperparameters (dict[str, Any] | None, optional): Default hyperparameters for invoking the model.
|
|
88
87
|
Defaults to None.
|
|
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.
|
|
88
|
+
retry_config (RetryConfig | None, optional): The retry configuration for the embedding model.
|
|
89
|
+
Defaults to None, in which case a default config with no retry and 30.0 seconds timeout will be used.
|
|
91
90
|
"""
|
|
@@ -1,6 +1,5 @@
|
|
|
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
|
|
4
3
|
from gllm_inference.em_invoker.em_invoker import BaseEMInvoker as BaseEMInvoker
|
|
5
4
|
from gllm_inference.schema import ModelId as ModelId, ModelProvider as ModelProvider, Vector as Vector
|
|
6
5
|
from typing import Any
|
|
@@ -69,7 +68,7 @@ class OpenAIEMInvoker(BaseEMInvoker):
|
|
|
69
68
|
```
|
|
70
69
|
'''
|
|
71
70
|
client: Incomplete
|
|
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 =
|
|
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 | None = None) -> None:
|
|
73
72
|
"""Initializes a new instance of the OpenAIEMInvoker class.
|
|
74
73
|
|
|
75
74
|
Args:
|
|
@@ -80,6 +79,6 @@ class OpenAIEMInvoker(BaseEMInvoker):
|
|
|
80
79
|
Defaults to None.
|
|
81
80
|
default_hyperparameters (dict[str, Any] | None, optional): Default hyperparameters for invoking the model.
|
|
82
81
|
Defaults to None.
|
|
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.
|
|
82
|
+
retry_config (RetryConfig | None, optional): The retry configuration for the embedding model.
|
|
83
|
+
Defaults to None, in which case a default config with no retry and 30.0 seconds timeout will be used.
|
|
85
84
|
"""
|
|
@@ -1,6 +1,5 @@
|
|
|
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
|
|
4
3
|
from gllm_inference.em_invoker.em_invoker import BaseEMInvoker as BaseEMInvoker
|
|
5
4
|
from gllm_inference.em_invoker.schema.twelvelabs import InputType as InputType, Key as Key, OutputType as OutputType
|
|
6
5
|
from gllm_inference.schema import Attachment as Attachment, AttachmentType as AttachmentType, EMContent as EMContent, ModelId as ModelId, ModelProvider as ModelProvider, Vector as Vector
|
|
@@ -83,7 +82,7 @@ class TwelveLabsEMInvoker(BaseEMInvoker):
|
|
|
83
82
|
```
|
|
84
83
|
'''
|
|
85
84
|
client: Incomplete
|
|
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 =
|
|
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 | None = None) -> None:
|
|
87
86
|
"""Initializes a new instance of the TwelveLabsEMInvoker class.
|
|
88
87
|
|
|
89
88
|
Args:
|
|
@@ -94,6 +93,6 @@ class TwelveLabsEMInvoker(BaseEMInvoker):
|
|
|
94
93
|
Defaults to None.
|
|
95
94
|
default_hyperparameters (dict[str, Any] | None, optional): Default hyperparameters for invoking the model.
|
|
96
95
|
Defaults to None.
|
|
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.
|
|
96
|
+
retry_config (RetryConfig | None, optional): The retry configuration for the embedding model.
|
|
97
|
+
Defaults to None, in which case a default config with no retry and 30.0 seconds timeout will be used.
|
|
99
98
|
"""
|
|
@@ -1,6 +1,5 @@
|
|
|
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
|
|
4
3
|
from gllm_inference.em_invoker.em_invoker import BaseEMInvoker as BaseEMInvoker
|
|
5
4
|
from gllm_inference.em_invoker.schema.voyage import InputType as InputType, Key as Key
|
|
6
5
|
from gllm_inference.schema import Attachment as Attachment, AttachmentType as AttachmentType, EMContent as EMContent, ModelId as ModelId, ModelProvider as ModelProvider, Vector as Vector
|
|
@@ -85,7 +84,7 @@ class VoyageEMInvoker(BaseEMInvoker):
|
|
|
85
84
|
```
|
|
86
85
|
'''
|
|
87
86
|
client: Incomplete
|
|
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 =
|
|
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 | None = None) -> None:
|
|
89
88
|
"""Initializes a new instance of the VoyageEMInvoker class.
|
|
90
89
|
|
|
91
90
|
Args:
|
|
@@ -96,6 +95,6 @@ class VoyageEMInvoker(BaseEMInvoker):
|
|
|
96
95
|
Defaults to None.
|
|
97
96
|
default_hyperparameters (dict[str, Any] | None, optional): Default hyperparameters for invoking the model.
|
|
98
97
|
Defaults to None.
|
|
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.
|
|
98
|
+
retry_config (RetryConfig | None, optional): The retry configuration for the embedding model.
|
|
99
|
+
Defaults to None, in which case a default config with no retry and 30.0 seconds timeout will be used.
|
|
101
100
|
"""
|
|
@@ -1,7 +1,6 @@
|
|
|
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
|
|
5
4
|
from gllm_inference.lm_invoker.lm_invoker import BaseLMInvoker as BaseLMInvoker
|
|
6
5
|
from gllm_inference.lm_invoker.schema.anthropic import InputType as InputType, Key as Key, OutputType as OutputType
|
|
7
6
|
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
|
|
@@ -222,7 +221,7 @@ class AnthropicLMInvoker(BaseLMInvoker):
|
|
|
222
221
|
client: Incomplete
|
|
223
222
|
thinking: Incomplete
|
|
224
223
|
thinking_budget: Incomplete
|
|
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 =
|
|
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 | None = None, thinking: bool = False, thinking_budget: int = ...) -> None:
|
|
226
225
|
"""Initializes the AnthropicLmInvoker instance.
|
|
227
226
|
|
|
228
227
|
Args:
|
|
@@ -237,8 +236,8 @@ class AnthropicLMInvoker(BaseLMInvoker):
|
|
|
237
236
|
output a structured response as defined by the schema. Supports both Pydantic BaseModel and JSON schema
|
|
238
237
|
dictionary. Defaults to None.
|
|
239
238
|
output_analytics (bool, optional): Whether to output the invocation analytics. Defaults to False.
|
|
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.
|
|
239
|
+
retry_config (RetryConfig | None, optional): The retry configuration for the language model.
|
|
240
|
+
Defaults to None, in which case a default config with no retry and 30.0 seconds timeout will be used.
|
|
242
241
|
thinking (bool, optional): Whether to enable thinking. Only allowed for thinking models. Defaults to False.
|
|
243
242
|
thinking_budget (int, optional): The tokens allocated for the thinking process. Must be greater than or
|
|
244
243
|
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
|
|
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 | None = None, 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, optional): The retry configuration for the language model.
|
|
241
|
-
Defaults to a default config with no retry and 30.0 seconds timeout.
|
|
240
|
+
retry_config (RetryConfig | None, optional): The retry configuration for the language model.
|
|
241
|
+
Defaults to None, in which case a default config with no retry and 30.0 seconds timeout will be used.
|
|
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,7 +1,6 @@
|
|
|
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
|
|
5
4
|
from gllm_inference.lm_invoker.lm_invoker import BaseLMInvoker as BaseLMInvoker
|
|
6
5
|
from gllm_inference.lm_invoker.schema.bedrock import InputType as InputType, Key as Key, OutputType as OutputType
|
|
7
6
|
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
|
|
@@ -180,7 +179,7 @@ class BedrockLMInvoker(BaseLMInvoker):
|
|
|
180
179
|
'''
|
|
181
180
|
session: Incomplete
|
|
182
181
|
client_kwargs: Incomplete
|
|
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 =
|
|
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 | None = None) -> None:
|
|
184
183
|
'''Initializes the BedrockLMInvoker instance.
|
|
185
184
|
|
|
186
185
|
Args:
|
|
@@ -198,8 +197,8 @@ class BedrockLMInvoker(BaseLMInvoker):
|
|
|
198
197
|
output a structured response as defined by the schema. Supports both Pydantic BaseModel and JSON schema
|
|
199
198
|
dictionary. Defaults to None.
|
|
200
199
|
output_analytics (bool, optional): Whether to output the invocation analytics. Defaults to False.
|
|
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.
|
|
200
|
+
retry_config (RetryConfig | None, optional): The retry configuration for the language model.
|
|
201
|
+
Defaults to None, in which case a default config with no retry and 30.0 seconds timeout will be used.
|
|
203
202
|
|
|
204
203
|
Raises:
|
|
205
204
|
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
|
|
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 | None = None, 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, optional): The retry configuration for the language model.
|
|
136
|
-
Defaults to a default config with no retry and 30.0 seconds timeout.
|
|
135
|
+
retry_config (RetryConfig | None, optional): The retry configuration for the language model.
|
|
136
|
+
Defaults to None, in which case a default config with no retry and 30.0 seconds timeout will be used.
|
|
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
|
|
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 | None = None, 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, optional): The retry configuration for the language model.
|
|
277
|
-
Defaults to a default config with no retry and 30.0 seconds timeout.
|
|
276
|
+
retry_config (RetryConfig | None, optional): The retry configuration for the language model.
|
|
277
|
+
Defaults to None, in which case a default config with no retry and 30.0 seconds timeout will be used.
|
|
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,7 +1,6 @@
|
|
|
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
|
|
5
4
|
from gllm_inference.lm_invoker.lm_invoker import BaseLMInvoker as BaseLMInvoker
|
|
6
5
|
from gllm_inference.lm_invoker.schema.langchain import InputType as InputType, Key as Key
|
|
7
6
|
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
|
|
@@ -204,7 +203,7 @@ class LangChainLMInvoker(BaseLMInvoker):
|
|
|
204
203
|
Defaults to an empty list.
|
|
205
204
|
'''
|
|
206
205
|
model: Incomplete
|
|
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 =
|
|
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 | None = None) -> None:
|
|
208
207
|
'''Initializes a new instance of the LangChainLMInvoker class.
|
|
209
208
|
|
|
210
209
|
Args:
|
|
@@ -224,8 +223,8 @@ class LangChainLMInvoker(BaseLMInvoker):
|
|
|
224
223
|
output a structured response as defined by the schema. Supports both Pydantic BaseModel and JSON schema
|
|
225
224
|
dictionary. Defaults to None.
|
|
226
225
|
output_analytics (bool, optional): Whether to output the invocation analytics. Defaults to False.
|
|
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.
|
|
226
|
+
retry_config (RetryConfig | None, optional): The retry configuration for the language model.
|
|
227
|
+
Defaults to None, in which case a default config with no retry and 30.0 seconds timeout will be used.
|
|
229
228
|
|
|
230
229
|
Raises:
|
|
231
230
|
ValueError: If `response_schema` is provided, but `tools` are also provided.
|
|
@@ -1,7 +1,6 @@
|
|
|
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
|
|
5
4
|
from gllm_inference.lm_invoker.openai_compatible_lm_invoker import OpenAICompatibleLMInvoker as OpenAICompatibleLMInvoker
|
|
6
5
|
from gllm_inference.lm_invoker.openai_lm_invoker import ReasoningEffort as ReasoningEffort
|
|
7
6
|
from gllm_inference.schema import AttachmentType as AttachmentType, LMOutput as LMOutput, ModelId as ModelId, ModelProvider as ModelProvider, ResponseSchema as ResponseSchema
|
|
@@ -228,7 +227,7 @@ class LiteLLMLMInvoker(OpenAICompatibleLMInvoker):
|
|
|
228
227
|
Defaults to an empty list.
|
|
229
228
|
'''
|
|
230
229
|
completion: Incomplete
|
|
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 =
|
|
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 | None = None, reasoning_effort: ReasoningEffort | None = None) -> None:
|
|
232
231
|
"""Initializes a new instance of the LiteLLMLMInvoker class.
|
|
233
232
|
|
|
234
233
|
Args:
|
|
@@ -240,8 +239,8 @@ class LiteLLMLMInvoker(OpenAICompatibleLMInvoker):
|
|
|
240
239
|
output a structured response as defined by the schema. Supports both Pydantic BaseModel and JSON schema
|
|
241
240
|
dictionary. Defaults to None.
|
|
242
241
|
output_analytics (bool, optional): Whether to output the invocation analytics. Defaults to False.
|
|
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.
|
|
242
|
+
retry_config (RetryConfig | None, optional): The retry configuration for the language model.
|
|
243
|
+
Defaults to None, in which case a default config with no retry and 30.0 seconds timeout will be used.
|
|
245
244
|
reasoning_effort (ReasoningEffort | None, optional): The reasoning effort for reasoning models.
|
|
246
245
|
Defaults to None.
|
|
247
246
|
"""
|
|
@@ -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_TIMEOUT as INVOKER_DEFAULT_TIMEOUT
|
|
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 = None) -> 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, optional): The retry configuration for the language model.
|
|
65
|
-
Defaults to a default config with no retry and 30.0 seconds timeout.
|
|
64
|
+
retry_config (RetryConfig | None, optional): The retry configuration for the language model.
|
|
65
|
+
Defaults to None, in which case a default config with no retry and 30.0 seconds timeout will be used.
|
|
66
66
|
"""
|
|
67
67
|
@property
|
|
68
68
|
def model_id(self) -> str:
|
|
@@ -1,7 +1,6 @@
|
|
|
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
|
|
5
4
|
from gllm_inference.lm_invoker.lm_invoker import BaseLMInvoker as BaseLMInvoker
|
|
6
5
|
from gllm_inference.lm_invoker.schema.openai_compatible import InputType as InputType, Key as Key, ReasoningEffort as ReasoningEffort
|
|
7
6
|
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
|
|
@@ -231,7 +230,7 @@ class OpenAICompatibleLMInvoker(BaseLMInvoker):
|
|
|
231
230
|
Defaults to an empty list.
|
|
232
231
|
'''
|
|
233
232
|
client: Incomplete
|
|
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 =
|
|
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 | None = None, reasoning_effort: ReasoningEffort | None = None) -> None:
|
|
235
234
|
'''Initializes a new instance of the OpenAICompatibleLMInvoker class.
|
|
236
235
|
|
|
237
236
|
Args:
|
|
@@ -249,8 +248,8 @@ class OpenAICompatibleLMInvoker(BaseLMInvoker):
|
|
|
249
248
|
output a structured response as defined by the schema. Supports both Pydantic BaseModel and JSON schema
|
|
250
249
|
dictionary. Defaults to None.
|
|
251
250
|
output_analytics (bool, optional): Whether to output the invocation analytics. Defaults to False.
|
|
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.
|
|
251
|
+
retry_config (RetryConfig | None, optional): The retry configuration for the language model.
|
|
252
|
+
Defaults to None, in which case a default config with no retry and 30.0 seconds timeout will be used.
|
|
254
253
|
reasoning_effort (str | None, optional): The reasoning effort for the language model. Defaults to None.
|
|
255
254
|
'''
|
|
256
255
|
def set_response_schema(self, response_schema: ResponseSchema | None) -> None:
|
|
@@ -1,7 +1,6 @@
|
|
|
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
|
|
5
4
|
from gllm_inference.lm_invoker.lm_invoker import BaseLMInvoker as BaseLMInvoker
|
|
6
5
|
from gllm_inference.lm_invoker.schema.openai import InputType as InputType, Key as Key, OutputType as OutputType, ReasoningEffort as ReasoningEffort, ReasoningSummary as ReasoningSummary
|
|
7
6
|
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
|
|
@@ -319,7 +318,7 @@ class OpenAILMInvoker(BaseLMInvoker):
|
|
|
319
318
|
enabled and the language model decides to execute any codes. Defaults to an empty list.
|
|
320
319
|
'''
|
|
321
320
|
client: Incomplete
|
|
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 =
|
|
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 | None = None, reasoning_effort: ReasoningEffort | None = None, reasoning_summary: ReasoningSummary | None = None, code_interpreter: bool = False, web_search: bool = False) -> None:
|
|
323
322
|
"""Initializes a new instance of the OpenAILMInvoker class.
|
|
324
323
|
|
|
325
324
|
Args:
|
|
@@ -335,8 +334,8 @@ class OpenAILMInvoker(BaseLMInvoker):
|
|
|
335
334
|
output a structured response as defined by the schema. Supports both Pydantic BaseModel and JSON schema
|
|
336
335
|
dictionary. Defaults to None.
|
|
337
336
|
output_analytics (bool, optional): Whether to output the invocation analytics. Defaults to False.
|
|
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.
|
|
337
|
+
retry_config (RetryConfig | None, optional): The retry configuration for the language model.
|
|
338
|
+
Defaults to None, in which case a default config with no retry and 30.0 seconds timeout will be used.
|
|
340
339
|
reasoning_effort (ReasoningEffort | None, optional): The reasoning effort for reasoning models. Not allowed
|
|
341
340
|
for non-reasoning models. If None, the model will perform medium reasoning effort. Defaults to None.
|
|
342
341
|
reasoning_summary (ReasoningSummary | None, optional): The reasoning summary level for reasoning models.
|
|
@@ -32,6 +32,18 @@ class Attachment(BaseModel):
|
|
|
32
32
|
Attachment: The instantiated Attachment.
|
|
33
33
|
"""
|
|
34
34
|
@classmethod
|
|
35
|
+
def from_base64(cls, base64_data: str, filename: str | None = None) -> Attachment:
|
|
36
|
+
"""Creates an Attachment from a base64 string.
|
|
37
|
+
|
|
38
|
+
Args:
|
|
39
|
+
base64_data (str): The base64 string of the file.
|
|
40
|
+
filename (str | None, optional): The filename of the file. Defaults to None,
|
|
41
|
+
in which case the filename will be derived from the mime type.
|
|
42
|
+
|
|
43
|
+
Returns:
|
|
44
|
+
Attachment: The instantiated Attachment.
|
|
45
|
+
"""
|
|
46
|
+
@classmethod
|
|
35
47
|
def from_data_url(cls, data_url: str, filename: str | None = None) -> Attachment:
|
|
36
48
|
"""Creates an Attachment from a data URL (data:[mime/type];base64,[bytes]).
|
|
37
49
|
|
|
Binary file
|
|
@@ -8,35 +8,35 @@ gllm_inference/catalog/__init__.pyi,sha256=JBkPGTyiiZ30GECzJBW-mW8LekWyY2qyzal3e
|
|
|
8
8
|
gllm_inference/catalog/catalog.pyi,sha256=a4RNG1lKv51GxQpOqh47tz-PAROMPaeP2o5XNLBSZaU,4790
|
|
9
9
|
gllm_inference/catalog/lm_request_processor_catalog.pyi,sha256=wjzufPEqey-byBU3hPWwEawT9c182WwjzSWOJ2bnqIs,4599
|
|
10
10
|
gllm_inference/catalog/prompt_builder_catalog.pyi,sha256=o4JSzISjlStBataofZ2MB2_t3wnGTkkFJ3Dm_NSm5qo,3159
|
|
11
|
-
gllm_inference/constants.pyi,sha256=
|
|
11
|
+
gllm_inference/constants.pyi,sha256=A16iMdS6QLnDx7ToiVuu1rSxvEwcr0OMrghPUGQL0L4,220
|
|
12
12
|
gllm_inference/em_invoker/__init__.pyi,sha256=XESsrYo1PZeeHe7AMRyuzKoV7XDD5oN89ZTH01zRf4k,873
|
|
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=1HgCMcw7Hqv2ah4v9ma1Ioa-PpI-v2g7MfuKxxk2ZPU,4473
|
|
14
|
+
gllm_inference/em_invoker/em_invoker.pyi,sha256=hiH8FB5R-KxhI8Ds2htF3cjRcIcH92yHPcOdpgc4FDo,4341
|
|
15
|
+
gllm_inference/em_invoker/google_em_invoker.pyi,sha256=LQDUdsnOrB6ihBh0VdoOZHzFrY5dE3wWgBsl_slr1SI,6067
|
|
16
16
|
gllm_inference/em_invoker/langchain/__init__.pyi,sha256=VYGKE5OgU0my1RlhgzkU_A7-GLGnUDDnNFuctuRwILE,148
|
|
17
17
|
gllm_inference/em_invoker/langchain/em_invoker_embeddings.pyi,sha256=6nASLqi0FXCpqyYPl7kM3g7hAW-xS5ZwsS3GFudns98,2347
|
|
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=HSusS_ef5VZ20HPBFe153olueYOGQ57hmKY4406LUcE,2577
|
|
19
|
+
gllm_inference/em_invoker/openai_compatible_em_invoker.pyi,sha256=GkoL-Z_Rl5v_NwcbvhUE6quLr6F9KnUB6Sb9Q712hNM,4802
|
|
20
|
+
gllm_inference/em_invoker/openai_em_invoker.pyi,sha256=Gdyh93f8Mi3JYqnV1sBnYk1LAZpcsP47JeLjWxqyins,4070
|
|
21
21
|
gllm_inference/em_invoker/schema/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
22
22
|
gllm_inference/em_invoker/schema/twelvelabs.pyi,sha256=y9nfqvuzs0o1jlZ5bwNmJkMSmvHAwBElWNMU0wJNc64,334
|
|
23
23
|
gllm_inference/em_invoker/schema/voyage.pyi,sha256=7d9hv8uCJ4NboRaqK77g5ekb0X78pPW__sz2EYeKJKw,219
|
|
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=9QctCbM6c9q5eHKIYEwVlhDmzcCysQupiT-4e8hllPE,4964
|
|
25
|
+
gllm_inference/em_invoker/voyage_em_invoker.pyi,sha256=17NBfuii3FyBbNtNRT2y6FUMTMsDemanXnY1j_0dmZg,5032
|
|
26
26
|
gllm_inference/exceptions/__init__.pyi,sha256=v9uxjW5DssIn7n_bKqT7L83CeqFET2Z45GFOvi78UuE,977
|
|
27
27
|
gllm_inference/exceptions/error_parser.pyi,sha256=4RkVfS2Fl9kjz_h2bK9eoAeI-Y-VkHcUqXWj68BsYig,2393
|
|
28
28
|
gllm_inference/exceptions/exceptions.pyi,sha256=5YRackwVNvyOJjOtiVszqu8q87s8ioXTa-XwaYmeiC4,4643
|
|
29
29
|
gllm_inference/lm_invoker/__init__.pyi,sha256=8oUFgavpItvjRUqsLqLSHqQVIPyTKCgNQ_euf58H2zY,1104
|
|
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=Ihq8U4w_efN74gf-nDFUY_zXO4Hf4KYZ2YhWcu9MqNA,14663
|
|
31
|
+
gllm_inference/lm_invoker/azure_openai_lm_invoker.pyi,sha256=98ecMvAsEKEYNS1HehL3xTKT3MLdI9AfmJVOi9jeHXM,14407
|
|
32
|
+
gllm_inference/lm_invoker/bedrock_lm_invoker.pyi,sha256=0ZeBJ_PWuFY2dOlON11VsI4BENhFJhK4md-8DwNpcyU,12300
|
|
33
|
+
gllm_inference/lm_invoker/datasaur_lm_invoker.pyi,sha256=EzovSc7FXXZLoRrOuA2rFHmBAcBEohoBaUkAFk7hQig,9049
|
|
34
|
+
gllm_inference/lm_invoker/google_lm_invoker.pyi,sha256=dRK3_--UQEBEMkLItav9MeTXp5p-iM-pqzt2JnwocPU,16393
|
|
35
|
+
gllm_inference/lm_invoker/langchain_lm_invoker.pyi,sha256=2p-JM7XojIi20wxKvu1n6eJWVeQz6P069M3Quoe5ViE,13018
|
|
36
|
+
gllm_inference/lm_invoker/litellm_lm_invoker.pyi,sha256=ad_tVyOjATiFyYF-f_1vX2Sl4BXy-fDXEW_D8fD1Db8,13037
|
|
37
|
+
gllm_inference/lm_invoker/lm_invoker.pyi,sha256=XvcR2AAH_vnIdZ3cgDer59ZT724mW22_OSF8mpeo_kk,7610
|
|
38
|
+
gllm_inference/lm_invoker/openai_compatible_lm_invoker.pyi,sha256=gHYFz7S8kTq1qkh-kqXOxkBAydUWxXJyoyNkL90Kvig,14759
|
|
39
|
+
gllm_inference/lm_invoker/openai_lm_invoker.pyi,sha256=EsWW-XPmpmQ_27jFezJgT5lbpQf1Hj4O6MCvN63M3v0,19325
|
|
40
40
|
gllm_inference/lm_invoker/schema/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
41
41
|
gllm_inference/lm_invoker/schema/anthropic.pyi,sha256=Y7NAjB7H0Wmiwv3YGZuG83K1rOCjSDB6hoZ6LjndWss,971
|
|
42
42
|
gllm_inference/lm_invoker/schema/bedrock.pyi,sha256=FOUMZkBi6KRa__mYoy3FNJ5sP0EC6rgLuhoijnwelIg,927
|
|
@@ -71,7 +71,7 @@ gllm_inference/request_processor/__init__.pyi,sha256=hVnfdNZnkTBJHnmLtN3Na4ANP0y
|
|
|
71
71
|
gllm_inference/request_processor/lm_request_processor.pyi,sha256=7pVNb2GwITb1jTflZP498qZ321G15b16jayZuuhuO1o,5424
|
|
72
72
|
gllm_inference/request_processor/uses_lm_mixin.pyi,sha256=He-ytjwv2H5Hn312WFBAlBK96ALKTtDO3AT_80hCGTg,2321
|
|
73
73
|
gllm_inference/schema/__init__.pyi,sha256=bJeO_4fCFPmYrVZ-4RQw0eQn62X228pB0w2tYDM-oek,1238
|
|
74
|
-
gllm_inference/schema/attachment.pyi,sha256=
|
|
74
|
+
gllm_inference/schema/attachment.pyi,sha256=jApuzjOHJDCz4lr4MlHzBgIndh559nbWu2Xp1fk3hso,3297
|
|
75
75
|
gllm_inference/schema/code_exec_result.pyi,sha256=ZTHh6JtRrPIdQ059P1UAiD2L-tAO1_S5YcMsAXfJ5A0,559
|
|
76
76
|
gllm_inference/schema/enums.pyi,sha256=Nvc_Qsd8yyiH_tCtymN39O6EZ0DT_wxYHmlKLllxC00,605
|
|
77
77
|
gllm_inference/schema/lm_output.pyi,sha256=GafJV0KeD-VSwWkwG1oz-uruXrQ7KDZTuoojPCBRpg8,1956
|
|
@@ -86,8 +86,8 @@ gllm_inference/utils/__init__.pyi,sha256=npmBmmlBv7cPHMg1hdL3S2_RelD6vk_LhCsGELh
|
|
|
86
86
|
gllm_inference/utils/langchain.pyi,sha256=VluQiHkGigDdqLUbhB6vnXiISCP5hHqV0qokYY6dC1A,1164
|
|
87
87
|
gllm_inference/utils/validation.pyi,sha256=toxBtRp-VItC_X7sNi-GDd7sjibBdWMrR0q01OI2D7k,385
|
|
88
88
|
gllm_inference.build/.gitignore,sha256=aEiIwOuxfzdCmLZe4oB1JsBmCUxwG8x-u-HBCV9JT8E,1
|
|
89
|
-
gllm_inference.cpython-313-darwin.so,sha256=
|
|
89
|
+
gllm_inference.cpython-313-darwin.so,sha256=CU5l3wmqrwrKCtgPQEJwBVcu_QpFBKU3sk8Na7gfsMU,3672136
|
|
90
90
|
gllm_inference.pyi,sha256=xOoh8lTQxXc6A4XYKBobWn8RJNszAlinAmbHPJyqi30,3315
|
|
91
|
-
gllm_inference_binary-0.5.
|
|
92
|
-
gllm_inference_binary-0.5.
|
|
93
|
-
gllm_inference_binary-0.5.
|
|
91
|
+
gllm_inference_binary-0.5.4.dist-info/METADATA,sha256=pDdTHJqMvgTxEDuOVk85fsZsvKVBbUaLd-QB7J-jRVM,4531
|
|
92
|
+
gllm_inference_binary-0.5.4.dist-info/WHEEL,sha256=PCOZcL_jcbAVhuFR5ylE4Mr-7HPGHAcfJk9OpuMh7RQ,107
|
|
93
|
+
gllm_inference_binary-0.5.4.dist-info/RECORD,,
|
|
File without changes
|