gllm-inference-binary 0.5.56__cp313-cp313-macosx_13_0_arm64.whl → 0.5.58__cp313-cp313-macosx_13_0_arm64.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.

@@ -31,10 +31,10 @@ class GoogleLMInvoker(BaseLMInvoker):
31
31
  structured response as defined by the schema. Supports both Pydantic BaseModel and JSON schema dictionary.
32
32
  output_analytics (bool): Whether to output the invocation analytics.
33
33
  retry_config (RetryConfig | None): The retry configuration for the language model.
34
- generate_image (bool): Whether to generate image. Only allowed for image generation models.
35
34
  thinking (bool): Whether to enable thinking. Only allowed for thinking models.
36
35
  thinking_budget (int): The tokens allowed for thinking process. Only allowed for thinking models.
37
36
  If set to -1, the model will control the budget automatically.
37
+ image_generation (bool): Whether to generate image. Only allowed for image generation models.
38
38
 
39
39
  Basic usage:
40
40
  The `GoogleLMInvoker` can be used as follows:
@@ -262,7 +262,7 @@ class GoogleLMInvoker(BaseLMInvoker):
262
262
  ```
263
263
  '''
264
264
  client_params: Incomplete
265
- generate_image: Incomplete
265
+ image_generation: Incomplete
266
266
  thinking: Incomplete
267
267
  thinking_budget: Incomplete
268
268
  def __init__(self, model_name: str, api_key: str | None = None, credentials_path: str | None = None, project_id: str | None = None, location: str = 'us-central1', model_kwargs: dict[str, Any] | None = None, default_hyperparameters: dict[str, Any] | None = None, tools: list[Tool | LangChainTool] | None = None, response_schema: ResponseSchema | None = None, output_analytics: bool = False, retry_config: RetryConfig | None = None, thinking: bool | None = None, thinking_budget: int = ..., simplify_events: bool = False) -> None:
@@ -36,6 +36,7 @@ class OpenAILMInvoker(BaseLMInvoker):
36
36
  for non-reasoning models. If None, the model will perform medium reasoning effort.
37
37
  reasoning_summary (ReasoningSummary | None): The reasoning summary level for reasoning models. Not allowed
38
38
  for non-reasoning models. If None, no summary will be generated.
39
+ image_generation (bool): Whether to enable image generation.
39
40
  mcp_servers (list[MCPServer]): The list of MCP servers to enable MCP tool calling.
40
41
  code_interpreter (bool): Whether to enable the code interpreter.
41
42
  web_search (bool): Whether to enable the web search.
@@ -123,6 +124,35 @@ class OpenAILMInvoker(BaseLMInvoker):
123
124
 
124
125
  When structured output is enabled, streaming is disabled.
125
126
 
127
+ Image generation:
128
+ The `OpenAILMInvoker` can be configured to generate images.
129
+ This feature can be enabled by setting the `image_generation` parameter to `True`.
130
+
131
+ Image outputs are stored in the `outputs` attribute of the `LMOutput` object and can be accessed
132
+ via the `attachments` property.
133
+
134
+ Usage example:
135
+ ```python
136
+ lm_invoker = OpenAILMInvoker(..., image_generation=True)
137
+ result = await lm_invoker.invoke("Create a picture...")
138
+ result.attachments[0].write_to_file("path/to/local/image.png")
139
+ ```
140
+
141
+ Output example:
142
+ ```python
143
+ LMOutput(
144
+ outputs=[
145
+ LMOutputItem(
146
+ type="attachment",
147
+ output=Attachment(filename="image.png", mime_type="image/png", data=b"..."),
148
+ ),
149
+ ],
150
+ )
151
+ ```
152
+
153
+ When image generation is enabled, streaming is disabled.
154
+ Image generation is only available for certain models.
155
+
126
156
  Tool calling:
127
157
  The `OpenAILMInvoker` can be configured to call tools to perform certain tasks.
128
158
  This feature can be enabled by providing a list of `Tool` objects to the `tools` parameter.
@@ -354,7 +384,7 @@ class OpenAILMInvoker(BaseLMInvoker):
354
384
  ```
355
385
  '''
356
386
  client_kwargs: Incomplete
357
- 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, simplify_events: bool = False) -> None:
387
+ 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, image_generation: bool = False, mcp_servers: list[MCPServer] | None = None, code_interpreter: bool = False, web_search: bool = False, simplify_events: bool = False) -> None:
358
388
  '''Initializes a new instance of the OpenAILMInvoker class.
359
389
 
360
390
  Args:
@@ -379,6 +409,7 @@ class OpenAILMInvoker(BaseLMInvoker):
379
409
  for non-reasoning models. If None, the model will perform medium reasoning effort. Defaults to None.
380
410
  reasoning_summary (ReasoningSummary | None, optional): The reasoning summary level for reasoning models.
381
411
  Not allowed for non-reasoning models. If None, no summary will be generated. Defaults to None.
412
+ image_generation (bool, optional): Whether to enable image generation. Defaults to False.
382
413
  mcp_servers (list[MCPServer] | None, optional): The MCP servers containing tools to be accessed by the
383
414
  language model. Defaults to None.
384
415
  code_interpreter (bool, optional): Whether to enable the code interpreter. Defaults to False.
@@ -18,6 +18,7 @@ class Key:
18
18
  FILENAME: str
19
19
  FORMAT: str
20
20
  ID: str
21
+ IMAGE_GENERATION_CALL: str
21
22
  IMAGE_URL: str
22
23
  INCLUDE: str
23
24
  INCOMPLETE_DETAILS: str
@@ -54,6 +55,7 @@ class InputType:
54
55
  FUNCTION: str
55
56
  FUNCTION_CALL: str
56
57
  FUNCTION_CALL_OUTPUT: str
58
+ IMAGE_GENERATION: str
57
59
  INPUT_FILE: str
58
60
  INPUT_IMAGE: str
59
61
  INPUT_TEXT: str
@@ -1,7 +1,9 @@
1
1
  from _typeshed import Incomplete
2
2
  from pydantic import BaseModel
3
+ from typing import Any
3
4
 
4
5
  HEX_REPR_LENGTH: int
6
+ METADATA_ITEM_REPR_LENGTH: int
5
7
  logger: Incomplete
6
8
 
7
9
  class Attachment(BaseModel):
@@ -13,68 +15,80 @@ class Attachment(BaseModel):
13
15
  mime_type (str): The mime type of the file attachment.
14
16
  extension (str): The extension of the file attachment.
15
17
  url (str | None): The URL of the file attachment. Defaults to None.
18
+ metadata (dict[str, Any]): The metadata of the file attachment. Defaults to an empty dictionary.
16
19
  """
17
20
  data: bytes
18
21
  filename: str
19
22
  mime_type: str
20
23
  extension: str
21
24
  url: str | None
25
+ metadata: dict[str, Any]
22
26
  @classmethod
23
- def from_bytes(cls, bytes: bytes, filename: str | None = None) -> Attachment:
27
+ def from_bytes(cls, bytes: bytes, filename: str | None = None, metadata: dict[str, Any] | None = None) -> Attachment:
24
28
  """Creates an Attachment from bytes.
25
29
 
26
30
  Args:
27
31
  bytes (bytes): The bytes of the file.
28
32
  filename (str | None, optional): The filename of the file. Defaults to None,
29
33
  in which case the filename will be derived from the extension.
34
+ metadata (dict[str, Any] | None, optional): The metadata of the file attachment. Defaults to None,
35
+ in which case an empty dictionary will be used.
30
36
 
31
37
  Returns:
32
38
  Attachment: The instantiated Attachment.
33
39
  """
34
40
  @classmethod
35
- def from_base64(cls, base64_data: str, filename: str | None = None) -> Attachment:
41
+ def from_base64(cls, base64_data: str, filename: str | None = None, metadata: dict[str, Any] | None = None) -> Attachment:
36
42
  """Creates an Attachment from a base64 string.
37
43
 
38
44
  Args:
39
45
  base64_data (str): The base64 string of the file.
40
46
  filename (str | None, optional): The filename of the file. Defaults to None,
41
47
  in which case the filename will be derived from the mime type.
48
+ metadata (dict[str, Any] | None, optional): The metadata of the file attachment. Defaults to None,
49
+ in which case an empty dictionary will be used.
42
50
 
43
51
  Returns:
44
52
  Attachment: The instantiated Attachment.
45
53
  """
46
54
  @classmethod
47
- def from_data_url(cls, data_url: str, filename: str | None = None) -> Attachment:
55
+ def from_data_url(cls, data_url: str, filename: str | None = None, metadata: dict[str, Any] | None = None) -> Attachment:
48
56
  """Creates an Attachment from a data URL (data:[mime/type];base64,[bytes]).
49
57
 
50
58
  Args:
51
59
  data_url (str): The data URL of the file.
52
60
  filename (str | None, optional): The filename of the file. Defaults to None,
53
61
  in which case the filename will be derived from the mime type.
62
+ metadata (dict[str, Any] | None, optional): The metadata of the file attachment. Defaults to None,
63
+ in which case an empty dictionary will be used.
54
64
 
55
65
  Returns:
56
66
  Attachment: The instantiated Attachment.
57
67
  """
58
68
  @classmethod
59
- def from_url(cls, url: str, filename: str | None = None) -> Attachment:
69
+ def from_url(cls, url: str, filename: str | None = None, metadata: dict[str, Any] | None = None) -> Attachment:
60
70
  """Creates an Attachment from a URL.
61
71
 
62
72
  Args:
63
73
  url (str): The URL of the file.
64
74
  filename (str | None, optional): The filename of the file. Defaults to None,
65
75
  in which case the filename will be derived from the URL.
76
+ metadata (dict[str, Any] | None, optional): The metadata of the file attachment. Defaults to None,
77
+ in which case an empty dictionary will be used.
66
78
 
67
79
  Returns:
68
80
  Attachment: The instantiated Attachment.
69
81
  """
70
82
  @classmethod
71
- def from_path(cls, path: str, filename: str | None = None) -> Attachment:
83
+ def from_path(cls, path: str, filename: str | None = None, metadata: dict[str, Any] | None = None) -> Attachment:
72
84
  """Creates an Attachment from a path.
73
85
 
74
86
  Args:
75
87
  path (str): The path to the file.
76
88
  filename (str | None, optional): The filename of the file. Defaults to None,
77
89
  in which case the filename will be derived from the path.
90
+ metadata (dict[str, Any] | None, optional): The metadata of the file attachment. Defaults to None,
91
+ in which case an empty dictionary will be used.
78
92
 
79
93
  Returns:
80
94
  Attachment: The instantiated Attachment.
Binary file
gllm_inference.pyi CHANGED
@@ -148,6 +148,7 @@ import pathlib.Path
148
148
  import filetype
149
149
  import magic
150
150
  import requests
151
+ import gllm_core.schema.chunk
151
152
  import binascii
152
153
  import fnmatch
153
154
  import importlib
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: gllm-inference-binary
3
- Version: 0.5.56
3
+ Version: 0.5.58
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,5 +1,5 @@
1
- gllm_inference.cpython-313-darwin.so,sha256=G2mH5VqKXO0vOcTGxSDAEI3n_psrWzlB1o2MmbxOf28,5096152
2
- gllm_inference.pyi,sha256=U5ETTUzO_5DKsg4Zp7WQ-rnG_RJKCAqKaf6FoNNw2m4,5067
1
+ gllm_inference.cpython-313-darwin.so,sha256=P4e3EN-ePqx7BLwKhldK1qCLGm0vGnm7Nlaok100Z1Y,5148088
2
+ gllm_inference.pyi,sha256=9Q306Q-5LNldZnCgffJF11yHsCsqaHQwd3jpHw2tH48,5097
3
3
  gllm_inference/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  gllm_inference/constants.pyi,sha256=tBFhwE1at2gXMJ1bBM32eVIRgCJlB1uzg7ItXGx3RQE,316
5
5
  gllm_inference/builder/__init__.pyi,sha256=usz2lvfwO4Yk-ZGKXbCWG1cEr3nlQXxMNDNC-2yc1NM,500
@@ -45,13 +45,13 @@ gllm_inference/lm_invoker/anthropic_lm_invoker.pyi,sha256=oU0dzg87OHTVPGhKBT8Wdc
45
45
  gllm_inference/lm_invoker/azure_openai_lm_invoker.pyi,sha256=drtMgbDzBQJrWXLiI2t5PNy7HtcW5Kuj0XR2b6rltjc,12936
46
46
  gllm_inference/lm_invoker/bedrock_lm_invoker.pyi,sha256=9Gz0U2c94UM9SOt-_e89_NqT_bDQ6wECRiJ9VTwsqfw,10739
47
47
  gllm_inference/lm_invoker/datasaur_lm_invoker.pyi,sha256=IqvDxBzwEf2z34FZcLKIH404y386Rnk5gsj2TcAm424,7878
48
- gllm_inference/lm_invoker/google_lm_invoker.pyi,sha256=-trlpAmc5APGohAmVAsRytTVQ2ODRCmRtRm3EKiOR2Q,16359
48
+ gllm_inference/lm_invoker/google_lm_invoker.pyi,sha256=wWnLHY-Q9Id6E5al4Wy57gIViTIJ-R-ZjLK1SFnESZw,16363
49
49
  gllm_inference/lm_invoker/langchain_lm_invoker.pyi,sha256=OzISl89C2s-qB6VxNlMgf5dFRC-ooj30YCFfsZzcX4s,11887
50
50
  gllm_inference/lm_invoker/litellm_lm_invoker.pyi,sha256=0PZYitAljAjzyympqqNyN5fMyoakmqr1XIz1PE6NNc4,11176
51
51
  gllm_inference/lm_invoker/lm_invoker.pyi,sha256=pJ0-s37NqTHdFD7IijvNzJnQ7JXgrGxsEaXuS8cxz3s,8487
52
52
  gllm_inference/lm_invoker/openai_chat_completions_lm_invoker.pyi,sha256=47lMyuzWKn57Ndt124-zzl9kKHa7IYzDu51iRdUPg6c,13636
53
53
  gllm_inference/lm_invoker/openai_compatible_lm_invoker.pyi,sha256=i5pMpZf4-r_7FQ1qfsqcjpc98sI-cPiqheuTfTEKxJs,4192
54
- gllm_inference/lm_invoker/openai_lm_invoker.pyi,sha256=ozEzhM-LSsKnJtiTkon2iuOvDcl8e2TzCF9hye6DgHo,21094
54
+ gllm_inference/lm_invoker/openai_lm_invoker.pyi,sha256=OytpncpkOLdaSyFQ41GLh4_MioEbpsX0WiA8zc70Q6s,22313
55
55
  gllm_inference/lm_invoker/portkey_lm_invoker.pyi,sha256=ewxzRT-ekmvCFeb7ij840s4p18AO_LAKA-UP0ot12hs,14940
56
56
  gllm_inference/lm_invoker/xai_lm_invoker.pyi,sha256=SVIsRGcqbRnR9sqoLYWwigoEumDib5m4cTaTJT98Uz4,12765
57
57
  gllm_inference/lm_invoker/batch/__init__.pyi,sha256=W4W-_yfk7lL20alREJai6GnwuQvdlKRfwQCX4mQK4XI,127
@@ -62,7 +62,7 @@ gllm_inference/lm_invoker/schema/bedrock.pyi,sha256=FJLY-ZkkLUYDV48pfsLatnot4ev_
62
62
  gllm_inference/lm_invoker/schema/datasaur.pyi,sha256=WSuwOqL1j2ZioCZFC-gbB7vTRIZHQ3sU40c3ool5L6c,265
63
63
  gllm_inference/lm_invoker/schema/google.pyi,sha256=AIsNgq0ZZuicHmx4bL7z6q-946T05nWts3HUeA8hhHQ,505
64
64
  gllm_inference/lm_invoker/schema/langchain.pyi,sha256=rZcIxuvABI4pKfyVvkRBRqfJJogZ67EFPydpubHt49c,429
65
- gllm_inference/lm_invoker/schema/openai.pyi,sha256=J_rT5Z3rx0hLIae-me1ENeemOESpavcRmYI5pgpkhhk,2222
65
+ gllm_inference/lm_invoker/schema/openai.pyi,sha256=PS4QrNYa1NPq0s-3r8FI22a2Td0n70UONLxPn8rP_s4,2279
66
66
  gllm_inference/lm_invoker/schema/openai_chat_completions.pyi,sha256=8byBRZ4xyTidIQJsZqiSjp5t1X875Obe-aEbT0yYfuA,1199
67
67
  gllm_inference/lm_invoker/schema/portkey.pyi,sha256=NeRjHNd84HgE_ur2F3Cv6Jx30v6V7eQvI_iJiq4kuME,631
68
68
  gllm_inference/lm_invoker/schema/xai.pyi,sha256=cWnbJmDtllqRH3NXpQbiXgkNBcUXr8ksDSDywcgJebE,632
@@ -111,7 +111,7 @@ gllm_inference/request_processor/lm_request_processor.pyi,sha256=VnYc8E3Iayyhw-r
111
111
  gllm_inference/request_processor/uses_lm_mixin.pyi,sha256=Yu0XPNuHxq1tWBviHTPw1oThojneFwGHepvGjBXxKQA,6382
112
112
  gllm_inference/schema/__init__.pyi,sha256=hgRrwTocQ8b5MDDosSQN8zEuarGckpVply1OwEbrd28,2404
113
113
  gllm_inference/schema/activity.pyi,sha256=JnO2hqj91P5Tc6qb4pbkEMrHer2u5owiCvhl-igcQKQ,2303
114
- gllm_inference/schema/attachment.pyi,sha256=EHV3uPB3lVZCMNxySVuIoB6ikAiY7THSNh77q3ZtkVY,3246
114
+ gllm_inference/schema/attachment.pyi,sha256=oCopoxiPgGSkCRdPsqmjcMofTawfbdCDxaPdo6mits0,4509
115
115
  gllm_inference/schema/code_exec_result.pyi,sha256=ZTHh6JtRrPIdQ059P1UAiD2L-tAO1_S5YcMsAXfJ5A0,559
116
116
  gllm_inference/schema/config.pyi,sha256=rAL_UeXyQeXVk1P2kqd8vFWOMwmKenfpQLtvMP74t9s,674
117
117
  gllm_inference/schema/enums.pyi,sha256=jByrR0Y84-WZ3KDPUjuOyfecouUATyO-A8rdehKPjgs,2065
@@ -131,7 +131,7 @@ gllm_inference/utils/io_utils.pyi,sha256=7kUTacHAVRYoemFUOjCH7-Qmw-YsQGd6rGYxjf_
131
131
  gllm_inference/utils/langchain.pyi,sha256=VluQiHkGigDdqLUbhB6vnXiISCP5hHqV0qokYY6dC1A,1164
132
132
  gllm_inference/utils/validation.pyi,sha256=W9RQddN90F8SJMu_HXEQyQTDMBaRL-bo7fOosZWK7oY,438
133
133
  gllm_inference.build/.gitignore,sha256=aEiIwOuxfzdCmLZe4oB1JsBmCUxwG8x-u-HBCV9JT8E,1
134
- gllm_inference_binary-0.5.56.dist-info/METADATA,sha256=vKhH6vbkKt1WpwohvNIvdcimJOxY461J8YuyQCfGGwY,5807
135
- gllm_inference_binary-0.5.56.dist-info/WHEEL,sha256=t5_2FPbm0tV7_MDNYR2NrQvum0LVPlNiR9hm8r8eRow,104
136
- gllm_inference_binary-0.5.56.dist-info/top_level.txt,sha256=FpOjtN80F-qVNgbScXSEyqa0w09FYn6301iq6qt69IQ,15
137
- gllm_inference_binary-0.5.56.dist-info/RECORD,,
134
+ gllm_inference_binary-0.5.58.dist-info/METADATA,sha256=U4QyZwGb202JFrbdtJwPcdUZ3Hh3gT0g8YzFjH8HeVI,5807
135
+ gllm_inference_binary-0.5.58.dist-info/WHEEL,sha256=t5_2FPbm0tV7_MDNYR2NrQvum0LVPlNiR9hm8r8eRow,104
136
+ gllm_inference_binary-0.5.58.dist-info/top_level.txt,sha256=FpOjtN80F-qVNgbScXSEyqa0w09FYn6301iq6qt69IQ,15
137
+ gllm_inference_binary-0.5.58.dist-info/RECORD,,