gllm-inference-binary 0.5.62__cp312-cp312-win_amd64.whl → 0.5.64__cp312-cp312-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/lm_invoker/openai_lm_invoker.pyi +3 -0
- gllm_inference/lm_invoker/schema/openai.pyi +1 -0
- gllm_inference/prompt_builder/prompt_builder.pyi +6 -2
- gllm_inference/schema/__init__.pyi +2 -1
- gllm_inference/schema/formatter.pyi +31 -0
- gllm_inference.cp312-win_amd64.pyd +0 -0
- gllm_inference.pyi +1 -0
- {gllm_inference_binary-0.5.62.dist-info → gllm_inference_binary-0.5.64.dist-info}/METADATA +2 -2
- {gllm_inference_binary-0.5.62.dist-info → gllm_inference_binary-0.5.64.dist-info}/RECORD +11 -10
- {gllm_inference_binary-0.5.62.dist-info → gllm_inference_binary-0.5.64.dist-info}/WHEEL +0 -0
- {gllm_inference_binary-0.5.62.dist-info → gllm_inference_binary-0.5.64.dist-info}/top_level.txt +0 -0
|
@@ -7,6 +7,9 @@ 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 ActivityEvent as ActivityEvent, Attachment as Attachment, AttachmentType as AttachmentType, CodeEvent as CodeEvent, CodeExecResult as CodeExecResult, LMOutput as LMOutput, MCPCall as MCPCall, MCPCallActivity as MCPCallActivity, MCPListToolsActivity as MCPListToolsActivity, MCPServer as MCPServer, Message as Message, MessageRole as MessageRole, ModelId as ModelId, ModelProvider as ModelProvider, Reasoning as Reasoning, ResponseSchema as ResponseSchema, ThinkingEvent as ThinkingEvent, TokenUsage as TokenUsage, ToolCall as ToolCall, ToolResult as ToolResult, WebSearchActivity as WebSearchActivity
|
|
9
9
|
from langchain_core.tools import Tool as LangChainTool
|
|
10
|
+
from openai import AsyncStream as AsyncStream
|
|
11
|
+
from openai.types.responses import Response as Response, ResponseFunctionWebSearch as ResponseFunctionWebSearch, ResponseOutputItem as ResponseOutputItem
|
|
12
|
+
from openai.types.responses.response_output_item import McpCall as McpCall, McpListTools as McpListTools
|
|
10
13
|
from typing import Any
|
|
11
14
|
|
|
12
15
|
SUPPORTED_ATTACHMENTS: Incomplete
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from _typeshed import Incomplete
|
|
2
2
|
from gllm_inference.prompt_builder.format_strategy import JinjaFormatStrategy as JinjaFormatStrategy, StringFormatStrategy as StringFormatStrategy
|
|
3
|
-
from gllm_inference.schema import JinjaEnvType as JinjaEnvType, Message as Message, MessageContent as MessageContent, MessageRole as MessageRole
|
|
3
|
+
from gllm_inference.schema import HistoryFormatter as HistoryFormatter, JinjaEnvType as JinjaEnvType, Message as Message, MessageContent as MessageContent, MessageRole as MessageRole
|
|
4
4
|
from jinja2.sandbox import SandboxedEnvironment as SandboxedEnvironment
|
|
5
5
|
from typing import Any
|
|
6
6
|
|
|
@@ -13,13 +13,15 @@ class PromptBuilder:
|
|
|
13
13
|
prompt_key_set (set[str]): A set of expected keys that must be present in the prompt templates.
|
|
14
14
|
key_defaults (dict[str, str]): Default values for the keys in the prompt templates.
|
|
15
15
|
strategy (BasePromptFormattingStrategy): The format strategy to be used for formatting the prompt.
|
|
16
|
+
history_formatter (HistoryFormatter): The history formatter to be used for formatting the history.
|
|
16
17
|
"""
|
|
17
18
|
key_defaults: Incomplete
|
|
18
19
|
system_template: Incomplete
|
|
19
20
|
user_template: Incomplete
|
|
21
|
+
history_formatter: Incomplete
|
|
20
22
|
strategy: Incomplete
|
|
21
23
|
prompt_key_set: Incomplete
|
|
22
|
-
def __init__(self, system_template: str = '', user_template: str = '', key_defaults: dict[str, str] | None = None, ignore_extra_keys: bool | None = None, use_jinja: bool = False, jinja_env: JinjaEnvType | SandboxedEnvironment =
|
|
24
|
+
def __init__(self, system_template: str = '', user_template: str = '', key_defaults: dict[str, str] | None = None, ignore_extra_keys: bool | None = None, history_formatter: HistoryFormatter | None = None, use_jinja: bool | None = False, jinja_env: JinjaEnvType | SandboxedEnvironment | None = None) -> None:
|
|
23
25
|
"""Initializes a new instance of the PromptBuilder class.
|
|
24
26
|
|
|
25
27
|
Args:
|
|
@@ -32,6 +34,8 @@ class PromptBuilder:
|
|
|
32
34
|
Defaults to None, in which case no default values will be assigned to the keys.
|
|
33
35
|
ignore_extra_keys (bool | None, optional): Deprecated parameter. Will be removed in v0.6. Extra keys
|
|
34
36
|
will always raise a warning only instead of raising an error.
|
|
37
|
+
history_formatter (HistoryFormatter | None, optional): The history formatter to be used for formatting
|
|
38
|
+
the history. Defaults to None, in which case the history will be used as is.
|
|
35
39
|
use_jinja (bool, optional): Whether to use Jinja for rendering the prompt templates.
|
|
36
40
|
Defaults to False.
|
|
37
41
|
jinja_env (JinjaEnvType | SandboxedEnvironment, optional): The environment for Jinja rendering.
|
|
@@ -4,6 +4,7 @@ from gllm_inference.schema.code_exec_result import CodeExecResult as CodeExecRes
|
|
|
4
4
|
from gllm_inference.schema.config import TruncationConfig as TruncationConfig
|
|
5
5
|
from gllm_inference.schema.enums import AttachmentType as AttachmentType, BatchStatus as BatchStatus, EmitDataType as EmitDataType, JinjaEnvType as JinjaEnvType, LMEventType as LMEventType, LMEventTypeSuffix as LMEventTypeSuffix, LMOutputType as LMOutputType, MessageRole as MessageRole, TruncateSide as TruncateSide
|
|
6
6
|
from gllm_inference.schema.events import ActivityEvent as ActivityEvent, CodeEvent as CodeEvent, ThinkingEvent as ThinkingEvent
|
|
7
|
+
from gllm_inference.schema.formatter import HistoryFormatter as HistoryFormatter
|
|
7
8
|
from gllm_inference.schema.lm_input import LMInput as LMInput
|
|
8
9
|
from gllm_inference.schema.lm_output import LMOutput as LMOutput, LMOutputData as LMOutputData, LMOutputItem as LMOutputItem
|
|
9
10
|
from gllm_inference.schema.mcp import MCPCall as MCPCall, MCPServer as MCPServer
|
|
@@ -15,4 +16,4 @@ from gllm_inference.schema.tool_call import ToolCall as ToolCall
|
|
|
15
16
|
from gllm_inference.schema.tool_result import ToolResult as ToolResult
|
|
16
17
|
from gllm_inference.schema.type_alias import EMContent as EMContent, MessageContent as MessageContent, ResponseSchema as ResponseSchema, Vector as Vector
|
|
17
18
|
|
|
18
|
-
__all__ = ['Activity', 'ActivityEvent', 'Attachment', 'AttachmentType', 'BatchStatus', 'CodeEvent', 'CodeExecResult', 'EMContent', 'EmitDataType', 'InputTokenDetails', 'JinjaEnvType', 'LMEventType', 'LMEventTypeSuffix', 'LMInput', 'LMOutput', 'LMOutputItem', 'LMOutputData', 'LMOutputType', 'MCPCall', 'MCPCallActivity', 'MCPListToolsActivity', 'MCPServer', 'Message', 'MessageContent', 'MessageRole', 'ModelId', 'ModelProvider', 'OutputTokenDetails', 'Reasoning', 'ResponseSchema', 'ThinkingEvent', 'TokenUsage', 'ToolCall', 'ToolResult', 'TruncateSide', 'TruncationConfig', 'Vector', 'WebSearchActivity']
|
|
19
|
+
__all__ = ['Activity', 'ActivityEvent', 'Attachment', 'AttachmentType', 'BatchStatus', 'CodeEvent', 'CodeExecResult', 'EMContent', 'EmitDataType', 'HistoryFormatter', 'InputTokenDetails', 'JinjaEnvType', 'LMEventType', 'LMEventTypeSuffix', 'LMInput', 'LMOutput', 'LMOutputItem', 'LMOutputData', 'LMOutputType', 'MCPCall', 'MCPCallActivity', 'MCPListToolsActivity', 'MCPServer', 'Message', 'MessageContent', 'MessageRole', 'ModelId', 'ModelProvider', 'OutputTokenDetails', 'Reasoning', 'ResponseSchema', 'ThinkingEvent', 'TokenUsage', 'ToolCall', 'ToolResult', 'TruncateSide', 'TruncationConfig', 'Vector', 'WebSearchActivity']
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
from gllm_inference.schema.enums import MessageRole as MessageRole
|
|
2
|
+
from gllm_inference.schema.message import Message as Message
|
|
3
|
+
from gllm_inference.schema.type_alias import MessageContent as MessageContent
|
|
4
|
+
from pydantic import BaseModel
|
|
5
|
+
|
|
6
|
+
class HistoryFormatter(BaseModel):
|
|
7
|
+
"""Configuration for history formatting.
|
|
8
|
+
|
|
9
|
+
Attributes:
|
|
10
|
+
prefix_user_message (str): Prefix for user messages.
|
|
11
|
+
suffix_user_message (str): Suffix for user messages.
|
|
12
|
+
prefix_assistant_message (str): Prefix for assistant messages.
|
|
13
|
+
suffix_assistant_message (str): Suffix for assistant messages.
|
|
14
|
+
"""
|
|
15
|
+
prefix_user_message: str
|
|
16
|
+
suffix_user_message: str
|
|
17
|
+
prefix_assistant_message: str
|
|
18
|
+
suffix_assistant_message: str
|
|
19
|
+
def format_history(self, history: list[Message]) -> list[Message]:
|
|
20
|
+
"""Formats a list of messages based on their roles.
|
|
21
|
+
|
|
22
|
+
This method formats each message in the history list by applying the appropriate
|
|
23
|
+
formatting based on the message role (user or assistant). Other message types
|
|
24
|
+
are added to the result without modification.
|
|
25
|
+
|
|
26
|
+
Args:
|
|
27
|
+
history (list[Message]): The list of messages to format.
|
|
28
|
+
|
|
29
|
+
Returns:
|
|
30
|
+
list[Message]: A new list containing the formatted messages.
|
|
31
|
+
"""
|
|
Binary file
|
gllm_inference.pyi
CHANGED
|
@@ -136,6 +136,7 @@ import jinja2.sandbox
|
|
|
136
136
|
import gllm_inference.schema.JinjaEnvType
|
|
137
137
|
import gllm_inference.prompt_builder.format_strategy.JinjaFormatStrategy
|
|
138
138
|
import gllm_inference.prompt_builder.format_strategy.StringFormatStrategy
|
|
139
|
+
import gllm_inference.schema.HistoryFormatter
|
|
139
140
|
import transformers
|
|
140
141
|
import gllm_inference.prompt_formatter.HuggingFacePromptFormatter
|
|
141
142
|
import traceback
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: gllm-inference-binary
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.64
|
|
4
4
|
Summary: A library containing components related to model inferences in Gen AI applications.
|
|
5
|
-
Author-email: Henry Wicaksono <henry.wicaksono@gdplabs.id>,
|
|
5
|
+
Author-email: Henry Wicaksono <henry.wicaksono@gdplabs.id>, "Delfia N. A. Putri" <delfia.n.a.putri@gdplabs.id>
|
|
6
6
|
Requires-Python: <3.14,>=3.11
|
|
7
7
|
Description-Content-Type: text/markdown
|
|
8
8
|
Requires-Dist: poetry<3.0.0,>=2.1.3
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
gllm_inference.cp312-win_amd64.pyd,sha256=
|
|
2
|
-
gllm_inference.pyi,sha256=
|
|
1
|
+
gllm_inference.cp312-win_amd64.pyd,sha256=KuwIpic9Q1cqtR1fQ8SXgBFKqd93tVtl7oYG39rNTj4,4026880
|
|
2
|
+
gllm_inference.pyi,sha256=jCxjKwYXb3t6yZrf6m7uD29V9KPXyWb8U04-lru4-JA,5173
|
|
3
3
|
gllm_inference/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
4
|
gllm_inference/constants.pyi,sha256=8jIYOyxJYVWUYXSXF3vag9HhHwjq1iU9tzPiosRHkWk,328
|
|
5
5
|
gllm_inference/builder/__init__.pyi,sha256=-bw1uDx7CAM7pkvjvb1ZXku9zXlQ7aEAyC83KIn3bz8,506
|
|
@@ -51,7 +51,7 @@ gllm_inference/lm_invoker/litellm_lm_invoker.pyi,sha256=qG8pPTiDJZR2e7wr5Q2VyceC
|
|
|
51
51
|
gllm_inference/lm_invoker/lm_invoker.pyi,sha256=L_PHRCeHo0dNs6BjnB8H29irGib-qhxKYf7F7pZlU0E,8652
|
|
52
52
|
gllm_inference/lm_invoker/openai_chat_completions_lm_invoker.pyi,sha256=qt9DAdJM7YBB4op-6SOJB0kCouPYVxtIamGUXLGLUeA,13888
|
|
53
53
|
gllm_inference/lm_invoker/openai_compatible_lm_invoker.pyi,sha256=T9sShA_9fgEuaaAuT2gJZq_EYNbEhf3IkWwMCwfszY8,4244
|
|
54
|
-
gllm_inference/lm_invoker/openai_lm_invoker.pyi,sha256=
|
|
54
|
+
gllm_inference/lm_invoker/openai_lm_invoker.pyi,sha256=GH-veLKBOnaumflfGj-128VXtQXkXVxYFSfFpliaZPI,23055
|
|
55
55
|
gllm_inference/lm_invoker/portkey_lm_invoker.pyi,sha256=FYOp4BaDfOtompWIRhDqzMVVSK-TiFyw7JA4TznANQE,15236
|
|
56
56
|
gllm_inference/lm_invoker/sea_lion_lm_invoker.pyi,sha256=Qqplj79JsnLGY6xjhbXYbz6Ramxur4sXfvv4svk19os,3533
|
|
57
57
|
gllm_inference/lm_invoker/xai_lm_invoker.pyi,sha256=6beZsQjGUTo7TdzWBWksRzVGT58XyipErpGfiRq6NH0,13017
|
|
@@ -63,7 +63,7 @@ gllm_inference/lm_invoker/schema/bedrock.pyi,sha256=rB1AWfER2BBKZ5I219211YE2EUFP
|
|
|
63
63
|
gllm_inference/lm_invoker/schema/datasaur.pyi,sha256=8lmb1PRbkqBsF_l7iOffxW0K5Xxpi69GW9Z7KxyxHTE,279
|
|
64
64
|
gllm_inference/lm_invoker/schema/google.pyi,sha256=LQ14PJyDOe3K5TYvE-gzE1fjpZCSAy-0Sy9Lmw6fICY,827
|
|
65
65
|
gllm_inference/lm_invoker/schema/langchain.pyi,sha256=2OJOUQPlGdlUbIOTDOyiWDBOMm3MoVX-kU2nK0zQsF0,452
|
|
66
|
-
gllm_inference/lm_invoker/schema/openai.pyi,sha256=
|
|
66
|
+
gllm_inference/lm_invoker/schema/openai.pyi,sha256=nR4re7BWfYFePvfCM-iCzP6jcPp5C0f1PLvpFmq4gcs,2419
|
|
67
67
|
gllm_inference/lm_invoker/schema/openai_chat_completions.pyi,sha256=nNPb7ETC9IrJwkV5wfbGf6Co3-qdq4lhcXz0l_qYCE4,1261
|
|
68
68
|
gllm_inference/lm_invoker/schema/portkey.pyi,sha256=V2q4JIwDAR7BidqfmO01u1_1mLOMtm5OCon6sN2zNt0,662
|
|
69
69
|
gllm_inference/lm_invoker/schema/xai.pyi,sha256=jpC6ZSBDUltzm9GjD6zvSFIPwqizn_ywLnjvwSa7KuU,663
|
|
@@ -85,7 +85,7 @@ gllm_inference/output_parser/__init__.pyi,sha256=dhAeRTBxc6CfS8bhnHjbtrnyqJ1iyff
|
|
|
85
85
|
gllm_inference/output_parser/json_output_parser.pyi,sha256=YtgQh8Uzy8W_Tgh8DfuR7VFFS7qvLEasiTwRfaGZZEU,2993
|
|
86
86
|
gllm_inference/output_parser/output_parser.pyi,sha256=-Xu5onKCBDqShcO-VrQh5icqAmXdihGc3rkZxL93swg,975
|
|
87
87
|
gllm_inference/prompt_builder/__init__.pyi,sha256=mPsbiafzSNHsgN-CuzjhgZpfXfi1pPC3_gdsq2p0EM4,120
|
|
88
|
-
gllm_inference/prompt_builder/prompt_builder.pyi,sha256=
|
|
88
|
+
gllm_inference/prompt_builder/prompt_builder.pyi,sha256=w99E5dsQxpJ-1FNEF_WBOt7xovmhp5WzrbTfRQ76K60,5083
|
|
89
89
|
gllm_inference/prompt_builder/format_strategy/__init__.pyi,sha256=BliNAdrN2yNoQt8muLe1IknuE78UDQys_3L_8_2Tn9E,312
|
|
90
90
|
gllm_inference/prompt_builder/format_strategy/format_strategy.pyi,sha256=Uay07qR0nMGbrOZ2twEyrIWYRKevBQL9ju_4fVfByyQ,2328
|
|
91
91
|
gllm_inference/prompt_builder/format_strategy/jinja_format_strategy.pyi,sha256=W8SdOPWPz_U355G8rQwiIQ0Ys78vomUBFEEZiz3AS5k,2270
|
|
@@ -111,13 +111,14 @@ gllm_inference/realtime_chat/output_streamer/output_streamer.pyi,sha256=5P9NQ0aJ
|
|
|
111
111
|
gllm_inference/request_processor/__init__.pyi,sha256=giEme2WFQhgyKiBZHhSet0_nKSCHwGy-_2p6NRzg0Zc,231
|
|
112
112
|
gllm_inference/request_processor/lm_request_processor.pyi,sha256=0fy1HyILCVDw6y46E-7tLnQTRYx4ppeRMe0QP6t9Jyw,5990
|
|
113
113
|
gllm_inference/request_processor/uses_lm_mixin.pyi,sha256=LYHq-zLoXEMel1LfVdYv7W3BZ8WtBLo_WWFjRf10Yto,6512
|
|
114
|
-
gllm_inference/schema/__init__.pyi,sha256=
|
|
114
|
+
gllm_inference/schema/__init__.pyi,sha256=89GWKdJ6DdPUTem42_Uc-5EsyNcfUJ-WnMVEkagpEwI,2524
|
|
115
115
|
gllm_inference/schema/activity.pyi,sha256=atrU4OwLesA9FEt1H7K3gsUWYNdOqpI5i2VdWkmo6cs,2367
|
|
116
116
|
gllm_inference/schema/attachment.pyi,sha256=myJ_cI_h5mwUdvmMrWpSQIwj3nIxe8SD7HxO37o_3D4,4611
|
|
117
117
|
gllm_inference/schema/code_exec_result.pyi,sha256=WQ-ARoGM9r6nyRX-A0Ro1XKiqrc9R3jRYXZpu_xo5S4,573
|
|
118
118
|
gllm_inference/schema/config.pyi,sha256=NVmjQK6HipIE0dKSfx12hgIC0O-S1HEcAc-TWlXAF5A,689
|
|
119
119
|
gllm_inference/schema/enums.pyi,sha256=U-lADk7xNjA5rByem0fo0xDAy9T3GsekY8B5szTlWPQ,2193
|
|
120
120
|
gllm_inference/schema/events.pyi,sha256=_CKuGNzb3j2Y1dOB2yssFkT_9FQz1AY4J_ApCwKNizU,4743
|
|
121
|
+
gllm_inference/schema/formatter.pyi,sha256=uJ1CZt_DmizfCPHD5deQwm2ftU-zcl2aj5rwJGTPe9c,1312
|
|
121
122
|
gllm_inference/schema/lm_input.pyi,sha256=HxQiZgY7zcXh_Dw8nK8LSeBTZEHMPZVwmPmnfgSsAbs,197
|
|
122
123
|
gllm_inference/schema/lm_output.pyi,sha256=N75CIF_2kZRdXKy2jvu9hhqzk5DrCbsHXTrhKqQ-7vo,11667
|
|
123
124
|
gllm_inference/schema/mcp.pyi,sha256=4SgQ83pEowfWm2p-w9lupV4NayqqVBOy7SuYxIFeWRs,1045
|
|
@@ -133,7 +134,7 @@ gllm_inference/utils/io_utils.pyi,sha256=Eg7dvHWdXslTKdjh1j3dG50i7r35XG2zTmJ9XXv
|
|
|
133
134
|
gllm_inference/utils/langchain.pyi,sha256=4AwFiVAO0ZpdgmqeC4Pb5NJwBt8vVr0MSUqLeCdTscc,1194
|
|
134
135
|
gllm_inference/utils/validation.pyi,sha256=OWRZxeVGIuuvNU0LqLGB-9gNmypvbH-LcSJx91rnH1k,453
|
|
135
136
|
gllm_inference.build/.gitignore,sha256=aEiIwOuxfzdCmLZe4oB1JsBmCUxwG8x-u-HBCV9JT8E,1
|
|
136
|
-
gllm_inference_binary-0.5.
|
|
137
|
-
gllm_inference_binary-0.5.
|
|
138
|
-
gllm_inference_binary-0.5.
|
|
139
|
-
gllm_inference_binary-0.5.
|
|
137
|
+
gllm_inference_binary-0.5.64.dist-info/METADATA,sha256=SDCtX8UTQF-0fX_doIZLwVuR9pL60A5YCawZxW3v2Zo,5955
|
|
138
|
+
gllm_inference_binary-0.5.64.dist-info/WHEEL,sha256=x5rgv--I0NI0IT1Lh9tN1VG2cI637p3deednwYLKnxc,96
|
|
139
|
+
gllm_inference_binary-0.5.64.dist-info/top_level.txt,sha256=FpOjtN80F-qVNgbScXSEyqa0w09FYn6301iq6qt69IQ,15
|
|
140
|
+
gllm_inference_binary-0.5.64.dist-info/RECORD,,
|
|
File without changes
|
{gllm_inference_binary-0.5.62.dist-info → gllm_inference_binary-0.5.64.dist-info}/top_level.txt
RENAMED
|
File without changes
|