gllm-inference-binary 0.5.5__cp311-cp311-win_amd64.whl → 0.5.7__cp311-cp311-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of gllm-inference-binary might be problematic. Click here for more details.
- gllm_inference/builder/build_lm_request_processor.pyi +7 -3
- gllm_inference/catalog/lm_request_processor_catalog.pyi +43 -31
- gllm_inference/catalog/prompt_builder_catalog.pyi +16 -19
- gllm_inference/constants.pyi +1 -0
- gllm_inference/em_invoker/azure_openai_em_invoker.pyi +2 -1
- gllm_inference/em_invoker/google_em_invoker.pyi +1 -0
- gllm_inference/em_invoker/langchain_em_invoker.pyi +3 -1
- gllm_inference/em_invoker/openai_compatible_em_invoker.pyi +2 -0
- gllm_inference/em_invoker/openai_em_invoker.pyi +2 -0
- gllm_inference/em_invoker/schema/google.pyi +7 -0
- gllm_inference/em_invoker/schema/langchain.pyi +4 -0
- gllm_inference/em_invoker/schema/openai.pyi +7 -0
- gllm_inference/em_invoker/schema/openai_compatible.pyi +7 -0
- gllm_inference/em_invoker/schema/twelvelabs.pyi +2 -0
- gllm_inference/em_invoker/schema/voyage.pyi +4 -0
- gllm_inference/em_invoker/twelevelabs_em_invoker.pyi +1 -0
- gllm_inference/em_invoker/voyage_em_invoker.pyi +1 -0
- gllm_inference/lm_invoker/anthropic_lm_invoker.pyi +1 -0
- gllm_inference/lm_invoker/azure_openai_lm_invoker.pyi +2 -1
- gllm_inference/lm_invoker/datasaur_lm_invoker.pyi +1 -1
- gllm_inference/lm_invoker/langchain_lm_invoker.pyi +2 -1
- gllm_inference/lm_invoker/openai_compatible_lm_invoker.pyi +1 -0
- gllm_inference/lm_invoker/openai_lm_invoker.pyi +1 -0
- gllm_inference/lm_invoker/schema/anthropic.pyi +2 -0
- gllm_inference/lm_invoker/schema/datasaur.pyi +2 -0
- gllm_inference/lm_invoker/schema/google.pyi +3 -0
- gllm_inference/lm_invoker/schema/langchain.pyi +2 -0
- gllm_inference/lm_invoker/schema/openai_compatible.pyi +2 -0
- gllm_inference.cp311-win_amd64.pyd +0 -0
- gllm_inference.pyi +1 -1
- {gllm_inference_binary-0.5.5.dist-info → gllm_inference_binary-0.5.7.dist-info}/METADATA +1 -1
- {gllm_inference_binary-0.5.5.dist-info → gllm_inference_binary-0.5.7.dist-info}/RECORD +33 -29
- {gllm_inference_binary-0.5.5.dist-info → gllm_inference_binary-0.5.7.dist-info}/WHEEL +0 -0
|
@@ -8,7 +8,7 @@ from typing import Any
|
|
|
8
8
|
|
|
9
9
|
logger: Incomplete
|
|
10
10
|
|
|
11
|
-
def build_lm_request_processor(model_id: str | ModelId, credentials: str | dict[str, Any] | None = None, config: dict[str, Any] | None = None, system_template: str = '', user_template: str = '', output_parser_type: str = 'none') -> LMRequestProcessor:
|
|
11
|
+
def build_lm_request_processor(model_id: str | ModelId, credentials: str | dict[str, Any] | None = None, config: dict[str, Any] | None = None, system_template: str = '', user_template: str = '', key_defaults: dict[str, Any] | None = None, output_parser_type: str = 'none') -> LMRequestProcessor:
|
|
12
12
|
'''Build a language model invoker based on the provided configurations.
|
|
13
13
|
|
|
14
14
|
Args:
|
|
@@ -29,6 +29,9 @@ def build_lm_request_processor(model_id: str | ModelId, credentials: str | dict[
|
|
|
29
29
|
Defaults to an empty string.
|
|
30
30
|
user_template (str): The user prompt template. May contain placeholders enclosed in curly braces `{}`.
|
|
31
31
|
Defaults to an empty string.
|
|
32
|
+
key_defaults (dict[str, str] | None, optional): Default values for the keys in the prompt templates.
|
|
33
|
+
Applied when the corresponding keys are not provided in the runtime input.
|
|
34
|
+
Defaults to None, in which case no default values will be assigned to the keys.
|
|
32
35
|
output_parser_type (str, optional): The type of output parser to use. Supports "json" and "none".
|
|
33
36
|
Defaults to "none".
|
|
34
37
|
|
|
@@ -63,13 +66,14 @@ def build_lm_request_processor(model_id: str | ModelId, credentials: str | dict[
|
|
|
63
66
|
)
|
|
64
67
|
```
|
|
65
68
|
|
|
66
|
-
# With
|
|
69
|
+
# With custom prompt builder configuration
|
|
67
70
|
```python
|
|
68
71
|
lm_request_processor = build_lm_request_processor(
|
|
69
72
|
model_id="openai/gpt-4o-mini",
|
|
70
73
|
credentials="sk-...",
|
|
71
|
-
system_template="Talk like a
|
|
74
|
+
system_template="Talk like a {role}.",
|
|
72
75
|
user_template="{query}",
|
|
76
|
+
key_defaults={"role": "pirate"},
|
|
73
77
|
)
|
|
74
78
|
```
|
|
75
79
|
|
|
@@ -6,6 +6,7 @@ from gllm_inference.request_processor import LMRequestProcessor as LMRequestProc
|
|
|
6
6
|
MODEL_ID_ENV_VAR_REGEX_PATTERN: str
|
|
7
7
|
LM_REQUEST_PROCESSOR_REQUIRED_COLUMNS: Incomplete
|
|
8
8
|
CONFIG_SCHEMA_MAP: Incomplete
|
|
9
|
+
logger: Incomplete
|
|
9
10
|
|
|
10
11
|
class LMRequestProcessorCatalog(BaseCatalog[LMRequestProcessor]):
|
|
11
12
|
'''Loads multiple LM request processors from certain sources.
|
|
@@ -46,17 +47,24 @@ class LMRequestProcessorCatalog(BaseCatalog[LMRequestProcessor]):
|
|
|
46
47
|
|
|
47
48
|
# Example 4: Load from record
|
|
48
49
|
```python
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
50
|
+
records=[
|
|
51
|
+
{
|
|
52
|
+
"name": "answer_question",
|
|
53
|
+
"system_template": (
|
|
54
|
+
"You are helpful assistant.\\n"
|
|
55
|
+
"Answer the following question based on the provided context.\\n"
|
|
56
|
+
"```{context}```"
|
|
57
|
+
),
|
|
58
|
+
"user_template": "{query}",
|
|
59
|
+
"key_defaults": \'{"context": "<default context>"}\',
|
|
60
|
+
"model_id": "openai/gpt-4.1-nano",
|
|
61
|
+
"credentials": "OPENAI_API_KEY",
|
|
62
|
+
"config": "",
|
|
63
|
+
"output_parser_type": "none",
|
|
64
|
+
},
|
|
65
|
+
]
|
|
66
|
+
catalog = LMRequestProcessorCatalog.from_records(records=records)
|
|
67
|
+
lm_request_processor = catalog.answer_question
|
|
60
68
|
```
|
|
61
69
|
|
|
62
70
|
Template Format Example:
|
|
@@ -66,35 +74,39 @@ class LMRequestProcessorCatalog(BaseCatalog[LMRequestProcessor]):
|
|
|
66
74
|
|
|
67
75
|
# Example 2: CSV
|
|
68
76
|
For an example of how a CSV file can be formatted to be loaded using LMRequestProcessorCatalog, see:
|
|
69
|
-
https://drive.google.com/file/d/
|
|
77
|
+
https://drive.google.com/file/d/1_2rSoxh3CR2KZxIyUmpowMrt0Lm0YqAb/view?usp=drive_link
|
|
70
78
|
|
|
71
79
|
Template Explanation:
|
|
72
80
|
The required columns are:
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
81
|
+
1. name (str): The name of the LM request processor.
|
|
82
|
+
2. system_template (str): The system template of the prompt builder.
|
|
83
|
+
3. user_template (str): The user template of the prompt builder.
|
|
84
|
+
4. key_defaults (json_str): The default values for the prompt template keys.
|
|
85
|
+
5. model_id (str): The model ID of the LM invoker.
|
|
86
|
+
6. credentials (str | json_str): The credentials of the LM invoker.
|
|
87
|
+
7. config (json_str): The additional configuration of the LM invoker.
|
|
88
|
+
8. output_parser_type (str): The type of the output parser.
|
|
80
89
|
|
|
81
90
|
Important Notes:
|
|
82
91
|
1. At least one of `system_template` or `user_template` must be filled.
|
|
83
|
-
2.
|
|
84
|
-
|
|
85
|
-
|
|
92
|
+
2. `key_defaults` is optional. If filled, must be a dictionary containing the default values for the
|
|
93
|
+
prompt template keys. These default values will be applied when the corresponding keys are not provided
|
|
94
|
+
in the runtime input. If it is empty, the prompt template keys will not have default values.
|
|
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".
|
|
97
|
+
3.2. Can be partially loaded from the environment variable using the "${ENV_VAR_KEY}" syntax,
|
|
86
98
|
e.g. "azure-openai/${AZURE_ENDPOINT}/${AZURE_DEPLOYMENT}".
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
99
|
+
3.3. For the available model ID formats, see: https://gdplabs.gitbook.io/sdk/resources/supported-models
|
|
100
|
+
4. `credentials` is optional. If it is filled, it can either be:
|
|
101
|
+
4.1. An environment variable name containing the API key (e.g. OPENAI_API_KEY).
|
|
102
|
+
4.2. An environment variable name containing the path to a credentials JSON file
|
|
91
103
|
(e.g. GOOGLE_CREDENTIALS_FILE_PATH). Currently only supported for Google Vertex AI.
|
|
92
|
-
|
|
104
|
+
4.3. A dictionary of credentials, with each value being an environment variable name corresponding to the
|
|
93
105
|
credential (e.g. {"api_key": "OPENAI_API_KEY"}). Currently supported for Bedrock and LangChain.
|
|
94
106
|
If it is empty, the LM invoker will use the default credentials loaded from the environment variables.
|
|
95
|
-
|
|
107
|
+
5. `config` is optional. If filled, must be a dictionary containing the configuration for the LM invoker.
|
|
96
108
|
If it is empty, the LM invoker will use the default configuration.
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
109
|
+
6. `output_parser_type` can either be:
|
|
110
|
+
6.1. none: No output parser will be used.
|
|
111
|
+
6.2. json: The JSONOutputParser will be used.
|
|
100
112
|
'''
|
|
@@ -3,6 +3,7 @@ from gllm_inference.catalog.catalog import BaseCatalog as BaseCatalog
|
|
|
3
3
|
from gllm_inference.prompt_builder.prompt_builder import PromptBuilder as PromptBuilder
|
|
4
4
|
|
|
5
5
|
PROMPT_BUILDER_REQUIRED_COLUMNS: Incomplete
|
|
6
|
+
logger: Incomplete
|
|
6
7
|
|
|
7
8
|
class PromptBuilderCatalog(BaseCatalog[PromptBuilder]):
|
|
8
9
|
'''Loads multiple prompt builders from certain sources.
|
|
@@ -42,22 +43,14 @@ class PromptBuilderCatalog(BaseCatalog[PromptBuilder]):
|
|
|
42
43
|
```python
|
|
43
44
|
records=[
|
|
44
45
|
{
|
|
45
|
-
"name": "
|
|
46
|
-
"system": "You are an AI expert\\nSummarize the following context.\\n\\nContext:\\n```{context}```",
|
|
47
|
-
"user": ""
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
"name": "transform_query",
|
|
51
|
-
"system": "",
|
|
52
|
-
"user": "Transform the following query into a simpler form.\\n\\nQuery:\\n```{query}```"
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
"name": "draft_document",
|
|
46
|
+
"name": "answer_question",
|
|
56
47
|
"system": (
|
|
57
|
-
"You are
|
|
58
|
-
"
|
|
48
|
+
"You are helpful assistant.\\n"
|
|
49
|
+
"Answer the following question based on the provided context.\\n"
|
|
50
|
+
"```{context}```"
|
|
59
51
|
),
|
|
60
|
-
"user": "
|
|
52
|
+
"user": "{query}",
|
|
53
|
+
"key_defaults": \'{"context": "<default context>"}\',
|
|
61
54
|
},
|
|
62
55
|
]
|
|
63
56
|
catalog = PromptBuilderCatalog.from_records(records=records)
|
|
@@ -71,15 +64,19 @@ class PromptBuilderCatalog(BaseCatalog[PromptBuilder]):
|
|
|
71
64
|
|
|
72
65
|
# Example 2: CSV
|
|
73
66
|
For an example of how a CSV file can be formatted to be loaded using PromptBuilderCatalog, see:
|
|
74
|
-
https://drive.google.com/file/d/
|
|
67
|
+
https://drive.google.com/file/d/1KQgddMdbcZBZmroQFtjSl-TKLohq84Fz/view?usp=drive_link
|
|
75
68
|
|
|
76
69
|
|
|
77
70
|
Template explanation:
|
|
78
71
|
The required columns are:
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
72
|
+
1. name (str): The name of the prompt builder.
|
|
73
|
+
2. system (str): The system template of the prompt builder.
|
|
74
|
+
3. user (str): The user template of the prompt builder.
|
|
75
|
+
4. key_defaults (json_str): The default values for the prompt template keys.
|
|
82
76
|
|
|
83
77
|
Important Notes:
|
|
84
|
-
|
|
78
|
+
1. At least one of the `system` and `user` columns must be filled.
|
|
79
|
+
2. `key_defaults` is optional. If filled, must be a dictionary containing the default values for the
|
|
80
|
+
prompt template keys. These default values will be applied when the corresponding keys are not provided
|
|
81
|
+
in the runtime input. If it is empty, the prompt template keys will not have default values.
|
|
85
82
|
'''
|
gllm_inference/constants.pyi
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
from _typeshed import Incomplete
|
|
2
2
|
from gllm_core.utils.retry import RetryConfig as RetryConfig
|
|
3
|
-
from gllm_inference.constants import DEFAULT_AZURE_OPENAI_API_VERSION as DEFAULT_AZURE_OPENAI_API_VERSION
|
|
3
|
+
from gllm_inference.constants import DEFAULT_AZURE_OPENAI_API_VERSION as DEFAULT_AZURE_OPENAI_API_VERSION, INVOKER_PROPAGATED_MAX_RETRIES as INVOKER_PROPAGATED_MAX_RETRIES
|
|
4
4
|
from gllm_inference.em_invoker.openai_em_invoker import OpenAIEMInvoker as OpenAIEMInvoker
|
|
5
|
+
from gllm_inference.em_invoker.schema.openai import Key as Key
|
|
5
6
|
from gllm_inference.schema import ModelId as ModelId, ModelProvider as ModelProvider
|
|
6
7
|
from typing import Any
|
|
7
8
|
|
|
@@ -2,6 +2,7 @@ from _typeshed import Incomplete
|
|
|
2
2
|
from gllm_core.utils.retry import RetryConfig as RetryConfig
|
|
3
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
|
+
from gllm_inference.em_invoker.schema.google import Key as Key
|
|
5
6
|
from gllm_inference.schema import ModelId as ModelId, ModelProvider as ModelProvider, Vector as Vector
|
|
6
7
|
from typing import Any
|
|
7
8
|
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
from _typeshed import Incomplete
|
|
2
|
-
from gllm_core.utils.retry import RetryConfig
|
|
2
|
+
from gllm_core.utils.retry import RetryConfig
|
|
3
|
+
from gllm_inference.constants import INVOKER_DEFAULT_TIMEOUT as INVOKER_DEFAULT_TIMEOUT, INVOKER_PROPAGATED_MAX_RETRIES as INVOKER_PROPAGATED_MAX_RETRIES
|
|
3
4
|
from gllm_inference.em_invoker.em_invoker import BaseEMInvoker as BaseEMInvoker
|
|
5
|
+
from gllm_inference.em_invoker.schema.langchain import Key as Key
|
|
4
6
|
from gllm_inference.schema import ModelId as ModelId, ModelProvider as ModelProvider, Vector as Vector
|
|
5
7
|
from gllm_inference.utils import load_langchain_model as load_langchain_model, parse_model_data as parse_model_data
|
|
6
8
|
from langchain_core.embeddings import Embeddings as Embeddings
|
|
@@ -1,6 +1,8 @@
|
|
|
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
4
|
from gllm_inference.em_invoker.openai_em_invoker import OpenAIEMInvoker as OpenAIEMInvoker
|
|
5
|
+
from gllm_inference.em_invoker.schema.openai_compatible import Key as Key
|
|
4
6
|
from gllm_inference.schema import ModelId as ModelId, ModelProvider as ModelProvider
|
|
5
7
|
from typing import Any
|
|
6
8
|
|
|
@@ -1,6 +1,8 @@
|
|
|
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
4
|
from gllm_inference.em_invoker.em_invoker import BaseEMInvoker as BaseEMInvoker
|
|
5
|
+
from gllm_inference.em_invoker.schema.openai import Key as Key
|
|
4
6
|
from gllm_inference.schema import ModelId as ModelId, ModelProvider as ModelProvider, Vector as Vector
|
|
5
7
|
from typing import Any
|
|
6
8
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from _typeshed import Incomplete
|
|
2
2
|
from gllm_core.utils.retry import RetryConfig as RetryConfig
|
|
3
|
+
from gllm_inference.constants import INVOKER_PROPAGATED_MAX_RETRIES as INVOKER_PROPAGATED_MAX_RETRIES
|
|
3
4
|
from gllm_inference.em_invoker.em_invoker import BaseEMInvoker as BaseEMInvoker
|
|
4
5
|
from gllm_inference.em_invoker.schema.twelvelabs import InputType as InputType, Key as Key, OutputType as OutputType
|
|
5
6
|
from gllm_inference.schema import Attachment as Attachment, AttachmentType as AttachmentType, EMContent as EMContent, ModelId as ModelId, ModelProvider as ModelProvider, Vector as Vector
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from _typeshed import Incomplete
|
|
2
2
|
from gllm_core.utils.retry import RetryConfig as RetryConfig
|
|
3
|
+
from gllm_inference.constants import INVOKER_PROPAGATED_MAX_RETRIES as INVOKER_PROPAGATED_MAX_RETRIES
|
|
3
4
|
from gllm_inference.em_invoker.em_invoker import BaseEMInvoker as BaseEMInvoker
|
|
4
5
|
from gllm_inference.em_invoker.schema.voyage import InputType as InputType, Key as Key
|
|
5
6
|
from gllm_inference.schema import Attachment as Attachment, AttachmentType as AttachmentType, EMContent as EMContent, ModelId as ModelId, ModelProvider as ModelProvider, Vector as Vector
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from _typeshed import Incomplete
|
|
2
2
|
from gllm_core.event import EventEmitter as EventEmitter
|
|
3
3
|
from gllm_core.utils.retry import RetryConfig as RetryConfig
|
|
4
|
+
from gllm_inference.constants import INVOKER_PROPAGATED_MAX_RETRIES as INVOKER_PROPAGATED_MAX_RETRIES
|
|
4
5
|
from gllm_inference.lm_invoker.lm_invoker import BaseLMInvoker as BaseLMInvoker
|
|
5
6
|
from gllm_inference.lm_invoker.schema.anthropic import InputType as InputType, Key as Key, OutputType as OutputType
|
|
6
7
|
from gllm_inference.schema import Attachment as Attachment, AttachmentType as AttachmentType, EmitDataType as EmitDataType, LMOutput as LMOutput, Message as Message, ModelId as ModelId, ModelProvider as ModelProvider, Reasoning as Reasoning, ResponseSchema as ResponseSchema, TokenUsage as TokenUsage, ToolCall as ToolCall, ToolResult as ToolResult
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
from _typeshed import Incomplete
|
|
2
2
|
from gllm_core.utils.retry import RetryConfig as RetryConfig
|
|
3
|
-
from gllm_inference.constants import DEFAULT_AZURE_OPENAI_API_VERSION as DEFAULT_AZURE_OPENAI_API_VERSION
|
|
3
|
+
from gllm_inference.constants import DEFAULT_AZURE_OPENAI_API_VERSION as DEFAULT_AZURE_OPENAI_API_VERSION, INVOKER_PROPAGATED_MAX_RETRIES as INVOKER_PROPAGATED_MAX_RETRIES
|
|
4
4
|
from gllm_inference.lm_invoker.openai_lm_invoker import OpenAILMInvoker as OpenAILMInvoker, ReasoningEffort as ReasoningEffort, ReasoningSummary as ReasoningSummary
|
|
5
|
+
from gllm_inference.lm_invoker.schema.openai import Key as Key
|
|
5
6
|
from gllm_inference.schema import ModelId as ModelId, ModelProvider as ModelProvider, ResponseSchema as ResponseSchema
|
|
6
7
|
from langchain_core.tools import Tool as Tool
|
|
7
8
|
from typing import Any
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from _typeshed import Incomplete
|
|
2
2
|
from gllm_core.event import EventEmitter as EventEmitter
|
|
3
3
|
from gllm_core.utils.retry import RetryConfig as RetryConfig
|
|
4
|
-
from gllm_inference.constants import DOCUMENT_MIME_TYPES as DOCUMENT_MIME_TYPES
|
|
4
|
+
from gllm_inference.constants import DOCUMENT_MIME_TYPES as DOCUMENT_MIME_TYPES, INVOKER_PROPAGATED_MAX_RETRIES as INVOKER_PROPAGATED_MAX_RETRIES
|
|
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
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from _typeshed import Incomplete
|
|
2
2
|
from gllm_core.event import EventEmitter as EventEmitter
|
|
3
|
-
from gllm_core.utils.retry import RetryConfig
|
|
3
|
+
from gllm_core.utils.retry import RetryConfig
|
|
4
|
+
from gllm_inference.constants import INVOKER_DEFAULT_TIMEOUT as INVOKER_DEFAULT_TIMEOUT, INVOKER_PROPAGATED_MAX_RETRIES as INVOKER_PROPAGATED_MAX_RETRIES
|
|
4
5
|
from gllm_inference.lm_invoker.lm_invoker import BaseLMInvoker as BaseLMInvoker
|
|
5
6
|
from gllm_inference.lm_invoker.schema.langchain import InputType as InputType, Key as Key
|
|
6
7
|
from gllm_inference.schema import Attachment as Attachment, AttachmentType as AttachmentType, LMOutput as LMOutput, Message as Message, MessageRole as MessageRole, ModelId as ModelId, ModelProvider as ModelProvider, ResponseSchema as ResponseSchema, TokenUsage as TokenUsage, ToolCall as ToolCall, ToolResult as ToolResult
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from _typeshed import Incomplete
|
|
2
2
|
from gllm_core.event import EventEmitter as EventEmitter
|
|
3
3
|
from gllm_core.utils.retry import RetryConfig as RetryConfig
|
|
4
|
+
from gllm_inference.constants import INVOKER_PROPAGATED_MAX_RETRIES as INVOKER_PROPAGATED_MAX_RETRIES
|
|
4
5
|
from gllm_inference.lm_invoker.lm_invoker import BaseLMInvoker as BaseLMInvoker
|
|
5
6
|
from gllm_inference.lm_invoker.schema.openai_compatible import InputType as InputType, Key as Key, ReasoningEffort as ReasoningEffort
|
|
6
7
|
from gllm_inference.schema import Attachment as Attachment, AttachmentType as AttachmentType, EmitDataType as EmitDataType, LMOutput as LMOutput, Message as Message, MessageRole as MessageRole, ModelId as ModelId, ModelProvider as ModelProvider, Reasoning as Reasoning, ResponseSchema as ResponseSchema, TokenUsage as TokenUsage, ToolCall as ToolCall, ToolResult as ToolResult
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from _typeshed import Incomplete
|
|
2
2
|
from gllm_core.event import EventEmitter as EventEmitter
|
|
3
3
|
from gllm_core.utils.retry import RetryConfig as RetryConfig
|
|
4
|
+
from gllm_inference.constants import INVOKER_PROPAGATED_MAX_RETRIES as INVOKER_PROPAGATED_MAX_RETRIES
|
|
4
5
|
from gllm_inference.lm_invoker.lm_invoker import BaseLMInvoker as BaseLMInvoker
|
|
5
6
|
from gllm_inference.lm_invoker.schema.openai import InputType as InputType, Key as Key, OutputType as OutputType, ReasoningEffort as ReasoningEffort, ReasoningSummary as ReasoningSummary
|
|
6
7
|
from gllm_inference.schema import Attachment as Attachment, AttachmentType as AttachmentType, CodeExecResult as CodeExecResult, EmitDataType as EmitDataType, LMOutput as LMOutput, Message as Message, MessageRole as MessageRole, ModelId as ModelId, ModelProvider as ModelProvider, Reasoning as Reasoning, ResponseSchema as ResponseSchema, TokenUsage as TokenUsage, ToolCall as ToolCall, ToolResult as ToolResult
|
|
@@ -8,6 +8,7 @@ class Key:
|
|
|
8
8
|
ID: str
|
|
9
9
|
INPUT: str
|
|
10
10
|
INPUT_SCHEMA: str
|
|
11
|
+
MAX_RETRIES: str
|
|
11
12
|
MEDIA_TYPE: str
|
|
12
13
|
MAX_TOKENS: str
|
|
13
14
|
NAME: str
|
|
@@ -17,6 +18,7 @@ class Key:
|
|
|
17
18
|
SOURCE: str
|
|
18
19
|
STOP_REASON: str
|
|
19
20
|
SYSTEM: str
|
|
21
|
+
TIMEOUT: str
|
|
20
22
|
THINKING: str
|
|
21
23
|
TOOLS: str
|
|
22
24
|
TOOL_CHOICE: str
|
|
@@ -6,9 +6,12 @@ class Key:
|
|
|
6
6
|
FINISH_REASON: str
|
|
7
7
|
FUNCTION: str
|
|
8
8
|
FUNCTION_CALL: str
|
|
9
|
+
HTTP_OPTIONS: str
|
|
9
10
|
NAME: str
|
|
11
|
+
RETRY_OPTIONS: str
|
|
10
12
|
SYSTEM_INSTRUCTION: str
|
|
11
13
|
THINKING_CONFIG: str
|
|
14
|
+
TIMEOUT: str
|
|
12
15
|
TOOLS: str
|
|
13
16
|
RESPONSE_SCHEMA: str
|
|
14
17
|
RESPONSE_MIME_TYPE: str
|
|
@@ -15,6 +15,7 @@ class Key:
|
|
|
15
15
|
IMAGE_URL: str
|
|
16
16
|
INPUT_AUDIO: str
|
|
17
17
|
JSON_SCHEMA: str
|
|
18
|
+
MAX_RETRIES: str
|
|
18
19
|
MESSAGE: str
|
|
19
20
|
NAME: str
|
|
20
21
|
RESPONSE_FORMAT: str
|
|
@@ -22,6 +23,7 @@ class Key:
|
|
|
22
23
|
SCHEMA: str
|
|
23
24
|
STRICT: str
|
|
24
25
|
TEXT: str
|
|
26
|
+
TIMEOUT: str
|
|
25
27
|
TITLE: str
|
|
26
28
|
TOOLS: str
|
|
27
29
|
TOOL_CALLS: str
|
|
Binary file
|
gllm_inference.pyi
CHANGED
|
@@ -59,6 +59,7 @@ import langchain_core.embeddings
|
|
|
59
59
|
import gllm_inference.utils.load_langchain_model
|
|
60
60
|
import gllm_inference.utils.parse_model_data
|
|
61
61
|
import io
|
|
62
|
+
import httpx
|
|
62
63
|
import twelvelabs
|
|
63
64
|
import base64
|
|
64
65
|
import sys
|
|
@@ -70,7 +71,6 @@ import enum
|
|
|
70
71
|
import http
|
|
71
72
|
import http.HTTPStatus
|
|
72
73
|
import aiohttp
|
|
73
|
-
import httpx
|
|
74
74
|
import requests
|
|
75
75
|
import gllm_inference.schema.ErrorResponse
|
|
76
76
|
import gllm_core.constants
|
|
@@ -2,49 +2,53 @@ gllm_inference/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
2
2
|
gllm_inference/builder/__init__.pyi,sha256=-bw1uDx7CAM7pkvjvb1ZXku9zXlQ7aEAyC83KIn3bz8,506
|
|
3
3
|
gllm_inference/builder/build_em_invoker.pyi,sha256=PGRHlmiQ-GUTDC51PwYFjVkXRxeN0immnaSBOI06Uno,5474
|
|
4
4
|
gllm_inference/builder/build_lm_invoker.pyi,sha256=6dQha47M19hllF5ID5xUeiNPmbWUpKyNbG9D78qFGck,6618
|
|
5
|
-
gllm_inference/builder/build_lm_request_processor.pyi,sha256=
|
|
5
|
+
gllm_inference/builder/build_lm_request_processor.pyi,sha256=0pJINCP4nnXVwuhIbhsaiwzjX8gohQt2oqXFZhTFSUs,4584
|
|
6
6
|
gllm_inference/builder/build_output_parser.pyi,sha256=sgSTrzUmSRxPzUUum0fDU7A3NXYoYhpi6bEx4Q2XMnA,965
|
|
7
7
|
gllm_inference/catalog/__init__.pyi,sha256=HWgPKWIzprpMHRKe_qN9BZSIQhVhrqiyjLjIXwvj1ho,291
|
|
8
8
|
gllm_inference/catalog/catalog.pyi,sha256=eWPqgQKi-SJGHabi_XOTEKpAj96OSRypKsb5ZEC1VWU,4911
|
|
9
|
-
gllm_inference/catalog/lm_request_processor_catalog.pyi,sha256=
|
|
10
|
-
gllm_inference/catalog/prompt_builder_catalog.pyi,sha256=
|
|
11
|
-
gllm_inference/constants.pyi,sha256=
|
|
9
|
+
gllm_inference/catalog/lm_request_processor_catalog.pyi,sha256=GemCEjFRHNChtNOfbyXSVsJiA3klOCAe_X11fnymhYs,5540
|
|
10
|
+
gllm_inference/catalog/prompt_builder_catalog.pyi,sha256=iViWB4SaezzjQY4UY1YxeoXUNxqxa2cTJGaD9JSx4Q8,3279
|
|
11
|
+
gllm_inference/constants.pyi,sha256=xSET67ZCfeVK4a2ji1FZyQxs5DUTIsN7S6H7-F-ewZ0,265
|
|
12
12
|
gllm_inference/em_invoker/__init__.pyi,sha256=eZifmg3ZS3YdFUwbGPTurrfF4oV_MAPvqErJe7oTpZI,882
|
|
13
|
-
gllm_inference/em_invoker/azure_openai_em_invoker.pyi,sha256=
|
|
13
|
+
gllm_inference/em_invoker/azure_openai_em_invoker.pyi,sha256=QimqPII-KN9OgsfH1Iubn_tCHhtWjPQ5rilZoT6Ir-U,4688
|
|
14
14
|
gllm_inference/em_invoker/em_invoker.pyi,sha256=KX4i0xBWR5j6z14nEL6T8at3StKfdf3miQ4xixtYhZk,4424
|
|
15
|
-
gllm_inference/em_invoker/google_em_invoker.pyi,sha256
|
|
15
|
+
gllm_inference/em_invoker/google_em_invoker.pyi,sha256=YJtRJs7bNGNEfTKtj3IVP1XkLcJ3LRmcAC80zzOHxKw,6254
|
|
16
16
|
gllm_inference/em_invoker/langchain/__init__.pyi,sha256=aOTlRvS9aG1tBErjsmhe75s4Sq-g2z9ArfGqNW7QyEs,151
|
|
17
17
|
gllm_inference/em_invoker/langchain/em_invoker_embeddings.pyi,sha256=gEX21gJLngUh9fZo8v6Vbh0gpWFFqS2S-dGNZSrDjFQ,2409
|
|
18
|
-
gllm_inference/em_invoker/langchain_em_invoker.pyi,sha256=
|
|
19
|
-
gllm_inference/em_invoker/openai_compatible_em_invoker.pyi,sha256=
|
|
20
|
-
gllm_inference/em_invoker/openai_em_invoker.pyi,sha256=
|
|
18
|
+
gllm_inference/em_invoker/langchain_em_invoker.pyi,sha256=sFmsRE89MIdnD8g0VSMsdLvtfZL6dfPkUtDhH_WfgLc,2823
|
|
19
|
+
gllm_inference/em_invoker/openai_compatible_em_invoker.pyi,sha256=S5lRg3MeLoenOkeAG079I22kPaFXAFrltSoWcQSDK4I,5070
|
|
20
|
+
gllm_inference/em_invoker/openai_em_invoker.pyi,sha256=1WTuPtu5RlZCUcBHMXR5xEkAufWCHshKA8_JW7oFakE,4321
|
|
21
21
|
gllm_inference/em_invoker/schema/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
22
|
-
gllm_inference/em_invoker/schema/
|
|
23
|
-
gllm_inference/em_invoker/schema/
|
|
24
|
-
gllm_inference/em_invoker/
|
|
25
|
-
gllm_inference/em_invoker/
|
|
22
|
+
gllm_inference/em_invoker/schema/google.pyi,sha256=lPzJ-f18qVar6dctdN4eQWrxWrOFHC9zJ4cuLXXMytw,153
|
|
23
|
+
gllm_inference/em_invoker/schema/langchain.pyi,sha256=JPEqA6naKL64jpW8NEKsEP-V9STY2h8wvyDsFtFEHos,96
|
|
24
|
+
gllm_inference/em_invoker/schema/openai.pyi,sha256=rNRqN62y5wHOKlr4T0n0m41ikAnSrD72CTnoHxo6kEM,146
|
|
25
|
+
gllm_inference/em_invoker/schema/openai_compatible.pyi,sha256=A9MOeBhI-IPuvewOk4YYOAGtgyKohERx6-9cEYtbwvs,157
|
|
26
|
+
gllm_inference/em_invoker/schema/twelvelabs.pyi,sha256=D3F9_1F-UTzE6Ymxj6u0IFdL6OFVGlc7noZJr3iuA6I,389
|
|
27
|
+
gllm_inference/em_invoker/schema/voyage.pyi,sha256=Aqvu6mhFkNb01aXAI5mChLKIgEnFnr-jNKq1lVWB54M,304
|
|
28
|
+
gllm_inference/em_invoker/twelevelabs_em_invoker.pyi,sha256=YGWQNxv3AJ9BpN6HrQSnATiW_p0dRakkqy-JgxNIlf4,5165
|
|
29
|
+
gllm_inference/em_invoker/voyage_em_invoker.pyi,sha256=R8IPBOEhIN84ukof-VkTPxPNbmbkwR_imTa5u6Qyjt0,5235
|
|
26
30
|
gllm_inference/exceptions/__init__.pyi,sha256=2F05RytXZIKaOJScb1pD0O0bATIQHVeEAYYNX4y5N2A,981
|
|
27
31
|
gllm_inference/exceptions/error_parser.pyi,sha256=ggmh8DJXdwFJInNLrP24WVJt_4raxbAVxzXRQgBpndA,2441
|
|
28
32
|
gllm_inference/exceptions/exceptions.pyi,sha256=ViXvIzm7tLcstjqfwC6nPziDg0UAmoUAWZVWrAJyp3w,4763
|
|
29
33
|
gllm_inference/lm_invoker/__init__.pyi,sha256=g-wu6W6ly_WAVPLDWKjt4J5cMo-CJ1x5unuObVSUnug,1115
|
|
30
|
-
gllm_inference/lm_invoker/anthropic_lm_invoker.pyi,sha256=
|
|
31
|
-
gllm_inference/lm_invoker/azure_openai_lm_invoker.pyi,sha256=
|
|
34
|
+
gllm_inference/lm_invoker/anthropic_lm_invoker.pyi,sha256=Jpu7YPr_oUB4WurY3MqDT9J-PgDDRakj7mtrle8S3gE,15038
|
|
35
|
+
gllm_inference/lm_invoker/azure_openai_lm_invoker.pyi,sha256=h71Redwp4a4Ibq3tVTtwM7FUX4AqIlmty4i0Dt8lglk,14788
|
|
32
36
|
gllm_inference/lm_invoker/bedrock_lm_invoker.pyi,sha256=uOppVYAy2G7TnIK_BsRllW0akP3x14zNjrfwVrTSo8I,12530
|
|
33
|
-
gllm_inference/lm_invoker/datasaur_lm_invoker.pyi,sha256=
|
|
37
|
+
gllm_inference/lm_invoker/datasaur_lm_invoker.pyi,sha256=AzjC-zEJt73I9wtgckZAlrlsC97U86cLksbYzO1XDK0,9280
|
|
34
38
|
gllm_inference/lm_invoker/google_lm_invoker.pyi,sha256=a5ALWfhv8zW3go4gC4G-dGjQHbpQwHbSr6wdLiKiCKk,16702
|
|
35
|
-
gllm_inference/lm_invoker/langchain_lm_invoker.pyi,sha256=
|
|
39
|
+
gllm_inference/lm_invoker/langchain_lm_invoker.pyi,sha256=iD_nFw0UGX9AHSEZT57T6e2ft2ApHW4sOKk49BDpBO8,13413
|
|
36
40
|
gllm_inference/lm_invoker/litellm_lm_invoker.pyi,sha256=ye73iH8wXUXzAd87JCjup5wmgVxTNhgbebRNh1hCtjE,13283
|
|
37
41
|
gllm_inference/lm_invoker/lm_invoker.pyi,sha256=1wH81ssLRLLSGdf7CMQ5CZqKLcuJZHmElwBjQwitqfg,7754
|
|
38
|
-
gllm_inference/lm_invoker/openai_compatible_lm_invoker.pyi,sha256=
|
|
39
|
-
gllm_inference/lm_invoker/openai_lm_invoker.pyi,sha256=
|
|
42
|
+
gllm_inference/lm_invoker/openai_compatible_lm_invoker.pyi,sha256=jgeRQPw9IH24NoZ9dN8aW2w29D7Unn4w5L-6dhFX6l0,15125
|
|
43
|
+
gllm_inference/lm_invoker/openai_lm_invoker.pyi,sha256=oXK_-nk3sdFnYIEPGkDCg4UWNyRvvMvVjkj7jozZhRk,19787
|
|
40
44
|
gllm_inference/lm_invoker/schema/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
41
|
-
gllm_inference/lm_invoker/schema/anthropic.pyi,sha256=
|
|
45
|
+
gllm_inference/lm_invoker/schema/anthropic.pyi,sha256=LWhE6th4dpZwk7As11p_rhhvVoPXBsF3oAy5CtTMBrg,1060
|
|
42
46
|
gllm_inference/lm_invoker/schema/bedrock.pyi,sha256=H3attoGWhBA725W4FpXw7Mty46N9jHKjw9PT-0lMEJs,975
|
|
43
|
-
gllm_inference/lm_invoker/schema/datasaur.pyi,sha256=
|
|
44
|
-
gllm_inference/lm_invoker/schema/google.pyi,sha256=
|
|
45
|
-
gllm_inference/lm_invoker/schema/langchain.pyi,sha256=
|
|
47
|
+
gllm_inference/lm_invoker/schema/datasaur.pyi,sha256=GLv6XAwKtWyRrX6EsbEufYjkPffHNiEpXwJOn9HqxMA,242
|
|
48
|
+
gllm_inference/lm_invoker/schema/google.pyi,sha256=elXHrUMS46pbTsulk7hBXVVFcT022iD-_U_I590xeV8,529
|
|
49
|
+
gllm_inference/lm_invoker/schema/langchain.pyi,sha256=uEG0DSD0z4L_rDMkBm-TtUy5oTyEHEEJWiLsYvFf1sw,431
|
|
46
50
|
gllm_inference/lm_invoker/schema/openai.pyi,sha256=CNkIGljwRyQYx0krONX1ik9hwBiN45t9vBk-ZY45rP4,1989
|
|
47
|
-
gllm_inference/lm_invoker/schema/openai_compatible.pyi,sha256=
|
|
51
|
+
gllm_inference/lm_invoker/schema/openai_compatible.pyi,sha256=2KXyTy43SHz0K_hB0WGXVuaHXL7bwYFIzWHZ_jmdDUo,1114
|
|
48
52
|
gllm_inference/model/__init__.pyi,sha256=JKQB0wVSVYD-_tdRkG7N_oEVAKGCcoBw0BUOUMLieFo,602
|
|
49
53
|
gllm_inference/model/em/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
50
54
|
gllm_inference/model/em/google_em.pyi,sha256=c53H-KNdNOK9ppPLyOSkmCA890eF5FsMd05upkPIzF0,487
|
|
@@ -86,8 +90,8 @@ gllm_inference/utils/__init__.pyi,sha256=RBTWDu1TDPpTd17fixcPYFv2L_vp4-IAOX0Isxg
|
|
|
86
90
|
gllm_inference/utils/langchain.pyi,sha256=4AwFiVAO0ZpdgmqeC4Pb5NJwBt8vVr0MSUqLeCdTscc,1194
|
|
87
91
|
gllm_inference/utils/validation.pyi,sha256=-RdMmb8afH7F7q4Ao7x6FbwaDfxUHn3hA3WiOgzB-3s,397
|
|
88
92
|
gllm_inference.build/.gitignore,sha256=aEiIwOuxfzdCmLZe4oB1JsBmCUxwG8x-u-HBCV9JT8E,1
|
|
89
|
-
gllm_inference.cp311-win_amd64.pyd,sha256=
|
|
90
|
-
gllm_inference.pyi,sha256=
|
|
91
|
-
gllm_inference_binary-0.5.
|
|
92
|
-
gllm_inference_binary-0.5.
|
|
93
|
-
gllm_inference_binary-0.5.
|
|
93
|
+
gllm_inference.cp311-win_amd64.pyd,sha256=hYbjt2yhDh_GQb1f8NT0OAIm1xsWyZDWKt3XMvukpt8,2687488
|
|
94
|
+
gllm_inference.pyi,sha256=HPIjsiX3usTXFeStYEslrHJDUtwpBBwl-Exzcf7y7Mc,3295
|
|
95
|
+
gllm_inference_binary-0.5.7.dist-info/METADATA,sha256=5l9vCcKon7_P35hWo6n7VhczO9x6rBULOCosHG3l4sY,4531
|
|
96
|
+
gllm_inference_binary-0.5.7.dist-info/WHEEL,sha256=-FZBVKyKauScY3vLa8vJR6hBCpAJfFykw2MOwlNKr1g,98
|
|
97
|
+
gllm_inference_binary-0.5.7.dist-info/RECORD,,
|
|
File without changes
|