gllm-inference-binary 0.5.5__cp313-cp313-manylinux_2_31_x86_64.whl → 0.5.7__cp313-cp313-manylinux_2_31_x86_64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. gllm_inference/builder/build_lm_request_processor.pyi +7 -3
  2. gllm_inference/catalog/lm_request_processor_catalog.pyi +43 -31
  3. gllm_inference/catalog/prompt_builder_catalog.pyi +16 -19
  4. gllm_inference/constants.pyi +1 -0
  5. gllm_inference/em_invoker/azure_openai_em_invoker.pyi +2 -1
  6. gllm_inference/em_invoker/google_em_invoker.pyi +1 -0
  7. gllm_inference/em_invoker/langchain_em_invoker.pyi +3 -1
  8. gllm_inference/em_invoker/openai_compatible_em_invoker.pyi +2 -0
  9. gllm_inference/em_invoker/openai_em_invoker.pyi +2 -0
  10. gllm_inference/em_invoker/schema/google.pyi +7 -0
  11. gllm_inference/em_invoker/schema/langchain.pyi +4 -0
  12. gllm_inference/em_invoker/schema/openai.pyi +7 -0
  13. gllm_inference/em_invoker/schema/openai_compatible.pyi +7 -0
  14. gllm_inference/em_invoker/schema/twelvelabs.pyi +2 -0
  15. gllm_inference/em_invoker/schema/voyage.pyi +4 -0
  16. gllm_inference/em_invoker/twelevelabs_em_invoker.pyi +1 -0
  17. gllm_inference/em_invoker/voyage_em_invoker.pyi +1 -0
  18. gllm_inference/lm_invoker/anthropic_lm_invoker.pyi +1 -0
  19. gllm_inference/lm_invoker/azure_openai_lm_invoker.pyi +2 -1
  20. gllm_inference/lm_invoker/datasaur_lm_invoker.pyi +1 -1
  21. gllm_inference/lm_invoker/langchain_lm_invoker.pyi +2 -1
  22. gllm_inference/lm_invoker/openai_compatible_lm_invoker.pyi +1 -0
  23. gllm_inference/lm_invoker/openai_lm_invoker.pyi +1 -0
  24. gllm_inference/lm_invoker/schema/anthropic.pyi +2 -0
  25. gllm_inference/lm_invoker/schema/datasaur.pyi +2 -0
  26. gllm_inference/lm_invoker/schema/google.pyi +3 -0
  27. gllm_inference/lm_invoker/schema/langchain.pyi +2 -0
  28. gllm_inference/lm_invoker/schema/openai_compatible.pyi +2 -0
  29. gllm_inference.cpython-313-x86_64-linux-gnu.so +0 -0
  30. gllm_inference.pyi +1 -1
  31. {gllm_inference_binary-0.5.5.dist-info → gllm_inference_binary-0.5.7.dist-info}/METADATA +1 -1
  32. {gllm_inference_binary-0.5.5.dist-info → gllm_inference_binary-0.5.7.dist-info}/RECORD +33 -29
  33. {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 system template
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 pirate.",
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
- catalog = LMRequestProcessorCatalog.from_records(
50
- name="...",
51
- system_template="...",
52
- user_template="...",
53
- model_id="...",
54
- credentials="...",
55
- config="...",
56
- output_parser_type="...",
57
- )
58
-
59
- lm_request_processor = catalog.name
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/10nYKn_r9SVnTkaik-caMqUjX6prUZ62M/view?usp=drive_link
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
- 1. name (str): The name of the LM request processor.
74
- 2. system_template (str): The system template of the prompt builder.
75
- 3. user_template (str): The user template of the prompt builder.
76
- 4. model_id (str): The model ID of the LM invoker.
77
- 5. credentials (str | json_str): The credentials of the LM invoker.
78
- 6. config (json_str): The additional configuration of the LM invoker.
79
- 7. output_parser_type (str): The type of the output parser.
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. The `model_id`:
84
- 2.1. Must be filled with the model ID of the LM invoker, e.g. "openai/gpt-4.1-nano".
85
- 2.2. Can be partially loaded from the environment variable using the "${ENV_VAR_KEY}" syntax,
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
- 2.3. For the available model ID formats, see: https://gdplabs.gitbook.io/sdk/resources/supported-models
88
- 3. `credentials` is optional. If it is filled, it can either be:
89
- 3.1. An environment variable name containing the API key (e.g. OPENAI_API_KEY).
90
- 3.2. An environment variable name containing the path to a credentials JSON file
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
- 3.3. A dictionary of credentials, with each value being an environment variable name corresponding to the
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
- 4. `config` is optional. If filled, must be a dictionary containing the configuration for the LM invoker.
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
- 5. `output_parser_type` can either be:
98
- 5.1. none: No output parser will be used.
99
- 5.2. json: The JSONOutputParser will be used.
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": "summarize",
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 an AI expert.\\nDraft a document following the provided format and context.\\n\\n"
58
- "Format:\\n```{format}```\\n\\nContext:\\n```{context}```"
48
+ "You are helpful assistant.\\n"
49
+ "Answer the following question based on the provided context.\\n"
50
+ "```{context}```"
59
51
  ),
60
- "user": "User instruction:\\n{query}"
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/1CWijOk-g16ZglUn_K2bDPmbyyBDK2r0L/view?usp=drive_link
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
- 1. name (str): The name of the prompt builder.
80
- 2. system (str): The system template of the prompt builder.
81
- 3. user (str): The user template of the prompt builder.
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
- 1. At least one of the `system` and `user` columns must be filled.
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
  '''
@@ -3,6 +3,7 @@ from _typeshed import Incomplete
3
3
  DEFAULT_AZURE_OPENAI_API_VERSION: str
4
4
  DOCUMENT_MIME_TYPES: Incomplete
5
5
  GOOGLE_SCOPES: Incomplete
6
+ INVOKER_PROPAGATED_MAX_RETRIES: int
6
7
  INVOKER_DEFAULT_TIMEOUT: float
7
8
  HEX_REPR_LENGTH: int
8
9
  HTTP_STATUS_CODE_PATTERNS: Incomplete
@@ -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 as 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
 
@@ -0,0 +1,7 @@
1
+ class Key:
2
+ """Defines valid keys in Google."""
3
+ CREDENTIALS: str
4
+ HTTP_OPTIONS: str
5
+ LOCATION: str
6
+ PROJECT: str
7
+ TIMEOUT: str
@@ -0,0 +1,4 @@
1
+ class Key:
2
+ """Defines valid keys in LangChain."""
3
+ MAX_RETRIES: str
4
+ TIMEOUT: str
@@ -0,0 +1,7 @@
1
+ class Key:
2
+ """Defines valid keys in OpenAI."""
3
+ API_KEY: str
4
+ BASE_URL: str
5
+ MAX_RETRIES: str
6
+ MODEL: str
7
+ TIMEOUT: str
@@ -0,0 +1,7 @@
1
+ class Key:
2
+ """Defines valid keys in OpenAI Compatible."""
3
+ API_KEY: str
4
+ BASE_URL: str
5
+ MAX_RETRIES: str
6
+ MODEL: str
7
+ TIMEOUT: str
@@ -1,7 +1,9 @@
1
1
  class Key:
2
2
  """Defines valid keys in TwelveLabs."""
3
3
  INPUT_KEY: str
4
+ MAX_RETRIES: str
4
5
  OUTPUT_KEY: str
6
+ TIMEOUT: str
5
7
  VALUE: str
6
8
 
7
9
  class InputType:
@@ -1,8 +1,12 @@
1
1
  class Key:
2
2
  """Defines valid keys in Voyage."""
3
+ API_KEY: str
3
4
  CONTENT: str
4
5
  IMAGE_BASE64: str
6
+ MAX_RETRIES: str
7
+ MODEL: str
5
8
  TEXT: str
9
+ TIMEOUT: str
6
10
  TYPE: str
7
11
 
8
12
  class InputType:
@@ -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 as 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
@@ -1,7 +1,9 @@
1
1
  class Key:
2
2
  """Defines valid keys in Datasaur."""
3
3
  CONTEXTS: str
4
+ MAX_RETRIES: str
4
5
  NAME: str
6
+ TIMEOUT: str
5
7
  TYPE: str
6
8
  URL: str
7
9
 
@@ -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
@@ -5,11 +5,13 @@ class Key:
5
5
  ID: str
6
6
  IMAGE_URL: str
7
7
  INPUT_TOKENS: str
8
+ MAX_RETRIES: str
8
9
  NAME: str
9
10
  OUTPUT_TOKENS: str
10
11
  PARSED: str
11
12
  RAW: str
12
13
  TEXT: str
14
+ TIMEOUT: str
13
15
  TYPE: str
14
16
  URL: str
15
17
 
@@ -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
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
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: gllm-inference-binary
3
- Version: 0.5.5
3
+ Version: 0.5.7
4
4
  Summary: A library containing components related to model inferences in Gen AI applications.
5
5
  Author: Henry Wicaksono
6
6
  Author-email: henry.wicaksono@gdplabs.id
@@ -2,49 +2,53 @@ gllm_inference/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  gllm_inference/builder/__init__.pyi,sha256=usz2lvfwO4Yk-ZGKXbCWG1cEr3nlQXxMNDNC-2yc1NM,500
3
3
  gllm_inference/builder/build_em_invoker.pyi,sha256=YL71GriZEXn4uxmXBJHWC200QdWRPwUJY_G0kKi5-dk,5352
4
4
  gllm_inference/builder/build_lm_invoker.pyi,sha256=aXdNU1gUBUz-4jZ-P791tlkmjOOInLYyeiveEJFlYZo,6468
5
- gllm_inference/builder/build_lm_request_processor.pyi,sha256=Mi0U3zga29FneTzzLeb_R0k4MM--LrNsl7xU4jd_12Y,4094
5
+ gllm_inference/builder/build_lm_request_processor.pyi,sha256=33Gi3onftl-V2e_mkJios5zmXRKSoAVPX3UK7YBExjk,4491
6
6
  gllm_inference/builder/build_output_parser.pyi,sha256=_Lrq-bh1oPsb_Nwkkr_zyEUwIOMysRFZkvEtEM29LZM,936
7
7
  gllm_inference/catalog/__init__.pyi,sha256=JBkPGTyiiZ30GECzJBW-mW8LekWyY2qyzal3eW7ynaM,287
8
8
  gllm_inference/catalog/catalog.pyi,sha256=a4RNG1lKv51GxQpOqh47tz-PAROMPaeP2o5XNLBSZaU,4790
9
- gllm_inference/catalog/lm_request_processor_catalog.pyi,sha256=wjzufPEqey-byBU3hPWwEawT9c182WwjzSWOJ2bnqIs,4599
10
- gllm_inference/catalog/prompt_builder_catalog.pyi,sha256=o4JSzISjlStBataofZ2MB2_t3wnGTkkFJ3Dm_NSm5qo,3159
11
- gllm_inference/constants.pyi,sha256=A16iMdS6QLnDx7ToiVuu1rSxvEwcr0OMrghPUGQL0L4,220
9
+ gllm_inference/catalog/lm_request_processor_catalog.pyi,sha256=ranHMbG9--DZj9FJRhIUa6U8e-L-Tm-_hSBpzJ6DDs4,5428
10
+ gllm_inference/catalog/prompt_builder_catalog.pyi,sha256=OU8k_4HbqjZEzHZlzSM3uzGQZJmM2uGD76Csqom0CEQ,3197
11
+ gllm_inference/constants.pyi,sha256=gPlwRHKIjUdyQoLdoog8ca76YmjrQL0SCDTEn8UEWSY,256
12
12
  gllm_inference/em_invoker/__init__.pyi,sha256=XESsrYo1PZeeHe7AMRyuzKoV7XDD5oN89ZTH01zRf4k,873
13
- gllm_inference/em_invoker/azure_openai_em_invoker.pyi,sha256=1HgCMcw7Hqv2ah4v9ma1Ioa-PpI-v2g7MfuKxxk2ZPU,4473
13
+ gllm_inference/em_invoker/azure_openai_em_invoker.pyi,sha256=OEkVu5nv92ITqdhDtgDg4MiLSDRWDmLSnAhYtXpCn6E,4602
14
14
  gllm_inference/em_invoker/em_invoker.pyi,sha256=hiH8FB5R-KxhI8Ds2htF3cjRcIcH92yHPcOdpgc4FDo,4341
15
- gllm_inference/em_invoker/google_em_invoker.pyi,sha256=LQDUdsnOrB6ihBh0VdoOZHzFrY5dE3wWgBsl_slr1SI,6067
15
+ gllm_inference/em_invoker/google_em_invoker.pyi,sha256=pn05VdOZXZOffeg89wlAQOBAyHyt6dLaS0Sd6LoH05M,6130
16
16
  gllm_inference/em_invoker/langchain/__init__.pyi,sha256=VYGKE5OgU0my1RlhgzkU_A7-GLGnUDDnNFuctuRwILE,148
17
17
  gllm_inference/em_invoker/langchain/em_invoker_embeddings.pyi,sha256=6nASLqi0FXCpqyYPl7kM3g7hAW-xS5ZwsS3GFudns98,2347
18
- gllm_inference/em_invoker/langchain_em_invoker.pyi,sha256=HSusS_ef5VZ20HPBFe153olueYOGQ57hmKY4406LUcE,2577
19
- gllm_inference/em_invoker/openai_compatible_em_invoker.pyi,sha256=GkoL-Z_Rl5v_NwcbvhUE6quLr6F9KnUB6Sb9Q712hNM,4802
20
- gllm_inference/em_invoker/openai_em_invoker.pyi,sha256=Gdyh93f8Mi3JYqnV1sBnYk1LAZpcsP47JeLjWxqyins,4070
18
+ gllm_inference/em_invoker/langchain_em_invoker.pyi,sha256=lXiTTGcNOIwurZx3_6vWLE1DQyioK8Z1fOcPuUATnxA,2782
19
+ gllm_inference/em_invoker/openai_compatible_em_invoker.pyi,sha256=Qz2Qx1KRKhzXr8IseDWcF_6yC-SNtfsXvQuGuKnqVe8,4978
20
+ gllm_inference/em_invoker/openai_em_invoker.pyi,sha256=SFuS2DsvMHcibxFnpQOOchlZUyNRRlI2uMhVEUfifas,4235
21
21
  gllm_inference/em_invoker/schema/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
22
- gllm_inference/em_invoker/schema/twelvelabs.pyi,sha256=y9nfqvuzs0o1jlZ5bwNmJkMSmvHAwBElWNMU0wJNc64,334
23
- gllm_inference/em_invoker/schema/voyage.pyi,sha256=7d9hv8uCJ4NboRaqK77g5ekb0X78pPW__sz2EYeKJKw,219
24
- gllm_inference/em_invoker/twelevelabs_em_invoker.pyi,sha256=9QctCbM6c9q5eHKIYEwVlhDmzcCysQupiT-4e8hllPE,4964
25
- gllm_inference/em_invoker/voyage_em_invoker.pyi,sha256=17NBfuii3FyBbNtNRT2y6FUMTMsDemanXnY1j_0dmZg,5032
22
+ gllm_inference/em_invoker/schema/google.pyi,sha256=MUmgtjMmjSpzmzaAOx6JGZbcdRxgMUhOpvcVQIo-oGs,146
23
+ gllm_inference/em_invoker/schema/langchain.pyi,sha256=onpZutqa2xw2g8rdJTdycy3ub58lkPBVB3KvVVPpyds,92
24
+ gllm_inference/em_invoker/schema/openai.pyi,sha256=Q_dsEcodkOXYXPdrkOkW0LnuLhfeq8tEbtZAGMz2ajA,139
25
+ gllm_inference/em_invoker/schema/openai_compatible.pyi,sha256=gmvGtsWoOMBelke_tZjC6dKimFBW9f4Vrgv0Ig0OM9Q,150
26
+ gllm_inference/em_invoker/schema/twelvelabs.pyi,sha256=F6wKHgG01bYskJpKoheBSpRpHUfFpteKn9sj9n5YfcU,372
27
+ gllm_inference/em_invoker/schema/voyage.pyi,sha256=HVpor0fqNy-IwapCICfsgFmqf1FJXCOMIxS2vOXhHd8,289
28
+ gllm_inference/em_invoker/twelevelabs_em_invoker.pyi,sha256=6b8oJ8aLNBn45o85dka-Xbq9nWZqtcMgFls39ekEZ6o,5066
29
+ gllm_inference/em_invoker/voyage_em_invoker.pyi,sha256=7akaf8GxOA8Trokad0xmlYKr49rY3Egm3_4gpW-vly8,5134
26
30
  gllm_inference/exceptions/__init__.pyi,sha256=v9uxjW5DssIn7n_bKqT7L83CeqFET2Z45GFOvi78UuE,977
27
31
  gllm_inference/exceptions/error_parser.pyi,sha256=4RkVfS2Fl9kjz_h2bK9eoAeI-Y-VkHcUqXWj68BsYig,2393
28
32
  gllm_inference/exceptions/exceptions.pyi,sha256=5YRackwVNvyOJjOtiVszqu8q87s8ioXTa-XwaYmeiC4,4643
29
33
  gllm_inference/lm_invoker/__init__.pyi,sha256=8oUFgavpItvjRUqsLqLSHqQVIPyTKCgNQ_euf58H2zY,1104
30
- gllm_inference/lm_invoker/anthropic_lm_invoker.pyi,sha256=Ihq8U4w_efN74gf-nDFUY_zXO4Hf4KYZ2YhWcu9MqNA,14663
31
- gllm_inference/lm_invoker/azure_openai_lm_invoker.pyi,sha256=98ecMvAsEKEYNS1HehL3xTKT3MLdI9AfmJVOi9jeHXM,14407
34
+ gllm_inference/lm_invoker/anthropic_lm_invoker.pyi,sha256=wdMwGusPNJ1etEOC9SQrSspCaqtU7w2yVP-gEJhUBO0,14765
35
+ gllm_inference/lm_invoker/azure_openai_lm_invoker.pyi,sha256=cm5dXvbETJsfMWXRCpjGo5DTtDrT6vuO-ZTlljY4bWY,14536
32
36
  gllm_inference/lm_invoker/bedrock_lm_invoker.pyi,sha256=0ZeBJ_PWuFY2dOlON11VsI4BENhFJhK4md-8DwNpcyU,12300
33
- gllm_inference/lm_invoker/datasaur_lm_invoker.pyi,sha256=EzovSc7FXXZLoRrOuA2rFHmBAcBEohoBaUkAFk7hQig,9049
37
+ gllm_inference/lm_invoker/datasaur_lm_invoker.pyi,sha256=m0R95-9dIaopIf5awLNmxs39qNeRHS_HJFBi51JCmK4,9115
34
38
  gllm_inference/lm_invoker/google_lm_invoker.pyi,sha256=dRK3_--UQEBEMkLItav9MeTXp5p-iM-pqzt2JnwocPU,16393
35
- gllm_inference/lm_invoker/langchain_lm_invoker.pyi,sha256=2p-JM7XojIi20wxKvu1n6eJWVeQz6P069M3Quoe5ViE,13018
39
+ gllm_inference/lm_invoker/langchain_lm_invoker.pyi,sha256=jKyq1l4MyHNyi1Or4aWO0QLIX74_PttuNlSX8vPQyeA,13157
36
40
  gllm_inference/lm_invoker/litellm_lm_invoker.pyi,sha256=ad_tVyOjATiFyYF-f_1vX2Sl4BXy-fDXEW_D8fD1Db8,13037
37
41
  gllm_inference/lm_invoker/lm_invoker.pyi,sha256=XvcR2AAH_vnIdZ3cgDer59ZT724mW22_OSF8mpeo_kk,7610
38
- gllm_inference/lm_invoker/openai_compatible_lm_invoker.pyi,sha256=gHYFz7S8kTq1qkh-kqXOxkBAydUWxXJyoyNkL90Kvig,14759
39
- gllm_inference/lm_invoker/openai_lm_invoker.pyi,sha256=EsWW-XPmpmQ_27jFezJgT5lbpQf1Hj4O6MCvN63M3v0,19325
42
+ gllm_inference/lm_invoker/openai_compatible_lm_invoker.pyi,sha256=-_9HW5ZpUUIAOTwdG1RAoWWRF712SPLhG1nbsQ_mShg,14861
43
+ gllm_inference/lm_invoker/openai_lm_invoker.pyi,sha256=AugnEKSOtnupKDymAGrTihz14KhOxPigHmS143M4AuE,19427
40
44
  gllm_inference/lm_invoker/schema/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
41
- gllm_inference/lm_invoker/schema/anthropic.pyi,sha256=Y7NAjB7H0Wmiwv3YGZuG83K1rOCjSDB6hoZ6LjndWss,971
45
+ gllm_inference/lm_invoker/schema/anthropic.pyi,sha256=aftRPzTw-f2Qi32KABXEz0b8Lzza7EvDjQfiwJco1VE,1009
42
46
  gllm_inference/lm_invoker/schema/bedrock.pyi,sha256=FOUMZkBi6KRa__mYoy3FNJ5sP0EC6rgLuhoijnwelIg,927
43
- gllm_inference/lm_invoker/schema/datasaur.pyi,sha256=zi1aC2SHm4U54PPLuWIbFxdvTDuguhd4CGMOwziu0Ss,192
44
- gllm_inference/lm_invoker/schema/google.pyi,sha256=ZwEAo30lif7v1EgpwmKng6rzCPxPyUypyKBYkvLjJJE,443
45
- gllm_inference/lm_invoker/schema/langchain.pyi,sha256=-0JIiMFofXoHDoMtpaFUOysvrPGJBvjDFcNeomnWTSY,371
47
+ gllm_inference/lm_invoker/schema/datasaur.pyi,sha256=aA4DhTXIezwLvFzphR24a5ueVln2FCBIloP9Hbt3iz4,230
48
+ gllm_inference/lm_invoker/schema/google.pyi,sha256=AIsNgq0ZZuicHmx4bL7z6q-946T05nWts3HUeA8hhHQ,505
49
+ gllm_inference/lm_invoker/schema/langchain.pyi,sha256=l2kHU7S3vmG3-NCt8B26krp_i4Br3waES_CekkgrKSA,409
46
50
  gllm_inference/lm_invoker/schema/openai.pyi,sha256=YogOvOZqPuWkNyfcvyzaxi-Bu7UMfcoRzk4gWtkPG08,1899
47
- gllm_inference/lm_invoker/schema/openai_compatible.pyi,sha256=iNaiEjYe_uQnhLdkp0XMhw-D1BCZR2qQZAwgMAM49us,1022
51
+ gllm_inference/lm_invoker/schema/openai_compatible.pyi,sha256=LlZsjxGf5idMQ1G1gLF-AClpch7ACPVvTA6Snq8pf1M,1060
48
52
  gllm_inference/model/__init__.pyi,sha256=qClHIgljqhPPCKlGTKmHsWgYb4_hADybxtC2q1U8a5Q,593
49
53
  gllm_inference/model/em/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
50
54
  gllm_inference/model/em/google_em.pyi,sha256=ZPN5LmReO0bcTfnZixFooUTzgD-daNFPzfxzZ-5WzQQ,471
@@ -86,8 +90,8 @@ gllm_inference/utils/__init__.pyi,sha256=npmBmmlBv7cPHMg1hdL3S2_RelD6vk_LhCsGELh
86
90
  gllm_inference/utils/langchain.pyi,sha256=VluQiHkGigDdqLUbhB6vnXiISCP5hHqV0qokYY6dC1A,1164
87
91
  gllm_inference/utils/validation.pyi,sha256=toxBtRp-VItC_X7sNi-GDd7sjibBdWMrR0q01OI2D7k,385
88
92
  gllm_inference.build/.gitignore,sha256=aEiIwOuxfzdCmLZe4oB1JsBmCUxwG8x-u-HBCV9JT8E,1
89
- gllm_inference.cpython-313-x86_64-linux-gnu.so,sha256=78tK6WVfJB74YyNsPx2RKbXvggLn6hnekiYnM8LpYFY,3899848
90
- gllm_inference.pyi,sha256=xOoh8lTQxXc6A4XYKBobWn8RJNszAlinAmbHPJyqi30,3315
91
- gllm_inference_binary-0.5.5.dist-info/METADATA,sha256=S9vLvAj1-yAb0qsT4OWsW2J6gHgJxgoIejXF_lRnoEU,4531
92
- gllm_inference_binary-0.5.5.dist-info/WHEEL,sha256=qGYSeeDMRvGsNMRKS15OK05VQRV6Z0DMQkqDjYiypg0,110
93
- gllm_inference_binary-0.5.5.dist-info/RECORD,,
93
+ gllm_inference.cpython-313-x86_64-linux-gnu.so,sha256=RR-BNblfeJ7ln9jpcIGIcKx9tgSw87zIrO4_KNnUB5A,3957416
94
+ gllm_inference.pyi,sha256=nZrexPebvXto11VCMpLhlbjUnuV_e4qk96992EjXDDM,3315
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=qGYSeeDMRvGsNMRKS15OK05VQRV6Z0DMQkqDjYiypg0,110
97
+ gllm_inference_binary-0.5.7.dist-info/RECORD,,