gllm-inference-binary 0.5.34__cp311-cp311-win_amd64.whl → 0.5.35__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.

@@ -24,11 +24,8 @@ def build_em_invoker(model_id: str | ModelId, credentials: str | dict[str, Any]
24
24
  '''Build an embedding model invoker based on the provided configurations.
25
25
 
26
26
  Args:
27
- model_id (str | ModelId): The model id, can either be a ModelId instance or a string in the following format:
28
- 1. For `azure-openai` provider: `azure-openai/azure-endpoint:azure-deployment`.
29
- 2. For `openai-compatible` provider: `openai-compatible/base-url:model-name`.
30
- 3. For `langchain` provider: `langchain/<package>.<class>:model-name`.
31
- 4. For other providers: `provider/model-name`.
27
+ model_id (str | ModelId): The model id, can either be a ModelId instance or a string in a format defined
28
+ in the following page: https://gdplabs.gitbook.io/sdk/resources/supported-models#embedding-models-ems
32
29
  credentials (str | dict[str, Any] | None, optional): The credentials for the language model. Can either be:
33
30
  1. An API key.
34
31
  2. A path to a credentials JSON file, currently only supported for Google Vertex AI.
@@ -83,23 +80,23 @@ def build_em_invoker(model_id: str | ModelId, credentials: str | dict[str, Any]
83
80
  ```
84
81
  The credentials can also be provided through the `OPENAI_API_KEY` environment variable.
85
82
 
86
- # Using Azure OpenAI
83
+ # Using OpenAI Embeddings API-compatible endpoints (e.g. vLLM)
87
84
  ```python
88
85
  em_invoker = build_em_invoker(
89
- model_id="azure-openai/https://my-resource.openai.azure.com/openai/v1:my-deployment",
90
- credentials="azure-api-key"
86
+ model_id="openai/https://my-vllm-url:8000/v1:my-model-name",
87
+ credentials="sk-..."
91
88
  )
92
89
  ```
93
- The credentials can also be provided through the `AZURE_OPENAI_API_KEY` environment variable.
90
+ The credentials can also be provided through the `OPENAI_API_KEY` environment variable.
94
91
 
95
- # Using OpenAI Compatible endpoint (e.g. Text Embeddings Inference)
92
+ # Using Azure OpenAI
96
93
  ```python
97
94
  em_invoker = build_em_invoker(
98
- model_id="openai-compatible/https://my-text-embeddings-inference-endpoint.com:model-name",
99
- credentials="tei-api-key"
95
+ model_id="azure-openai/https://my-resource.openai.azure.com/openai/v1:my-deployment",
96
+ credentials="azure-api-key"
100
97
  )
101
98
  ```
102
- The credentials can also be provided through the `OPENAI_API_KEY` environment variable.
99
+ The credentials can also be provided through the `AZURE_OPENAI_API_KEY` environment variable.
103
100
 
104
101
  # Using TwelveLabs
105
102
  ```python
@@ -1,5 +1,5 @@
1
1
  from _typeshed import Incomplete
2
- from gllm_inference.lm_invoker import AnthropicLMInvoker as AnthropicLMInvoker, AzureOpenAILMInvoker as AzureOpenAILMInvoker, BedrockLMInvoker as BedrockLMInvoker, DatasaurLMInvoker as DatasaurLMInvoker, GoogleLMInvoker as GoogleLMInvoker, LangChainLMInvoker as LangChainLMInvoker, LiteLLMLMInvoker as LiteLLMLMInvoker, OpenAICompatibleLMInvoker as OpenAICompatibleLMInvoker, OpenAILMInvoker as OpenAILMInvoker, XAILMInvoker as XAILMInvoker
2
+ from gllm_inference.lm_invoker import AnthropicLMInvoker as AnthropicLMInvoker, AzureOpenAILMInvoker as AzureOpenAILMInvoker, BedrockLMInvoker as BedrockLMInvoker, DatasaurLMInvoker as DatasaurLMInvoker, GoogleLMInvoker as GoogleLMInvoker, LangChainLMInvoker as LangChainLMInvoker, LiteLLMLMInvoker as LiteLLMLMInvoker, OpenAIChatCompletionsLMInvoker as OpenAIChatCompletionsLMInvoker, OpenAICompatibleLMInvoker as OpenAICompatibleLMInvoker, OpenAILMInvoker as OpenAILMInvoker, XAILMInvoker as XAILMInvoker
3
3
  from gllm_inference.lm_invoker.lm_invoker import BaseLMInvoker as BaseLMInvoker
4
4
  from gllm_inference.schema.model_id import ModelId as ModelId, ModelProvider as ModelProvider
5
5
  from typing import Any
@@ -25,13 +25,8 @@ def build_lm_invoker(model_id: str | ModelId, credentials: str | dict[str, Any]
25
25
  '''Build a language model invoker based on the provided configurations.
26
26
 
27
27
  Args:
28
- model_id (str | ModelId): The model id, can either be a ModelId instance or a string in the following format:
29
- 1. For `azure-openai` provider: `azure-openai/azure-endpoint:azure-deployment`.
30
- 2. For `openai-compatible` provider: `openai-compatible/base-url:model-name`.
31
- 3. For `langchain` provider: `langchain/<package>.<class>:model-name`.
32
- 4. For `litellm` provider: `litellm/provider/model-name`.
33
- 5. For `datasaur` provider: `datasaur/deployment-id:model-name`.
34
- 6. For other providers: `provider/model-name`.
28
+ model_id (str | ModelId): The model id, can either be a ModelId instance or a string in a format defined
29
+ in the following page: https://gdplabs.gitbook.io/sdk/resources/supported-models#language-models-lms
35
30
  credentials (str | dict[str, Any] | None, optional): The credentials for the language model. Can either be:
36
31
  1. An API key.
37
32
  2. A path to a credentials JSON file, currently only supported for Google Vertex AI.
@@ -80,7 +75,7 @@ def build_lm_invoker(model_id: str | ModelId, credentials: str | dict[str, Any]
80
75
  # Using Google Gen AI (via API key)
81
76
  ```python
82
77
  lm_invoker = build_lm_invoker(
83
- model_id="google/gemini-1.5-flash-latest",
78
+ model_id="google/gemini-2.5-flash-lite",
84
79
  credentials="AIzaSyD..."
85
80
  )
86
81
  ```
@@ -89,7 +84,7 @@ def build_lm_invoker(model_id: str | ModelId, credentials: str | dict[str, Any]
89
84
  # Using Google Vertex AI (via service account)
90
85
  ```python
91
86
  lm_invoker = build_lm_invoker(
92
- model_id="google/gemini-1.5-flash",
87
+ model_id="google/gemini-2.5-flash-lite",
93
88
  credentials="/path/to/google-credentials.json"
94
89
  )
95
90
  ```
@@ -98,30 +93,48 @@ def build_lm_invoker(model_id: str | ModelId, credentials: str | dict[str, Any]
98
93
  # Using OpenAI
99
94
  ```python
100
95
  lm_invoker = build_lm_invoker(
101
- model_id="openai/gpt-4o-mini",
96
+ model_id="openai/gpt-5-nano",
102
97
  credentials="sk-..."
103
98
  )
104
99
  ```
105
100
  The credentials can also be provided through the `OPENAI_API_KEY` environment variable.
106
101
 
107
- # Using Azure OpenAI
102
+ # Using OpenAI with Chat Completions API
108
103
  ```python
109
104
  lm_invoker = build_lm_invoker(
110
- model_id="azure-openai/https://my-resource.openai.azure.com/openai/v1:my-deployment",
111
- credentials="azure-api-key"
105
+ model_id="openai-chat-completions/gpt-5-nano",
106
+ credentials="sk-..."
112
107
  )
113
108
  ```
114
- The credentials can also be provided through the `AZURE_OPENAI_API_KEY` environment variable.
109
+ The credentials can also be provided through the `OPENAI_API_KEY` environment variable.
110
+
111
+ # Using OpenAI Responses API-compatible endpoints (e.g. SGLang)
112
+ ```python
113
+ lm_invoker = build_lm_invoker(
114
+ model_id="openai/https://my-sglang-url:8000/v1:my-model-name",
115
+ credentials="sk-..."
116
+ )
117
+ ```
118
+ The credentials can also be provided through the `OPENAI_API_KEY` environment variable.
115
119
 
116
- # Using OpenAI Compatible endpoint (e.g. Groq)
120
+ # Using OpenAI Chat Completions API-compatible endpoints (e.g. Groq)
117
121
  ```python
118
122
  lm_invoker = build_lm_invoker(
119
- model_id="openai-compatible/https://api.groq.com/openai/v1:llama3-8b-8192",
123
+ model_id="openai-chat-completions/https://api.groq.com/openai/v1:llama3-8b-8192",
120
124
  credentials="gsk_..."
121
125
  )
122
126
  ```
123
127
  The credentials can also be provided through the `OPENAI_API_KEY` environment variable.
124
128
 
129
+ # Using Azure OpenAI
130
+ ```python
131
+ lm_invoker = build_lm_invoker(
132
+ model_id="azure-openai/https://my-resource.openai.azure.com/openai/v1:my-deployment",
133
+ credentials="azure-api-key"
134
+ )
135
+ ```
136
+ The credentials can also be provided through the `AZURE_OPENAI_API_KEY` environment variable.
137
+
125
138
  # Using LangChain
126
139
  ```python
127
140
  lm_invoker = build_lm_invoker(
@@ -12,13 +12,8 @@ def build_lm_request_processor(model_id: str | ModelId, credentials: str | dict[
12
12
  '''Build a language model invoker based on the provided configurations.
13
13
 
14
14
  Args:
15
- model_id (str | ModelId): The model id, can either be a ModelId instance or a string in the following format:
16
- 1. For `azure-openai` provider: `azure-openai/azure-endpoint:azure-deployment`.
17
- 2. For `openai-compatible` provider: `openai-compatible/base-url:model-name`.
18
- 3. For `langchain` provider: `langchain/<package>.<class>:model-name`.
19
- 4. For `litellm` provider: `litellm/provider/model-name`.
20
- 5. For `datasaur` provider: `datasaur/base-url`.
21
- 6. For other providers: `provider/model-name`.
15
+ model_id (str | ModelId): The model id, can either be a ModelId instance or a string in a format defined
16
+ in the following page: https://gdplabs.gitbook.io/sdk/resources/supported-models#language-models-lms
22
17
  credentials (str | dict[str, Any] | None, optional): The credentials for the language model. Can either be:
23
18
  1. An API key.
24
19
  2. A path to a credentials JSON file, currently only supported for Google Vertex AI.
@@ -57,7 +57,7 @@ class LMRequestProcessorCatalog(BaseCatalog[LMRequestProcessor]):
57
57
  ),
58
58
  "user_template": "{query}",
59
59
  "key_defaults": \'{"context": "<default context>"}\',
60
- "model_id": "openai/gpt-4.1-nano",
60
+ "model_id": "openai/gpt-5-nano",
61
61
  "credentials": "OPENAI_API_KEY",
62
62
  "config": "",
63
63
  "output_parser_type": "none",
@@ -93,7 +93,7 @@ class LMRequestProcessorCatalog(BaseCatalog[LMRequestProcessor]):
93
93
  prompt template keys. These default values will be applied when the corresponding keys are not provided
94
94
  in the runtime input. If it is empty, the prompt template keys will not have default values.
95
95
  3. The `model_id`:
96
- 3.1. Must be filled with the model ID of the LM invoker, e.g. "openai/gpt-4.1-nano".
96
+ 3.1. Must be filled with the model ID of the LM invoker, e.g. "openai/gpt-5-nano".
97
97
  3.2. Can be partially loaded from the environment variable using the "${ENV_VAR_KEY}" syntax,
98
98
  e.g. "azure-openai/${AZURE_ENDPOINT}/${AZURE_DEPLOYMENT}".
99
99
  3.3. For the available model ID formats, see: https://gdplabs.gitbook.io/sdk/resources/supported-models
@@ -7,4 +7,5 @@ GRPC_ENABLE_RETRIES_KEY: str
7
7
  INVOKER_PROPAGATED_MAX_RETRIES: int
8
8
  INVOKER_DEFAULT_TIMEOUT: float
9
9
  HEX_REPR_LENGTH: int
10
+ OPENAI_DEFAULT_URL: str
10
11
  SECONDS_TO_MILLISECONDS: int
@@ -6,8 +6,10 @@ from gllm_inference.em_invoker.schema.openai_compatible import Key as Key
6
6
  from gllm_inference.schema import ModelId as ModelId, ModelProvider as ModelProvider, TruncationConfig as TruncationConfig
7
7
  from typing import Any
8
8
 
9
+ DEPRECATION_MESSAGE: str
10
+
9
11
  class OpenAICompatibleEMInvoker(OpenAIEMInvoker):
10
- '''An embedding model invoker to interact with endpoints compatible with OpenAI\'s embedding API contract.
12
+ """An embedding model invoker to interact with endpoints compatible with OpenAI's embedding API contract.
11
13
 
12
14
  Attributes:
13
15
  model_id (str): The model ID of the embedding model.
@@ -18,65 +20,8 @@ class OpenAICompatibleEMInvoker(OpenAIEMInvoker):
18
20
  retry_config (RetryConfig): The retry configuration for the embedding model.
19
21
  truncation_config (TruncationConfig | None): The truncation configuration for the embedding model.
20
22
 
21
-
22
- When to use:
23
- The `OpenAICompatibleEMInvoker` is designed to interact with endpoints that are compatible with OpenAI\'s
24
- embedding API contract. This includes but are not limited to:
25
- 1. Text Embeddings Inference (https://github.com/huggingface/text-embeddings-inference)
26
- 2. vLLM (https://vllm.ai/)
27
- When using this invoker, please note that the supported features and capabilities may vary between different
28
- endpoints and language models. Using features that are not supported by the endpoint will result in an error.
29
-
30
- Input types:
31
- The `OpenAICompatibleEMInvoker` only supports text inputs.
32
-
33
- Output format:
34
- The `OpenAICompatibleEMInvoker` can embed either:
35
- 1. A single content.
36
- 1. A single content is a single text.
37
- 2. The output will be a `Vector`, representing the embedding of the content.
38
-
39
- # Example 1: Embedding a text content.
40
- ```python
41
- text = "This is a text"
42
- result = await em_invoker.invoke(text)
43
- ```
44
-
45
- The above examples will return a `Vector` with a size of (embedding_size,).
46
-
47
- 2. A list of contents.
48
- 1. A list of contents is a list of texts.
49
- 2. The output will be a `list[Vector]`, where each element is a `Vector` representing the
50
- embedding of each single content.
51
-
52
- # Example: Embedding a list of contents.
53
- ```python
54
- text1 = "This is a text"
55
- text2 = "This is another text"
56
- text3 = "This is yet another text"
57
- result = await em_invoker.invoke([text1, text2, text3])
58
- ```
59
-
60
- The above examples will return a `list[Vector]` with a size of (3, embedding_size).
61
-
62
- Retry and timeout:
63
- The `OpenAICompatibleEMInvoker` supports retry and timeout configuration.
64
- By default, the max retries is set to 0 and the timeout is set to 30.0 seconds.
65
- They can be customized by providing a custom `RetryConfig` object to the `retry_config` parameter.
66
-
67
- Retry config examples:
68
- ```python
69
- retry_config = RetryConfig(max_retries=0, timeout=0.0) # No retry, no timeout
70
- retry_config = RetryConfig(max_retries=0, timeout=10.0) # No retry, 10.0 seconds timeout
71
- retry_config = RetryConfig(max_retries=5, timeout=0.0) # 5 max retries, no timeout
72
- retry_config = RetryConfig(max_retries=5, timeout=10.0) # 5 max retries, 10.0 seconds timeout
73
- ```
74
-
75
- Usage example:
76
- ```python
77
- em_invoker = OpenAICompatibleEMInvoker(..., retry_config=retry_config)
78
- ```
79
- '''
23
+ This class is deprecated and will be removed in v0.6. Please use the `OpenAIEMInvoker` class instead.
24
+ """
80
25
  client: Incomplete
81
26
  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, truncation_config: TruncationConfig | None = None) -> None:
82
27
  """Initializes a new instance of the OpenAICompatibleEMInvoker class.
@@ -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 INVOKER_PROPAGATED_MAX_RETRIES as INVOKER_PROPAGATED_MAX_RETRIES
3
+ from gllm_inference.constants import INVOKER_PROPAGATED_MAX_RETRIES as INVOKER_PROPAGATED_MAX_RETRIES, OPENAI_DEFAULT_URL as OPENAI_DEFAULT_URL
4
4
  from gllm_inference.em_invoker.em_invoker import BaseEMInvoker as BaseEMInvoker
5
5
  from gllm_inference.em_invoker.schema.openai import Key as Key
6
6
  from gllm_inference.schema import ModelId as ModelId, ModelProvider as ModelProvider, Vector as Vector
@@ -21,6 +21,31 @@ class OpenAIEMInvoker(BaseEMInvoker):
21
21
  retry_config (RetryConfig): The retry configuration for the embedding model.
22
22
  truncation_config (TruncationConfig | None): The truncation configuration for the embedding model.
23
23
 
24
+ Basic usage:
25
+ The `OpenAIEMInvoker` can be used as follows:
26
+ ```python
27
+ em_invoker = OpenAIEMInvoker(model_name="text-embedding-3-small")
28
+ result = await em_invoker.invoke("Hi there!")
29
+ ```
30
+
31
+ OpenAI compatible endpoints:
32
+ The `OpenAIEMInvoker` can also be used to interact with endpoints that are compatible with
33
+ OpenAI\'s Embeddings API schema. This includes but are not limited to:
34
+ 1. Text Embeddings Inference (https://github.com/huggingface/text-embeddings-inference)
35
+ 2. vLLM (https://vllm.ai/)
36
+ Please note that the supported features and capabilities may vary between different endpoints and
37
+ language models. Using features that are not supported by the endpoint will result in an error.
38
+
39
+ This customization can be done by setting the `base_url` parameter to the base URL of the endpoint:
40
+ ```python
41
+ em_invoker = OpenAIEMInvoker(
42
+ model_name="<model-name>",
43
+ api_key="<your-api-key>",
44
+ base_url="<https://base-url>",
45
+ )
46
+ result = await em_invoker.invoke("Hi there!")
47
+ ```
48
+
24
49
  Input types:
25
50
  The `OpenAIEMInvoker` only supports text inputs.
26
51
 
@@ -72,13 +97,16 @@ class OpenAIEMInvoker(BaseEMInvoker):
72
97
  ```
73
98
  '''
74
99
  client: Incomplete
75
- 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, truncation_config: TruncationConfig | None = None) -> None:
76
- """Initializes a new instance of the OpenAIEMInvoker class.
100
+ def __init__(self, model_name: str, api_key: str | None = None, base_url: str = ..., model_kwargs: dict[str, Any] | None = None, default_hyperparameters: dict[str, Any] | None = None, retry_config: RetryConfig | None = None, truncation_config: TruncationConfig | None = None) -> None:
101
+ '''Initializes a new instance of the OpenAIEMInvoker class.
77
102
 
78
103
  Args:
79
104
  model_name (str): The name of the OpenAI embedding model to be used.
80
- api_key (str | None, optional): The API key for the OpenAI API. Defaults to None, in which
81
- case the `OPENAI_API_KEY` environment variable will be used.
105
+ api_key (str | None, optional): The API key for authenticating with OpenAI. Defaults to None, in which
106
+ case the `OPENAI_API_KEY` environment variable will be used. If the endpoint does not require an
107
+ API key, a dummy value can be passed (e.g. "<empty>").
108
+ base_url (str, optional): The base URL of a custom endpoint that is compatible with OpenAI\'s
109
+ Embeddings API schema. Defaults to OpenAI\'s default URL.
82
110
  model_kwargs (dict[str, Any] | None, optional): Additional keyword arguments for the OpenAI client.
83
111
  Defaults to None.
84
112
  default_hyperparameters (dict[str, Any] | None, optional): Default hyperparameters for invoking the model.
@@ -87,4 +115,4 @@ class OpenAIEMInvoker(BaseEMInvoker):
87
115
  Defaults to None, in which case a default config with no retry and 30.0 seconds timeout will be used.
88
116
  truncation_config (TruncationConfig | None, optional): Configuration for text truncation behavior.
89
117
  Defaults to None, in which case no truncation is applied.
90
- """
118
+ '''
@@ -5,8 +5,9 @@ from gllm_inference.lm_invoker.datasaur_lm_invoker import DatasaurLMInvoker as D
5
5
  from gllm_inference.lm_invoker.google_lm_invoker import GoogleLMInvoker as GoogleLMInvoker
6
6
  from gllm_inference.lm_invoker.langchain_lm_invoker import LangChainLMInvoker as LangChainLMInvoker
7
7
  from gllm_inference.lm_invoker.litellm_lm_invoker import LiteLLMLMInvoker as LiteLLMLMInvoker
8
+ from gllm_inference.lm_invoker.openai_chat_completions_lm_invoker import OpenAIChatCompletionsLMInvoker as OpenAIChatCompletionsLMInvoker
8
9
  from gllm_inference.lm_invoker.openai_compatible_lm_invoker import OpenAICompatibleLMInvoker as OpenAICompatibleLMInvoker
9
10
  from gllm_inference.lm_invoker.openai_lm_invoker import OpenAILMInvoker as OpenAILMInvoker
10
11
  from gllm_inference.lm_invoker.xai_lm_invoker import XAILMInvoker as XAILMInvoker
11
12
 
12
- __all__ = ['AnthropicLMInvoker', 'AzureOpenAILMInvoker', 'BedrockLMInvoker', 'DatasaurLMInvoker', 'GoogleLMInvoker', 'LangChainLMInvoker', 'LiteLLMLMInvoker', 'OpenAICompatibleLMInvoker', 'OpenAILMInvoker', 'XAILMInvoker']
13
+ __all__ = ['AnthropicLMInvoker', 'AzureOpenAILMInvoker', 'BedrockLMInvoker', 'DatasaurLMInvoker', 'GoogleLMInvoker', 'LangChainLMInvoker', 'LiteLLMLMInvoker', 'OpenAIChatCompletionsLMInvoker', 'OpenAICompatibleLMInvoker', 'OpenAILMInvoker', 'XAILMInvoker']
@@ -37,7 +37,7 @@ class LangChainLMInvoker(BaseLMInvoker):
37
37
  ```python
38
38
  lm_invoker = LangChainLMInvoker(
39
39
  model_class_path="langchain_openai.ChatOpenAI",
40
- model_name="gpt-4.1-nano",
40
+ model_name="gpt-5-nano",
41
41
  )
42
42
  result = await lm_invoker.invoke("Hi there!")
43
43
  ```
@@ -50,7 +50,7 @@ class LangChainLMInvoker(BaseLMInvoker):
50
50
  ```python
51
51
  from langchain_openai import ChatOpenAI
52
52
 
53
- model = ChatOpenAI(model="gpt-4.1-nano", api_key="your_api_key")
53
+ model = ChatOpenAI(model="gpt-5-nano", api_key="your_api_key")
54
54
  lm_invoker = LangChainLMInvoker(model=model)
55
55
  ```
56
56
 
@@ -59,7 +59,7 @@ class LangChainLMInvoker(BaseLMInvoker):
59
59
  ```python
60
60
  lm_invoker = LangChainLMInvoker(
61
61
  model_class_path="langchain_openai.ChatOpenAI",
62
- model_name="gpt-4.1-nano",
62
+ model_name="gpt-5-nano",
63
63
  model_kwargs={"api_key": "your_api_key"}
64
64
  )
65
65
  ```
@@ -27,7 +27,7 @@ class LiteLLMLMInvoker(OpenAICompatibleLMInvoker):
27
27
  Basic usage:
28
28
  The `LiteLLMLMInvoker` can be used as follows:
29
29
  ```python
30
- lm_invoker = LiteLLMLMInvoker(model_id="openai/gpt-4.1-nano")
30
+ lm_invoker = LiteLLMLMInvoker(model_id="openai/gpt-5-nano")
31
31
  result = await lm_invoker.invoke("Hi there!")
32
32
  ```
33
33
 
@@ -0,0 +1,278 @@
1
+ from _typeshed import Incomplete
2
+ from gllm_core.event import EventEmitter as EventEmitter
3
+ from gllm_core.schema.tool import Tool as Tool
4
+ from gllm_core.utils.retry import RetryConfig as RetryConfig
5
+ from gllm_inference.constants import INVOKER_PROPAGATED_MAX_RETRIES as INVOKER_PROPAGATED_MAX_RETRIES, OPENAI_DEFAULT_URL as OPENAI_DEFAULT_URL
6
+ from gllm_inference.lm_invoker.lm_invoker import BaseLMInvoker as BaseLMInvoker
7
+ from gllm_inference.lm_invoker.schema.openai_chat_completions import InputType as InputType, Key as Key, ReasoningEffort as ReasoningEffort
8
+ 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
9
+ from gllm_inference.utils import validate_string_enum as validate_string_enum
10
+ from langchain_core.tools import Tool as LangChainTool
11
+ from typing import Any
12
+
13
+ SUPPORTED_ATTACHMENTS: Incomplete
14
+
15
+ class OpenAIChatCompletionsLMInvoker(BaseLMInvoker):
16
+ '''A language model invoker to interact with OpenAI language models using the Chat Completions API.
17
+
18
+ This class provides support for OpenAI\'s Chat Completions API schema. Use this class only when you have
19
+ a specific reason to use the Chat Completions API over the Responses API, as OpenAI recommends using
20
+ the Responses API whenever possible. The Responses API schema is supported through the `OpenAILMInvoker` class.
21
+
22
+ Attributes:
23
+ model_id (str): The model ID of the language model.
24
+ model_provider (str): The provider of the language model.
25
+ model_name (str): The name of the language model.
26
+ client (AsyncOpenAI): The OpenAI client instance.
27
+ default_hyperparameters (dict[str, Any]): Default hyperparameters for invoking the model.
28
+ tools (list[Tool]): The list of tools provided to the model to enable tool calling.
29
+ response_schema (ResponseSchema | None): The schema of the response. If provided, the model will output a
30
+ structured response as defined by the schema. Supports both Pydantic BaseModel and JSON schema dictionary.
31
+ output_analytics (bool): Whether to output the invocation analytics.
32
+ retry_config (RetryConfig | None): The retry configuration for the language model.
33
+
34
+ Basic usage:
35
+ The `OpenAIChatCompletionsLMInvoker` can be used as follows:
36
+ ```python
37
+ lm_invoker = OpenAIChatCompletionsLMInvoker(model_name="gpt-5-nano")
38
+ result = await lm_invoker.invoke("Hi there!")
39
+ ```
40
+
41
+ OpenAI compatible endpoints:
42
+ The `OpenAIChatCompletionsLMInvoker` can also be used to interact with endpoints that are compatible with
43
+ OpenAI\'s Chat Completions API schema. This includes but are not limited to:
44
+ 1. DeepInfra (https://deepinfra.com/)
45
+ 2. DeepSeek (https://deepseek.com/)
46
+ 3. Groq (https://groq.com/)
47
+ 4. OpenRouter (https://openrouter.ai/)
48
+ 5. Text Generation Inference (https://github.com/huggingface/text-generation-inference)
49
+ 6. Together.ai (https://together.ai/)
50
+ 7. vLLM (https://vllm.ai/)
51
+ Please note that the supported features and capabilities may vary between different endpoints and
52
+ language models. Using features that are not supported by the endpoint will result in an error.
53
+
54
+ This customization can be done by setting the `base_url` parameter to the base URL of the endpoint:
55
+ ```python
56
+ lm_invoker = OpenAIChatCompletionsLMInvoker(
57
+ model_name="llama3-8b-8192",
58
+ api_key="<your-api-key>",
59
+ base_url="https://api.groq.com/openai/v1",
60
+ )
61
+ result = await lm_invoker.invoke("Hi there!")
62
+ ```
63
+
64
+ Input types:
65
+ The `OpenAIChatCompletionsLMInvoker` supports the following input types: text, audio, document, and image.
66
+ Non-text inputs can be passed as an `Attachment` object with the `user` role.
67
+
68
+ Usage example:
69
+ ```python
70
+ text = "What animal is in this image?"
71
+ image = Attachment.from_path("path/to/local/image.png")
72
+ result = await lm_invoker.invoke([text, image])
73
+ ```
74
+
75
+ Tool calling:
76
+ Tool calling is a feature that allows the language model to call tools to perform tasks.
77
+ Tools can be passed to the via the `tools` parameter as a list of `Tool` objects.
78
+ When tools are provided and the model decides to call a tool, the tool calls are stored in the
79
+ `tool_calls` attribute in the output.
80
+
81
+ Usage example:
82
+ ```python
83
+ lm_invoker = OpenAIChatCompletionsLMInvoker(..., tools=[tool_1, tool_2])
84
+ ```
85
+
86
+ Output example:
87
+ ```python
88
+ LMOutput(
89
+ response="Let me call the tools...",
90
+ tool_calls=[
91
+ ToolCall(id="123", name="tool_1", args={"key": "value"}),
92
+ ToolCall(id="456", name="tool_2", args={"key": "value"}),
93
+ ]
94
+ )
95
+ ```
96
+
97
+ Structured output:
98
+ Structured output is a feature that allows the language model to output a structured response.
99
+ This feature can be enabled by providing a schema to the `response_schema` parameter.
100
+
101
+ The schema must be either a JSON schema dictionary or a Pydantic BaseModel class.
102
+ If JSON schema is used, it must be compatible with Pydantic\'s JSON schema, especially for complex schemas.
103
+ For this reason, it is recommended to create the JSON schema using Pydantic\'s `model_json_schema` method.
104
+
105
+ The language model also doesn\'t need to stream anything when structured output is enabled. Thus, standard
106
+ invocation will be performed regardless of whether the `event_emitter` parameter is provided or not.
107
+
108
+ When enabled, the structured output is stored in the `structured_output` attribute in the output.
109
+ 1. If the schema is a JSON schema dictionary, the structured output is a dictionary.
110
+ 2. If the schema is a Pydantic BaseModel class, the structured output is a Pydantic model.
111
+
112
+ # Example 1: Using a JSON schema dictionary
113
+ Usage example:
114
+ ```python
115
+ schema = {
116
+ "title": "Animal",
117
+ "description": "A description of an animal.",
118
+ "properties": {
119
+ "color": {"title": "Color", "type": "string"},
120
+ "name": {"title": "Name", "type": "string"},
121
+ },
122
+ "required": ["name", "color"],
123
+ "type": "object",
124
+ }
125
+ lm_invoker = OpenAIChatCompletionsLMInvoker(..., response_schema=schema)
126
+ ```
127
+ Output example:
128
+ ```python
129
+ LMOutput(structured_output={"name": "Golden retriever", "color": "Golden"})
130
+ ```
131
+
132
+ # Example 2: Using a Pydantic BaseModel class
133
+ Usage example:
134
+ ```python
135
+ class Animal(BaseModel):
136
+ name: str
137
+ color: str
138
+
139
+ lm_invoker = OpenAIChatCompletionsLMInvoker(..., response_schema=Animal)
140
+ ```
141
+ Output example:
142
+ ```python
143
+ LMOutput(structured_output=Animal(name="Golden retriever", color="Golden"))
144
+ ```
145
+
146
+ Analytics tracking:
147
+ Analytics tracking is a feature that allows the module to output additional information about the invocation.
148
+ This feature can be enabled by setting the `output_analytics` parameter to `True`.
149
+ When enabled, the following attributes will be stored in the output:
150
+ 1. `token_usage`: The token usage.
151
+ 2. `duration`: The duration in seconds.
152
+ 3. `finish_details`: The details about how the generation finished.
153
+
154
+ Output example:
155
+ ```python
156
+ LMOutput(
157
+ response="Golden retriever is a good dog breed.",
158
+ token_usage=TokenUsage(input_tokens=100, output_tokens=50),
159
+ duration=0.729,
160
+ finish_details={"finish_reason": "stop"},
161
+ )
162
+ ```
163
+
164
+ When streaming is enabled, token usage is not supported. Therefore, the `token_usage` attribute will be `None`
165
+ regardless of the value of the `output_analytics` parameter.
166
+
167
+ Retry and timeout:
168
+ The `OpenAIChatCompletionsLMInvoker` supports retry and timeout configuration.
169
+ By default, the max retries is set to 0 and the timeout is set to 30.0 seconds.
170
+ They can be customized by providing a custom `RetryConfig` object to the `retry_config` parameter.
171
+
172
+ Retry config examples:
173
+ ```python
174
+ retry_config = RetryConfig(max_retries=0, timeout=0.0) # No retry, no timeout
175
+ retry_config = RetryConfig(max_retries=0, timeout=10.0) # No retry, 10.0 seconds timeout
176
+ retry_config = RetryConfig(max_retries=5, timeout=0.0) # 5 max retries, no timeout
177
+ retry_config = RetryConfig(max_retries=5, timeout=10.0) # 5 max retries, 10.0 seconds timeout
178
+ ```
179
+
180
+ Usage example:
181
+ ```python
182
+ lm_invoker = OpenAIChatCompletionsLMInvoker(..., retry_config=retry_config)
183
+ ```
184
+
185
+ Reasoning:
186
+ Some language models support advanced reasoning capabilities. When using such reasoning-capable models,
187
+ you can configure how much reasoning the model should perform before generating a final response by setting
188
+ reasoning-related parameters.
189
+
190
+ The reasoning effort of reasoning models can be set via the `reasoning_effort` parameter. This parameter
191
+ will guide the models on how many reasoning tokens it should generate before creating a response to the prompt.
192
+ The reasoning effort is only supported by some language models.
193
+ Available options include:
194
+ 1. "low": Favors speed and economical token usage.
195
+ 2. "medium": Favors a balance between speed and reasoning accuracy.
196
+ 3. "high": Favors more complete reasoning at the cost of more tokens generated and slower responses.
197
+ This may differ between models. When not set, the reasoning effort will be equivalent to None by default.
198
+
199
+ When using reasoning models, some providers might output the reasoning summary. These will be stored in the
200
+ `reasoning` attribute in the output.
201
+
202
+ Output example:
203
+ ```python
204
+ LMOutput(
205
+ response="Golden retriever is a good dog breed.",
206
+ reasoning=[Reasoning(id="", reasoning="Let me think about it...")],
207
+ )
208
+ ```
209
+
210
+ When streaming is enabled along with reasoning and the provider supports reasoning output, the reasoning token
211
+ will be streamed with the `EventType.DATA` event type.
212
+
213
+ Streaming output example:
214
+ ```python
215
+ {"type": "data", "value": \'{"data_type": "thinking_start", "data_value": ""}\', ...}
216
+ {"type": "data", "value": \'{"data_type": "thinking", "data_value": "Let me think "}\', ...}
217
+ {"type": "data", "value": \'{"data_type": "thinking", "data_value": "about it..."}\', ...}
218
+ {"type": "data", "value": \'{"data_type": "thinking_end", "data_value": ""}\', ...}
219
+ {"type": "response", "value": "Golden retriever ", ...}
220
+ {"type": "response", "value": "is a good dog breed.", ...}
221
+ ```
222
+
223
+ Setting reasoning-related parameters for non-reasoning models will raise an error.
224
+
225
+ Output types:
226
+ The output of the `OpenAIChatCompletionsLMInvoker` can either be:
227
+ 1. `str`: The text response if no additional output is needed.
228
+ 2. `LMOutput`: A Pydantic model with the following attributes if any additional output is needed:
229
+ 2.1. response (str): The text response.
230
+ 2.2. tool_calls (list[ToolCall]): The tool calls, if the `tools` parameter is defined and the language
231
+ model decides to invoke tools. Defaults to an empty list.
232
+ 2.3. structured_output (dict[str, Any] | BaseModel | None): The structured output, if the `response_schema`
233
+ parameter is defined. Defaults to None.
234
+ 2.4. token_usage (TokenUsage | None): The token usage analytics, if the `output_analytics` parameter is
235
+ set to `True`. Defaults to None.
236
+ 2.5. duration (float | None): The duration of the invocation in seconds, if the `output_analytics`
237
+ parameter is set to `True`. Defaults to None.
238
+ 2.6. finish_details (dict[str, Any] | None): The details about how the generation finished, if the
239
+ `output_analytics` parameter is set to `True`. Defaults to None.
240
+ 2.7. reasoning (list[Reasoning]): The reasoning objects. Currently not supported. Defaults to an empty list.
241
+ 2.8. citations (list[Chunk]): The citations. Currently not supported. Defaults to an empty list.
242
+ 2.9. code_exec_results (list[CodeExecResult]): The code execution results. Currently not supported.
243
+ Defaults to an empty list.
244
+ 2.10. mcp_calls (list[MCPCall]): The MCP calls. Currently not supported. Defaults to an empty list.
245
+ '''
246
+ client: Incomplete
247
+ def __init__(self, model_name: str, api_key: str | None = None, base_url: str = ..., model_kwargs: dict[str, Any] | None = None, default_hyperparameters: dict[str, Any] | None = None, tools: list[Tool | LangChainTool] | None = None, response_schema: ResponseSchema | None = None, output_analytics: bool = False, retry_config: RetryConfig | None = None, reasoning_effort: ReasoningEffort | None = None) -> None:
248
+ '''Initializes a new instance of the OpenAIChatCompletionsLMInvoker class.
249
+
250
+ Args:
251
+ model_name (str): The name of the OpenAI model.
252
+ api_key (str | None, optional): The API key for authenticating with OpenAI. Defaults to None, in which
253
+ case the `OPENAI_API_KEY` environment variable will be used. If the endpoint does not require an
254
+ API key, a dummy value can be passed (e.g. "<empty>").
255
+ base_url (str, optional): The base URL of a custom endpoint that is compatible with OpenAI\'s
256
+ Chat Completions API schema. Defaults to OpenAI\'s default URL.
257
+ model_kwargs (dict[str, Any] | None, optional): Additional model parameters. Defaults to None.
258
+ default_hyperparameters (dict[str, Any] | None, optional): Default hyperparameters for invoking the model.
259
+ Defaults to None.
260
+ tools (list[Tool | LangChainTool] | None, optional): Tools provided to the model to enable tool calling.
261
+ Defaults to None.
262
+ response_schema (ResponseSchema | None, optional): The schema of the response. If provided, the model will
263
+ output a structured response as defined by the schema. Supports both Pydantic BaseModel and JSON schema
264
+ dictionary. Defaults to None.
265
+ output_analytics (bool, optional): Whether to output the invocation analytics. Defaults to False.
266
+ retry_config (RetryConfig | None, optional): The retry configuration for the language model.
267
+ Defaults to None, in which case a default config with no retry and 30.0 seconds timeout will be used.
268
+ reasoning_effort (str | None, optional): The reasoning effort for the language model. Defaults to None.
269
+ '''
270
+ def set_response_schema(self, response_schema: ResponseSchema | None) -> None:
271
+ """Sets the response schema for the OpenAI language model.
272
+
273
+ This method sets the response schema for the OpenAI language model.
274
+ Any existing response schema will be replaced.
275
+
276
+ Args:
277
+ response_schema (ResponseSchema | None): The response schema to be used.
278
+ """
@@ -1,19 +1,15 @@
1
- from _typeshed import Incomplete
2
- from gllm_core.event import EventEmitter as EventEmitter
3
1
  from gllm_core.schema.tool import Tool as Tool
4
- from gllm_core.utils.retry import RetryConfig as RetryConfig
5
- from gllm_inference.constants import INVOKER_PROPAGATED_MAX_RETRIES as INVOKER_PROPAGATED_MAX_RETRIES
6
- from gllm_inference.lm_invoker.lm_invoker import BaseLMInvoker as BaseLMInvoker
7
- from gllm_inference.lm_invoker.schema.openai_compatible import InputType as InputType, Key as Key, ReasoningEffort as ReasoningEffort
8
- 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
9
- from gllm_inference.utils import validate_string_enum as validate_string_enum
2
+ from gllm_core.utils import RetryConfig as RetryConfig
3
+ from gllm_inference.lm_invoker.openai_chat_completions_lm_invoker import OpenAIChatCompletionsLMInvoker as OpenAIChatCompletionsLMInvoker
4
+ from gllm_inference.lm_invoker.schema.openai_chat_completions import ReasoningEffort as ReasoningEffort
5
+ from gllm_inference.schema import ResponseSchema as ResponseSchema
10
6
  from langchain_core.tools import Tool as LangChainTool
11
7
  from typing import Any
12
8
 
13
- SUPPORTED_ATTACHMENTS: Incomplete
9
+ DEPRECATION_MESSAGE: str
14
10
 
15
- class OpenAICompatibleLMInvoker(BaseLMInvoker):
16
- '''A language model invoker to interact with endpoints compatible with OpenAI\'s chat completion API contract.
11
+ class OpenAICompatibleLMInvoker(OpenAIChatCompletionsLMInvoker):
12
+ """A language model invoker to interact with endpoints compatible with OpenAI's chat completion API contract.
17
13
 
18
14
  Attributes:
19
15
  model_id (str): The model ID of the language model.
@@ -27,212 +23,8 @@ class OpenAICompatibleLMInvoker(BaseLMInvoker):
27
23
  output_analytics (bool): Whether to output the invocation analytics.
28
24
  retry_config (RetryConfig | None): The retry configuration for the language model.
29
25
 
30
- When to use:
31
- The `OpenAICompatibleLMInvoker` is designed to interact with endpoints that are compatible with OpenAI\'s chat
32
- completion API contract. This includes but are not limited to:
33
- 1. DeepInfra (https://deepinfra.com/)
34
- 2. DeepSeek (https://deepseek.com/)
35
- 3. Groq (https://groq.com/)
36
- 4. OpenRouter (https://openrouter.ai/)
37
- 5. Text Generation Inference (https://github.com/huggingface/text-generation-inference)
38
- 6. Together.ai (https://together.ai/)
39
- 7. vLLM (https://vllm.ai/)
40
- When using this invoker, please note that the supported features and capabilities may vary between different
41
- endpoints and language models. Using features that are not supported by the endpoint will result in an error.
42
-
43
- Basic usage:
44
- The `OpenAICompatibleLMInvoker` can be used as follows:
45
- ```python
46
- lm_invoker = OpenAICompatibleLMInvoker(
47
- model_name="llama3-8b-8192",
48
- base_url="https://api.groq.com/openai/v1",
49
- api_key="<your-api-key>"
50
- )
51
- result = await lm_invoker.invoke("Hi there!")
52
- ```
53
-
54
- Input types:
55
- The `OpenAICompatibleLMInvoker` supports the following input types: text, audio, document, and image.
56
- Non-text inputs can be passed as an `Attachment` object with the `user` role.
57
-
58
- Usage example:
59
- ```python
60
- text = "What animal is in this image?"
61
- image = Attachment.from_path("path/to/local/image.png")
62
- result = await lm_invoker.invoke([text, image])
63
- ```
64
-
65
- Tool calling:
66
- Tool calling is a feature that allows the language model to call tools to perform tasks.
67
- Tools can be passed to the via the `tools` parameter as a list of `Tool` objects.
68
- When tools are provided and the model decides to call a tool, the tool calls are stored in the
69
- `tool_calls` attribute in the output.
70
-
71
- Usage example:
72
- ```python
73
- lm_invoker = OpenAICompatibleLMInvoker(..., tools=[tool_1, tool_2])
74
- ```
75
-
76
- Output example:
77
- ```python
78
- LMOutput(
79
- response="Let me call the tools...",
80
- tool_calls=[
81
- ToolCall(id="123", name="tool_1", args={"key": "value"}),
82
- ToolCall(id="456", name="tool_2", args={"key": "value"}),
83
- ]
84
- )
85
- ```
86
-
87
- Structured output:
88
- Structured output is a feature that allows the language model to output a structured response.
89
- This feature can be enabled by providing a schema to the `response_schema` parameter.
90
-
91
- The schema must be either a JSON schema dictionary or a Pydantic BaseModel class.
92
- If JSON schema is used, it must be compatible with Pydantic\'s JSON schema, especially for complex schemas.
93
- For this reason, it is recommended to create the JSON schema using Pydantic\'s `model_json_schema` method.
94
-
95
- The language model also doesn\'t need to stream anything when structured output is enabled. Thus, standard
96
- invocation will be performed regardless of whether the `event_emitter` parameter is provided or not.
97
-
98
- When enabled, the structured output is stored in the `structured_output` attribute in the output.
99
- 1. If the schema is a JSON schema dictionary, the structured output is a dictionary.
100
- 2. If the schema is a Pydantic BaseModel class, the structured output is a Pydantic model.
101
-
102
- # Example 1: Using a JSON schema dictionary
103
- Usage example:
104
- ```python
105
- schema = {
106
- "title": "Animal",
107
- "description": "A description of an animal.",
108
- "properties": {
109
- "color": {"title": "Color", "type": "string"},
110
- "name": {"title": "Name", "type": "string"},
111
- },
112
- "required": ["name", "color"],
113
- "type": "object",
114
- }
115
- lm_invoker = OpenAICompatibleLMInvoker(..., response_schema=schema)
116
- ```
117
- Output example:
118
- ```python
119
- LMOutput(structured_output={"name": "Golden retriever", "color": "Golden"})
120
- ```
121
-
122
- # Example 2: Using a Pydantic BaseModel class
123
- Usage example:
124
- ```python
125
- class Animal(BaseModel):
126
- name: str
127
- color: str
128
-
129
- lm_invoker = OpenAICompatibleLMInvoker(..., response_schema=Animal)
130
- ```
131
- Output example:
132
- ```python
133
- LMOutput(structured_output=Animal(name="Golden retriever", color="Golden"))
134
- ```
135
-
136
- Analytics tracking:
137
- Analytics tracking is a feature that allows the module to output additional information about the invocation.
138
- This feature can be enabled by setting the `output_analytics` parameter to `True`.
139
- When enabled, the following attributes will be stored in the output:
140
- 1. `token_usage`: The token usage.
141
- 2. `duration`: The duration in seconds.
142
- 3. `finish_details`: The details about how the generation finished.
143
-
144
- Output example:
145
- ```python
146
- LMOutput(
147
- response="Golden retriever is a good dog breed.",
148
- token_usage=TokenUsage(input_tokens=100, output_tokens=50),
149
- duration=0.729,
150
- finish_details={"finish_reason": "stop"},
151
- )
152
- ```
153
-
154
- When streaming is enabled, token usage is not supported. Therefore, the `token_usage` attribute will be `None`
155
- regardless of the value of the `output_analytics` parameter.
156
-
157
- Retry and timeout:
158
- The `OpenAICompatibleLMInvoker` supports retry and timeout configuration.
159
- By default, the max retries is set to 0 and the timeout is set to 30.0 seconds.
160
- They can be customized by providing a custom `RetryConfig` object to the `retry_config` parameter.
161
-
162
- Retry config examples:
163
- ```python
164
- retry_config = RetryConfig(max_retries=0, timeout=0.0) # No retry, no timeout
165
- retry_config = RetryConfig(max_retries=0, timeout=10.0) # No retry, 10.0 seconds timeout
166
- retry_config = RetryConfig(max_retries=5, timeout=0.0) # 5 max retries, no timeout
167
- retry_config = RetryConfig(max_retries=5, timeout=10.0) # 5 max retries, 10.0 seconds timeout
168
- ```
169
-
170
- Usage example:
171
- ```python
172
- lm_invoker = OpenAICompatibleLMInvoker(..., retry_config=retry_config)
173
- ```
174
-
175
- Reasoning:
176
- Some language models support advanced reasoning capabilities. When using such reasoning-capable models,
177
- you can configure how much reasoning the model should perform before generating a final response by setting
178
- reasoning-related parameters.
179
-
180
- The reasoning effort of reasoning models can be set via the `reasoning_effort` parameter. This parameter
181
- will guide the models on how many reasoning tokens it should generate before creating a response to the prompt.
182
- The reasoning effort is only supported by some language models.
183
- Available options include:
184
- 1. "low": Favors speed and economical token usage.
185
- 2. "medium": Favors a balance between speed and reasoning accuracy.
186
- 3. "high": Favors more complete reasoning at the cost of more tokens generated and slower responses.
187
- This may differ between models. When not set, the reasoning effort will be equivalent to None by default.
188
-
189
- When using reasoning models, some providers might output the reasoning summary. These will be stored in the
190
- `reasoning` attribute in the output.
191
-
192
- Output example:
193
- ```python
194
- LMOutput(
195
- response="Golden retriever is a good dog breed.",
196
- reasoning=[Reasoning(id="", reasoning="Let me think about it...")],
197
- )
198
- ```
199
-
200
- When streaming is enabled along with reasoning and the provider supports reasoning output, the reasoning token
201
- will be streamed with the `EventType.DATA` event type.
202
-
203
- Streaming output example:
204
- ```python
205
- {"type": "data", "value": \'{"data_type": "thinking_start", "data_value": ""}\', ...}
206
- {"type": "data", "value": \'{"data_type": "thinking", "data_value": "Let me think "}\', ...}
207
- {"type": "data", "value": \'{"data_type": "thinking", "data_value": "about it..."}\', ...}
208
- {"type": "data", "value": \'{"data_type": "thinking_end", "data_value": ""}\', ...}
209
- {"type": "response", "value": "Golden retriever ", ...}
210
- {"type": "response", "value": "is a good dog breed.", ...}
211
-
212
- Setting reasoning-related parameters for non-reasoning models will raise an error.
213
-
214
- Output types:
215
- The output of the `OpenAICompatibleLMInvoker` can either be:
216
- 1. `str`: The text response if no additional output is needed.
217
- 2. `LMOutput`: A Pydantic model with the following attributes if any additional output is needed:
218
- 2.1. response (str): The text response.
219
- 2.2. tool_calls (list[ToolCall]): The tool calls, if the `tools` parameter is defined and the language
220
- model decides to invoke tools. Defaults to an empty list.
221
- 2.3. structured_output (dict[str, Any] | BaseModel | None): The structured output, if the `response_schema`
222
- parameter is defined. Defaults to None.
223
- 2.4. token_usage (TokenUsage | None): The token usage analytics, if the `output_analytics` parameter is
224
- set to `True`. Defaults to None.
225
- 2.5. duration (float | None): The duration of the invocation in seconds, if the `output_analytics`
226
- parameter is set to `True`. Defaults to None.
227
- 2.6. finish_details (dict[str, Any] | None): The details about how the generation finished, if the
228
- `output_analytics` parameter is set to `True`. Defaults to None.
229
- 2.7. reasoning (list[Reasoning]): The reasoning objects. Currently not supported. Defaults to an empty list.
230
- 2.8. citations (list[Chunk]): The citations. Currently not supported. Defaults to an empty list.
231
- 2.9. code_exec_results (list[CodeExecResult]): The code execution results. Currently not supported.
232
- Defaults to an empty list.
233
- 2.10. mcp_calls (list[MCPCall]): The MCP calls. Currently not supported. Defaults to an empty list.
234
- '''
235
- client: Incomplete
26
+ This class is deprecated and will be removed in v0.6. Please use the `OpenAIChatCompletionsLMInvoker` class instead.
27
+ """
236
28
  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 | LangChainTool] | None = None, response_schema: ResponseSchema | None = None, output_analytics: bool = False, retry_config: RetryConfig | None = None, reasoning_effort: ReasoningEffort | None = None) -> None:
237
29
  '''Initializes a new instance of the OpenAICompatibleLMInvoker class.
238
30
 
@@ -255,12 +47,3 @@ class OpenAICompatibleLMInvoker(BaseLMInvoker):
255
47
  Defaults to None, in which case a default config with no retry and 30.0 seconds timeout will be used.
256
48
  reasoning_effort (str | None, optional): The reasoning effort for the language model. Defaults to None.
257
49
  '''
258
- def set_response_schema(self, response_schema: ResponseSchema | None) -> None:
259
- """Sets the response schema for the language model hosted on the OpenAI compatible endpoint.
260
-
261
- This method sets the response schema for the language model hosted on the OpenAI compatible endpoint. Any
262
- existing response schema will be replaced.
263
-
264
- Args:
265
- response_schema (ResponseSchema | None): The response schema to be used.
266
- """
@@ -2,7 +2,7 @@ from _typeshed import Incomplete
2
2
  from gllm_core.event import EventEmitter as EventEmitter
3
3
  from gllm_core.schema.tool import Tool as Tool
4
4
  from gllm_core.utils.retry import RetryConfig as RetryConfig
5
- from gllm_inference.constants import INVOKER_PROPAGATED_MAX_RETRIES as INVOKER_PROPAGATED_MAX_RETRIES
5
+ from gllm_inference.constants import INVOKER_PROPAGATED_MAX_RETRIES as INVOKER_PROPAGATED_MAX_RETRIES, OPENAI_DEFAULT_URL as OPENAI_DEFAULT_URL
6
6
  from gllm_inference.lm_invoker.lm_invoker import BaseLMInvoker as BaseLMInvoker
7
7
  from gllm_inference.lm_invoker.schema.openai import InputType as InputType, Key as Key, OutputType as OutputType, ReasoningEffort as ReasoningEffort, ReasoningSummary as ReasoningSummary
8
8
  from gllm_inference.schema import Attachment as Attachment, AttachmentType as AttachmentType, CodeExecResult as CodeExecResult, EmitDataType as EmitDataType, LMOutput as LMOutput, MCPCall as MCPCall, MCPServer as MCPServer, 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
@@ -17,6 +17,10 @@ STREAM_DATA_CONTENT_TYPE_MAP: Incomplete
17
17
  class OpenAILMInvoker(BaseLMInvoker):
18
18
  '''A language model invoker to interact with OpenAI language models.
19
19
 
20
+ This class provides support for OpenAI\'s Responses API schema, which is recommended by OpenAI as the preferred API
21
+ to use whenever possible. Use this class unless you have a specific reason to use the Chat Completions API instead.
22
+ The Chat Completions API schema is supported through the `OpenAIChatCompletionsLMInvoker` class.
23
+
20
24
  Attributes:
21
25
  model_id (str): The model ID of the language model.
22
26
  model_provider (str): The provider of the language model.
@@ -39,7 +43,24 @@ class OpenAILMInvoker(BaseLMInvoker):
39
43
  Basic usage:
40
44
  The `OpenAILMInvoker` can be used as follows:
41
45
  ```python
42
- lm_invoker = OpenAILMInvoker(model_name="gpt-4.1-nano")
46
+ lm_invoker = OpenAILMInvoker(model_name="gpt-5-nano")
47
+ result = await lm_invoker.invoke("Hi there!")
48
+ ```
49
+
50
+ OpenAI compatible endpoints:
51
+ The `OpenAILMInvoker` can also be used to interact with endpoints that are compatible with
52
+ OpenAI\'s Responses API schema. This includes but are not limited to:
53
+ 1. SGLang (https://github.com/sgl-project/sglang)
54
+ Please note that the supported features and capabilities may vary between different endpoints and
55
+ language models. Using features that are not supported by the endpoint will result in an error.
56
+
57
+ This customization can be done by setting the `base_url` parameter to the base URL of the endpoint:
58
+ ```python
59
+ lm_invoker = OpenAILMInvoker(
60
+ model_name="<model-name>",
61
+ api_key="<your-api-key>",
62
+ base_url="<https://base-url>",
63
+ )
43
64
  result = await lm_invoker.invoke("Hi there!")
44
65
  ```
45
66
 
@@ -371,13 +392,16 @@ class OpenAILMInvoker(BaseLMInvoker):
371
392
  decides to invoke MCP tools. Defaults to an empty list.
372
393
  '''
373
394
  client: Incomplete
374
- 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 | LangChainTool] | 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, mcp_servers: list[MCPServer] | None = None, code_interpreter: bool = False, web_search: bool = False) -> None:
375
- """Initializes a new instance of the OpenAILMInvoker class.
395
+ def __init__(self, model_name: str, api_key: str | None = None, base_url: str = ..., model_kwargs: dict[str, Any] | None = None, default_hyperparameters: dict[str, Any] | None = None, tools: list[Tool | LangChainTool] | 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, mcp_servers: list[MCPServer] | None = None, code_interpreter: bool = False, web_search: bool = False) -> None:
396
+ '''Initializes a new instance of the OpenAILMInvoker class.
376
397
 
377
398
  Args:
378
399
  model_name (str): The name of the OpenAI model.
379
400
  api_key (str | None, optional): The API key for authenticating with OpenAI. Defaults to None, in which
380
- case the `OPENAI_API_KEY` environment variable will be used.
401
+ case the `OPENAI_API_KEY` environment variable will be used. If the endpoint does not require an
402
+ API key, a dummy value can be passed (e.g. "<empty>").
403
+ base_url (str, optional): The base URL of a custom endpoint that is compatible with OpenAI\'s
404
+ Responses API schema. Defaults to OpenAI\'s default URL.
381
405
  model_kwargs (dict[str, Any] | None, optional): Additional model parameters. Defaults to None.
382
406
  default_hyperparameters (dict[str, Any] | None, optional): Default hyperparameters for invoking the model.
383
407
  Defaults to None.
@@ -402,7 +426,7 @@ class OpenAILMInvoker(BaseLMInvoker):
402
426
  ValueError:
403
427
  1. `reasoning_effort` is provided, but is not a valid ReasoningEffort.
404
428
  2. `reasoning_summary` is provided, but is not a valid ReasoningSummary.
405
- """
429
+ '''
406
430
  def set_response_schema(self, response_schema: ResponseSchema | None) -> None:
407
431
  """Sets the response schema for the OpenAI language model.
408
432
 
@@ -1,7 +1,7 @@
1
1
  from enum import StrEnum
2
2
 
3
3
  class Key:
4
- """Defines valid keys in OpenAI compatible models."""
4
+ """Defines valid keys in OpenAI Chat Completions."""
5
5
  ARGUMENTS: str
6
6
  CONTENT: str
7
7
  CHOICES: str
@@ -42,7 +42,7 @@ class Key:
42
42
  SUMMARY: str
43
43
 
44
44
  class InputType:
45
- """Defines valid input types in OpenAI compatible models."""
45
+ """Defines valid input types in OpenAI Chat Completions."""
46
46
  FILE: str
47
47
  FUNCTION: str
48
48
  IMAGE_URL: str
@@ -1,3 +1,4 @@
1
+ from _typeshed import Incomplete
1
2
  from enum import StrEnum
2
3
  from gllm_inference.utils import validate_string_enum as validate_string_enum
3
4
  from pydantic import BaseModel
@@ -16,11 +17,15 @@ class ModelProvider(StrEnum):
16
17
  LANGCHAIN = 'langchain'
17
18
  LITELLM = 'litellm'
18
19
  OPENAI = 'openai'
20
+ OPENAI_CHAT_COMPLETIONS = 'openai-chat-completions'
19
21
  OPENAI_COMPATIBLE = 'openai-compatible'
20
22
  TWELVELABS = 'twelvelabs'
21
23
  VOYAGE = 'voyage'
22
24
  XAI = 'xai'
23
25
 
26
+ OPTIONAL_PATH_PROVIDERS: Incomplete
27
+ PATH_SUPPORTING_PROVIDERS: Incomplete
28
+
24
29
  class ModelId(BaseModel):
25
30
  '''Defines a representation of a valid model id.
26
31
 
@@ -32,7 +37,7 @@ class ModelId(BaseModel):
32
37
  Provider-specific examples:
33
38
  # Using Anthropic
34
39
  ```python
35
- model_id = ModelId.from_string("anthropic/claude-3-5-sonnet-latest")
40
+ model_id = ModelId.from_string("anthropic/claude-sonnet-4-20250514")
36
41
  ```
37
42
 
38
43
  # Using Bedrock
@@ -47,22 +52,32 @@ class ModelId(BaseModel):
47
52
 
48
53
  # Using Google
49
54
  ```python
50
- model_id = ModelId.from_string("google/gemini-1.5-flash")
55
+ model_id = ModelId.from_string("google/gemini-2.5-flash-lite")
51
56
  ```
52
57
 
53
58
  # Using OpenAI
54
59
  ```python
55
- model_id = ModelId.from_string("openai/gpt-4o-mini")
60
+ model_id = ModelId.from_string("openai/gpt-5-nano")
56
61
  ```
57
62
 
58
- # Using Azure OpenAI
63
+ # Using OpenAI with Chat Completions API
59
64
  ```python
60
- model_id = ModelId.from_string("azure-openai/https://my-resource.openai.azure.com/openai/v1:my-deployment")
65
+ model_id = ModelId.from_string("openai-chat-completions/gpt-5-nano")
66
+ ```
67
+
68
+ # Using OpenAI Responses API-compatible endpoints (e.g. SGLang)
69
+ ```python
70
+ model_id = ModelId.from_string("openai/https://my-sglang-url:8000/v1:my-model-name")
61
71
  ```
62
72
 
63
- # Using OpenAI compatible endpoints (e.g. Groq)
73
+ # Using OpenAI Chat Completions API-compatible endpoints (e.g. Groq)
64
74
  ```python
65
- model_id = ModelId.from_string("openai-compatible/https://api.groq.com/openai/v1:llama3-8b-8192")
75
+ model_id = ModelId.from_string("openai-chat-completions/https://api.groq.com/openai/v1:llama3-8b-8192")
76
+ ```
77
+
78
+ # Using Azure OpenAI
79
+ ```python
80
+ model_id = ModelId.from_string("azure-openai/https://my-resource.openai.azure.com/openai/v1:my-deployment")
66
81
  ```
67
82
 
68
83
  # Using Voyage
@@ -89,7 +104,7 @@ class ModelId(BaseModel):
89
104
  For the list of supported providers, please refer to the following page:
90
105
  https://docs.litellm.ai/docs/providers/
91
106
 
92
- # Using XAI
107
+ # Using xAI
93
108
  ```python
94
109
  model_id = ModelId.from_string("xai/grok-4-0709")
95
110
  ```
@@ -99,9 +114,9 @@ class ModelId(BaseModel):
99
114
  Custom model name validation example:
100
115
  ```python
101
116
  validation_map = {
102
- ModelProvider.ANTHROPIC: {"claude-3-5-sonnet-latest"},
103
- ModelProvider.GOOGLE: {"gemini-1.5-flash", "gemini-1.5-pro"},
104
- ModelProvider.OPENAI: {"gpt-4o", "gpt-4o-mini"},
117
+ ModelProvider.ANTHROPIC: {"claude-sonnet-4-20250514"},
118
+ ModelProvider.GOOGLE: {"gemini-2.5-flash-lite"},
119
+ ModelProvider.OPENAI: {"gpt-4.1-nano", "gpt-5-nano"},
105
120
  }
106
121
 
107
122
  model_id = ModelId.from_string("...", validation_map)
@@ -115,13 +130,8 @@ class ModelId(BaseModel):
115
130
  """Parse a model id string into a ModelId object.
116
131
 
117
132
  Args:
118
- model_id (str): The model id to parse. Must be in the the following format:
119
- 1. For `azure-openai` provider: `azure-openai/azure-endpoint:azure-deployment`.
120
- 2. For `openai-compatible` provider: `openai-compatible/base-url:model-name`.
121
- 3. For `langchain` provider: `langchain/<package>.<class>:model-name`.
122
- 4. For `litellm` provider: `litellm/provider/model-name`.
123
- 5. For `datasaur` provider: `datasaur/base-url`.
124
- 6. For other providers: `provider/model-name`.
133
+ model_id (str): The model id to parse. Must be in the format defined in the following page:
134
+ https://gdplabs.gitbook.io/sdk/resources/supported-models
125
135
  validation_map (dict[str, set[str]] | None, optional): An optional dictionary that maps provider names to
126
136
  sets of valid model names. For the defined model providers, the model names will be validated against
127
137
  the set of valid model names. For the undefined model providers, the model name will not be validated.
@@ -137,11 +147,6 @@ class ModelId(BaseModel):
137
147
  """Convert the ModelId object to a string.
138
148
 
139
149
  Returns:
140
- str: The string representation of the ModelId object. The format is as follows:
141
- 1. For `azure-openai` provider: `azure-openai/azure-endpoint:azure-deployment`.
142
- 2. For `openai-compatible` provider: `openai-compatible/base-url:model-name`.
143
- 3. For `langchain` provider: `langchain/<package>.<class>:model-name`.
144
- 4. For `litellm` provider: `litellm/provider/model-name`.
145
- 5. For `datasaur` provider: `datasaur/base-url`.
146
- 6. For other providers: `provider/model-name`.
150
+ str: The string representation of the ModelId object. The format is defined in the following page:
151
+ https://gdplabs.gitbook.io/sdk/resources/supported-models
147
152
  """
Binary file
gllm_inference.pyi CHANGED
@@ -27,6 +27,7 @@ import gllm_inference.lm_invoker.DatasaurLMInvoker
27
27
  import gllm_inference.lm_invoker.GoogleLMInvoker
28
28
  import gllm_inference.lm_invoker.LangChainLMInvoker
29
29
  import gllm_inference.lm_invoker.LiteLLMLMInvoker
30
+ import gllm_inference.lm_invoker.OpenAIChatCompletionsLMInvoker
30
31
  import gllm_inference.lm_invoker.OpenAICompatibleLMInvoker
31
32
  import gllm_inference.lm_invoker.OpenAILMInvoker
32
33
  import gllm_inference.lm_invoker.XAILMInvoker
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: gllm-inference-binary
3
- Version: 0.5.34
3
+ Version: 0.5.35
4
4
  Summary: A library containing components related to model inferences in Gen AI applications.
5
5
  Author-email: Henry Wicaksono <henry.wicaksono@gdplabs.id>, Resti Febrina <resti.febrina@gdplabs.id>
6
6
  Requires-Python: <3.14,>=3.11
@@ -1,15 +1,15 @@
1
- gllm_inference.cp311-win_amd64.pyd,sha256=5hvgBNRlmrNo8Co2DmMPfAmNF2SIOgoo1AXSsFntwLs,3229184
2
- gllm_inference.pyi,sha256=bvMQNMzysfZtXgjW4ZX0KwSOV4uroNakpE0NUHKCMmk,4199
1
+ gllm_inference.cp311-win_amd64.pyd,sha256=iLhp_OTfO7KR3_ifQCN3KIni-vQaL_3nlldp6oJ0vYU,3258368
2
+ gllm_inference.pyi,sha256=bOGYhW7SnMMPCLRRlkVbSq8I8xn8YwHssI1zZoD1lVU,4263
3
3
  gllm_inference/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
- gllm_inference/constants.pyi,sha256=KQmondDEkHK2P249ymmce3SdutVrx8kYm4v1eTCkW9U,277
4
+ gllm_inference/constants.pyi,sha256=1OBoHfeWfW9bXH9kStNEH__MGnGp--jLfyheAeQnogY,302
5
5
  gllm_inference/builder/__init__.pyi,sha256=-bw1uDx7CAM7pkvjvb1ZXku9zXlQ7aEAyC83KIn3bz8,506
6
- gllm_inference/builder/build_em_invoker.pyi,sha256=Mh1vRoJhsqc8hX4jUdopV14Fn44ql27NB7xbGjoHJtE,6020
7
- gllm_inference/builder/build_lm_invoker.pyi,sha256=p63iuVBOOpNizItGK6HDxYDrgXdovtfSe0VrvrEd-PA,7047
8
- gllm_inference/builder/build_lm_request_processor.pyi,sha256=0pJINCP4nnXVwuhIbhsaiwzjX8gohQt2oqXFZhTFSUs,4584
6
+ gllm_inference/builder/build_em_invoker.pyi,sha256=r4p0T9g_831Fq0youhxdMrQMWkzARw-PSahMu83ZzQo,5762
7
+ gllm_inference/builder/build_lm_invoker.pyi,sha256=HvQICF-qvOTzfXZUqhi7rlwcpkMZpxaC-8QZmhnXKzI,7466
8
+ gllm_inference/builder/build_lm_request_processor.pyi,sha256=H7Rg88e7PTTCtuyY64r333moTmh4-ypOwgnG10gkEdY,4232
9
9
  gllm_inference/builder/build_output_parser.pyi,sha256=sgSTrzUmSRxPzUUum0fDU7A3NXYoYhpi6bEx4Q2XMnA,965
10
10
  gllm_inference/catalog/__init__.pyi,sha256=HWgPKWIzprpMHRKe_qN9BZSIQhVhrqiyjLjIXwvj1ho,291
11
11
  gllm_inference/catalog/catalog.pyi,sha256=eWPqgQKi-SJGHabi_XOTEKpAj96OSRypKsb5ZEC1VWU,4911
12
- gllm_inference/catalog/lm_request_processor_catalog.pyi,sha256=GemCEjFRHNChtNOfbyXSVsJiA3klOCAe_X11fnymhYs,5540
12
+ gllm_inference/catalog/lm_request_processor_catalog.pyi,sha256=FiveqPDkV58XbDO2znXL-Ix5tFbZwNiVnitlEa90YOY,5536
13
13
  gllm_inference/catalog/prompt_builder_catalog.pyi,sha256=iViWB4SaezzjQY4UY1YxeoXUNxqxa2cTJGaD9JSx4Q8,3279
14
14
  gllm_inference/em_invoker/__init__.pyi,sha256=pmbsjmsqXwfe4WPykMnrmasKrYuylJWnf2s0pbo0ioM,997
15
15
  gllm_inference/em_invoker/azure_openai_em_invoker.pyi,sha256=SfJPC_PJGiEfWS9JH5kRQPJztsR7jRhwVuETqdY-JsQ,5021
@@ -17,8 +17,8 @@ gllm_inference/em_invoker/bedrock_em_invoker.pyi,sha256=UqodtpDmE7fEgpctXEETIlZG
17
17
  gllm_inference/em_invoker/em_invoker.pyi,sha256=YDYJ8TGScsz5Gg-OBnEENN1tI1RYvwoddypxUr6SAWw,5191
18
18
  gllm_inference/em_invoker/google_em_invoker.pyi,sha256=q69kdVuE44ZqziQ8BajFYZ1tYn-MPjKjzXS9cRh4oAo,6951
19
19
  gllm_inference/em_invoker/langchain_em_invoker.pyi,sha256=nhX6LynrjhfySEt_44OlLoSBd15hoz3giWyNM9CYLKY,3544
20
- gllm_inference/em_invoker/openai_compatible_em_invoker.pyi,sha256=zEYOBDXKQhvcMGer9DYDu50_3KRDjYyN8-JgpBIFPOI,5456
21
- gllm_inference/em_invoker/openai_em_invoker.pyi,sha256=0TDIQa-5UwsPcVxgkze-QJJWrt-ToakAKbuAk9TW5SM,4746
20
+ gllm_inference/em_invoker/openai_compatible_em_invoker.pyi,sha256=S7OHYa1VF24tiv46VCjHN3zZtHDNr5XT_k1acti54jY,2889
21
+ gllm_inference/em_invoker/openai_em_invoker.pyi,sha256=jqsj9rlNW13XSkDUpNwSIUhiQcc8U1Py7hHQ1FZS5CM,6280
22
22
  gllm_inference/em_invoker/twelevelabs_em_invoker.pyi,sha256=MMVgSnjMXksdhSDXIi3vOULIXnjbhtq19eR5LPnUmGo,5446
23
23
  gllm_inference/em_invoker/voyage_em_invoker.pyi,sha256=vdB_qS8QKrCcb-HtXwKZS4WW1R1wGzpMBFmOKC39sjU,5619
24
24
  gllm_inference/em_invoker/langchain/__init__.pyi,sha256=aOTlRvS9aG1tBErjsmhe75s4Sq-g2z9ArfGqNW7QyEs,151
@@ -35,17 +35,18 @@ gllm_inference/exceptions/__init__.pyi,sha256=nXOqwsuwUgsnBcJEANVuxbZ1nDfcJ6-pKU
35
35
  gllm_inference/exceptions/error_parser.pyi,sha256=4aiJZhBzBOqlhdmpvaCvildGy7_XxlJzQpe3PzGt8eE,2040
36
36
  gllm_inference/exceptions/exceptions.pyi,sha256=6y3ECgHAStqMGgQv8Dv-Ui-5PDD07mSj6qaRZeSWea4,5857
37
37
  gllm_inference/exceptions/provider_error_map.pyi,sha256=4AsAgbXAh91mxEW2YiomEuhBoeSNeAIo9WbT9WK8gQk,1233
38
- gllm_inference/lm_invoker/__init__.pyi,sha256=eE_HDCl9A135mi6mtIV55q-T9J1O8OpbMcqWuny3w9A,1214
38
+ gllm_inference/lm_invoker/__init__.pyi,sha256=jG1xc5fTOeIgeKKVYSnsMzQThKk9kTW38yO_MYtv540,1387
39
39
  gllm_inference/lm_invoker/anthropic_lm_invoker.pyi,sha256=5fscLpROscxjBNP13GmcU9I83YiZH-pb42FzQ2JzGBA,17575
40
40
  gllm_inference/lm_invoker/azure_openai_lm_invoker.pyi,sha256=Tcmr0OfEk3As4nmL_lCoQzVB9qTQ2BLASRFhcObvrPY,15286
41
41
  gllm_inference/lm_invoker/bedrock_lm_invoker.pyi,sha256=ptyHTm1szPJEpQObdrsxHpbTkchCWE6K-YmVTmbdhvM,13037
42
42
  gllm_inference/lm_invoker/datasaur_lm_invoker.pyi,sha256=sR1vSTifBykASzAGMYn7nJVxTEwXMFz-Xa0rQjXzb6A,9482
43
43
  gllm_inference/lm_invoker/google_lm_invoker.pyi,sha256=Zkt-BdOZT106mn07_7krBQ5GiXsp9z9aoHs_d96P4lg,17482
44
- gllm_inference/lm_invoker/langchain_lm_invoker.pyi,sha256=2pghfayLQxNJ1UEJZGPCro_sfFq0u4_RFSupcSsNkg8,13972
45
- gllm_inference/lm_invoker/litellm_lm_invoker.pyi,sha256=7OJSwv0FCg9Hf4wxtdHcblCcFYu4SqPiMACFH-ZM1c0,13489
44
+ gllm_inference/lm_invoker/langchain_lm_invoker.pyi,sha256=dKN0flBxjiCUWW1QOz8HjoRfKpqXjNEz1pm5cS-40zA,13966
45
+ gllm_inference/lm_invoker/litellm_lm_invoker.pyi,sha256=cnkg4Lk9sRqXylWQq5G3ujD_DzcVX88DCfEpA5hkTFA,13487
46
46
  gllm_inference/lm_invoker/lm_invoker.pyi,sha256=JQFExiblFbCMQ3HXOE62Ho1VTMdmxf_CZ-edGSQbCrQ,8312
47
- gllm_inference/lm_invoker/openai_compatible_lm_invoker.pyi,sha256=7Tnq-4Cl46sPDLiRQLQBDFuk_INhm0BIknXZXqXYb-8,15316
48
- gllm_inference/lm_invoker/openai_lm_invoker.pyi,sha256=NK-HJXvRrQjDgfpqXGUBi_rf5iTiMjJvxfRsqj_JT_I,22512
47
+ gllm_inference/lm_invoker/openai_chat_completions_lm_invoker.pyi,sha256=9Nkun_k_i1VDx3A0ixOosAYp_8WpfzjW-UBI-T_3g6M,16014
48
+ gllm_inference/lm_invoker/openai_compatible_lm_invoker.pyi,sha256=HkHIDtuw1IIwDglOelAy6VKwKmslEVTOsgC1Ememsq0,3886
49
+ gllm_inference/lm_invoker/openai_lm_invoker.pyi,sha256=GPzPZeKiopSk0zLydQY0bQ3V3-oka9BNtFCepdYiEl4,24065
49
50
  gllm_inference/lm_invoker/xai_lm_invoker.pyi,sha256=6TwO3KU1DBWoe4UAsz97MY1yKBf-N38WjbrBqCmWCNU,15992
50
51
  gllm_inference/lm_invoker/batch/__init__.pyi,sha256=vJOTHRJ83oq8Bq0UsMdID9_HW5JAxr06gUs4aPRZfEE,130
51
52
  gllm_inference/lm_invoker/batch/batch_operations.pyi,sha256=o2U17M41RKVFW6j_oxy-SxU1JqUtVt75pKRxrqXzorE,5499
@@ -56,7 +57,7 @@ gllm_inference/lm_invoker/schema/datasaur.pyi,sha256=GLv6XAwKtWyRrX6EsbEufYjkPff
56
57
  gllm_inference/lm_invoker/schema/google.pyi,sha256=elXHrUMS46pbTsulk7hBXVVFcT022iD-_U_I590xeV8,529
57
58
  gllm_inference/lm_invoker/schema/langchain.pyi,sha256=2OJOUQPlGdlUbIOTDOyiWDBOMm3MoVX-kU2nK0zQsF0,452
58
59
  gllm_inference/lm_invoker/schema/openai.pyi,sha256=eDbU3lGOeJgwuaEVv2Zd0amylGX4e-d78_97kPN1cuQ,2291
59
- gllm_inference/lm_invoker/schema/openai_compatible.pyi,sha256=fVLRIrOvLJjhY7qPUgC3HRFoOFa7XimWLjr2EOo5qmQ,1226
60
+ gllm_inference/lm_invoker/schema/openai_chat_completions.pyi,sha256=8oYQ2VC7L4WQpBAdUEDNIJKvcSGEdu4z_iIuy_TQpeE,1224
60
61
  gllm_inference/lm_invoker/schema/xai.pyi,sha256=jpC6ZSBDUltzm9GjD6zvSFIPwqizn_ywLnjvwSa7KuU,663
61
62
  gllm_inference/model/__init__.pyi,sha256=JKQB0wVSVYD-_tdRkG7N_oEVAKGCcoBw0BUOUMLieFo,602
62
63
  gllm_inference/model/em/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -94,7 +95,7 @@ gllm_inference/schema/lm_input.pyi,sha256=HxQiZgY7zcXh_Dw8nK8LSeBTZEHMPZVwmPmnfg
94
95
  gllm_inference/schema/lm_output.pyi,sha256=xafvq38SJkon0QfkuhswCX8ql777el5dUmzbbhLyOvA,2222
95
96
  gllm_inference/schema/mcp.pyi,sha256=4SgQ83pEowfWm2p-w9lupV4NayqqVBOy7SuYxIFeWRs,1045
96
97
  gllm_inference/schema/message.pyi,sha256=jJV6A0ihEcun2OhzyMtNkiHnf7d6v5R-GdpTBGfJ0AQ,2272
97
- gllm_inference/schema/model_id.pyi,sha256=h2nAmYgUYjF8MjT9pTnRfrevYuSHeksEZHvizkmu6n8,5638
98
+ gllm_inference/schema/model_id.pyi,sha256=NuaS4XlKDRJJezj45CEzn8reDDeII9XeRARmM5SZPqA,5408
98
99
  gllm_inference/schema/reasoning.pyi,sha256=jbPxkDRHt0Vt-zdcc8lTT1l2hIE1Jm3HIHeNd0hfXGo,577
99
100
  gllm_inference/schema/token_usage.pyi,sha256=WJiGQyz5qatzBK2b-sABLCyTRLCBbAvxCRcqSJOzu-8,3025
100
101
  gllm_inference/schema/tool_call.pyi,sha256=OWT9LUqs_xfUcOkPG0aokAAqzLYYDkfnjTa0zOWvugk,403
@@ -105,7 +106,7 @@ gllm_inference/utils/io_utils.pyi,sha256=Eg7dvHWdXslTKdjh1j3dG50i7r35XG2zTmJ9XXv
105
106
  gllm_inference/utils/langchain.pyi,sha256=4AwFiVAO0ZpdgmqeC4Pb5NJwBt8vVr0MSUqLeCdTscc,1194
106
107
  gllm_inference/utils/validation.pyi,sha256=-RdMmb8afH7F7q4Ao7x6FbwaDfxUHn3hA3WiOgzB-3s,397
107
108
  gllm_inference.build/.gitignore,sha256=aEiIwOuxfzdCmLZe4oB1JsBmCUxwG8x-u-HBCV9JT8E,1
108
- gllm_inference_binary-0.5.34.dist-info/METADATA,sha256=25f0Qk4Wr-hCBMFbHGd2lF1tRqSDdtQIjhIqKw-ds28,5770
109
- gllm_inference_binary-0.5.34.dist-info/WHEEL,sha256=l2aKBREYfqJ7T2ljmr6hUiXPoNvvXF47bG4IHjuSyS4,96
110
- gllm_inference_binary-0.5.34.dist-info/top_level.txt,sha256=FpOjtN80F-qVNgbScXSEyqa0w09FYn6301iq6qt69IQ,15
111
- gllm_inference_binary-0.5.34.dist-info/RECORD,,
109
+ gllm_inference_binary-0.5.35.dist-info/METADATA,sha256=8BM_m-hKxOYbudW-KKFBmrwJOXeMrWKzueq-EZ_KIGo,5770
110
+ gllm_inference_binary-0.5.35.dist-info/WHEEL,sha256=l2aKBREYfqJ7T2ljmr6hUiXPoNvvXF47bG4IHjuSyS4,96
111
+ gllm_inference_binary-0.5.35.dist-info/top_level.txt,sha256=FpOjtN80F-qVNgbScXSEyqa0w09FYn6301iq6qt69IQ,15
112
+ gllm_inference_binary-0.5.35.dist-info/RECORD,,