livellm 1.5.1__py3-none-any.whl → 1.5.3__py3-none-any.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.
- livellm/livellm.py +14 -4
- livellm/models/agent/chat.py +3 -3
- {livellm-1.5.1.dist-info → livellm-1.5.3.dist-info}/METADATA +1 -1
- {livellm-1.5.1.dist-info → livellm-1.5.3.dist-info}/RECORD +6 -6
- {livellm-1.5.1.dist-info → livellm-1.5.3.dist-info}/WHEEL +0 -0
- {livellm-1.5.1.dist-info → livellm-1.5.3.dist-info}/licenses/LICENSE +0 -0
livellm/livellm.py
CHANGED
|
@@ -36,6 +36,7 @@ class BaseLivellmClient(ABC):
|
|
|
36
36
|
model: str,
|
|
37
37
|
messages: list,
|
|
38
38
|
tools: Optional[list] = None,
|
|
39
|
+
include_history: bool = False,
|
|
39
40
|
**kwargs
|
|
40
41
|
) -> AgentResponse:
|
|
41
42
|
...
|
|
@@ -53,6 +54,7 @@ class BaseLivellmClient(ABC):
|
|
|
53
54
|
model: Optional[str] = None,
|
|
54
55
|
messages: Optional[list] = None,
|
|
55
56
|
tools: Optional[list] = None,
|
|
57
|
+
include_history: bool = False,
|
|
56
58
|
**kwargs
|
|
57
59
|
) -> AgentResponse:
|
|
58
60
|
"""
|
|
@@ -69,7 +71,8 @@ class BaseLivellmClient(ABC):
|
|
|
69
71
|
provider_uid="...",
|
|
70
72
|
model="gpt-4",
|
|
71
73
|
messages=[TextMessage(...)],
|
|
72
|
-
tools=[]
|
|
74
|
+
tools=[],
|
|
75
|
+
include_history=False
|
|
73
76
|
)
|
|
74
77
|
|
|
75
78
|
Args:
|
|
@@ -79,6 +82,7 @@ class BaseLivellmClient(ABC):
|
|
|
79
82
|
messages: List of messages
|
|
80
83
|
tools: Optional list of tools
|
|
81
84
|
gen_config: Optional generation configuration
|
|
85
|
+
include_history: Whether to include full conversation history in the response
|
|
82
86
|
|
|
83
87
|
Returns:
|
|
84
88
|
AgentResponse with the agent's output
|
|
@@ -103,7 +107,8 @@ class BaseLivellmClient(ABC):
|
|
|
103
107
|
model=model,
|
|
104
108
|
messages=messages,
|
|
105
109
|
tools=tools or [],
|
|
106
|
-
gen_config=kwargs or None
|
|
110
|
+
gen_config=kwargs or None,
|
|
111
|
+
include_history=include_history
|
|
107
112
|
)
|
|
108
113
|
return await self.handle_agent_run(agent_request)
|
|
109
114
|
|
|
@@ -122,6 +127,7 @@ class BaseLivellmClient(ABC):
|
|
|
122
127
|
model: str,
|
|
123
128
|
messages: list,
|
|
124
129
|
tools: Optional[list] = None,
|
|
130
|
+
include_history: bool = False,
|
|
125
131
|
**kwargs
|
|
126
132
|
) -> AsyncIterator[AgentResponse]:
|
|
127
133
|
...
|
|
@@ -139,6 +145,7 @@ class BaseLivellmClient(ABC):
|
|
|
139
145
|
model: Optional[str] = None,
|
|
140
146
|
messages: Optional[list] = None,
|
|
141
147
|
tools: Optional[list] = None,
|
|
148
|
+
include_history: bool = False,
|
|
142
149
|
**kwargs
|
|
143
150
|
) -> AsyncIterator[AgentResponse]:
|
|
144
151
|
"""
|
|
@@ -157,7 +164,8 @@ class BaseLivellmClient(ABC):
|
|
|
157
164
|
provider_uid="...",
|
|
158
165
|
model="gpt-4",
|
|
159
166
|
messages=[TextMessage(...)],
|
|
160
|
-
tools=[]
|
|
167
|
+
tools=[],
|
|
168
|
+
include_history=False
|
|
161
169
|
):
|
|
162
170
|
...
|
|
163
171
|
|
|
@@ -168,6 +176,7 @@ class BaseLivellmClient(ABC):
|
|
|
168
176
|
messages: List of messages
|
|
169
177
|
tools: Optional list of tools
|
|
170
178
|
gen_config: Optional generation configuration
|
|
179
|
+
include_history: Whether to include full conversation history in the response
|
|
171
180
|
|
|
172
181
|
Returns:
|
|
173
182
|
AsyncIterator of AgentResponse chunks
|
|
@@ -192,7 +201,8 @@ class BaseLivellmClient(ABC):
|
|
|
192
201
|
model=model,
|
|
193
202
|
messages=messages,
|
|
194
203
|
tools=tools or [],
|
|
195
|
-
gen_config=kwargs or None
|
|
204
|
+
gen_config=kwargs or None,
|
|
205
|
+
include_history=include_history
|
|
196
206
|
)
|
|
197
207
|
stream = self.handle_agent_run_stream(agent_request)
|
|
198
208
|
|
livellm/models/agent/chat.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# models for chat messages
|
|
2
2
|
from pydantic import BaseModel, Field, model_validator, field_serializer
|
|
3
3
|
from enum import Enum
|
|
4
|
-
from typing import Optional, Union
|
|
4
|
+
from typing import Optional, Union, Any, Dict
|
|
5
5
|
|
|
6
6
|
class MessageRole(str, Enum):
|
|
7
7
|
USER = "user"
|
|
@@ -32,10 +32,10 @@ class BinaryMessage(Message):
|
|
|
32
32
|
class ToolCallMessage(Message):
|
|
33
33
|
"""Message representing a tool call made by the agent"""
|
|
34
34
|
tool_name: str = Field(..., description="The name of the tool being called")
|
|
35
|
-
args:
|
|
35
|
+
args: Union[Dict[str, Any], str] = Field(..., description="The arguments passed to the tool")
|
|
36
36
|
|
|
37
37
|
class ToolReturnMessage(Message):
|
|
38
38
|
"""Message representing the return value from a tool call"""
|
|
39
39
|
tool_name: str = Field(..., description="The name of the tool that was called")
|
|
40
|
-
content:
|
|
40
|
+
content: Any = Field(..., description="The return value from the tool")
|
|
41
41
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
livellm/__init__.py,sha256=p2Szx7PELGYi-PTnSNnRPGVbU438ZBTFXYAQoMToUfE,440
|
|
2
|
-
livellm/livellm.py,sha256=
|
|
2
|
+
livellm/livellm.py,sha256=d-1PlWKtMkw44575KZlhRr-c7p0B34W78F4PS_rhwUA,34598
|
|
3
3
|
livellm/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
4
|
livellm/transcripton.py,sha256=WtL2PEFEVQ3RP2WOyjXqQFziQWKJvzJbG3T5cqfJ5qc,4187
|
|
5
5
|
livellm/models/__init__.py,sha256=4w8yDf_79kNwBfct-jHjAPNPxz4nFzMSWqlIo_7MFwc,1531
|
|
@@ -9,12 +9,12 @@ livellm/models/transcription.py,sha256=LQG5u7hgXuw6WyCxS-us0VGh9eky-f16JPpeT3jHU
|
|
|
9
9
|
livellm/models/ws.py,sha256=OCoJwAjQLOz6ErTiTtb-qD22N4wSsEGvi_4JQqCHIPQ,1111
|
|
10
10
|
livellm/models/agent/__init__.py,sha256=CvP3xzDAiBZ4giQZUBQsqAJd1rWO4cvHhqr2Oh346A0,560
|
|
11
11
|
livellm/models/agent/agent.py,sha256=qndsqcnX0MqbnblOA3niUWpU9873FU-PIH0vZkPoqAU,1504
|
|
12
|
-
livellm/models/agent/chat.py,sha256=
|
|
12
|
+
livellm/models/agent/chat.py,sha256=VxdHTbJELMffxJJUSTdhT4behFbVq5XNyBLeg75wpsU,1632
|
|
13
13
|
livellm/models/agent/tools.py,sha256=wVWfx6_jxL3IcmX_Nt_PonZ3RQLtpfqJnszHz32BQiU,1403
|
|
14
14
|
livellm/models/audio/__init__.py,sha256=sz2NxCOfFGVvp-XQUsdgOR_TYBO1Wb-8LLXaZDEiAZk,282
|
|
15
15
|
livellm/models/audio/speak.py,sha256=lDITZ7fiLRuDhA-LxCPQ6Yraxr33B6Lg7VyR4CkuGk8,1872
|
|
16
16
|
livellm/models/audio/transcribe.py,sha256=Leji2lk5zfq4GE-fw-z2dZR8BuijzW8TJ12GHw_UZJY,2085
|
|
17
|
-
livellm-1.5.
|
|
18
|
-
livellm-1.5.
|
|
19
|
-
livellm-1.5.
|
|
20
|
-
livellm-1.5.
|
|
17
|
+
livellm-1.5.3.dist-info/METADATA,sha256=85S9orp4edINaQyiehmPmluRIgCcSwGQiU-oUAbAuaU,20664
|
|
18
|
+
livellm-1.5.3.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
19
|
+
livellm-1.5.3.dist-info/licenses/LICENSE,sha256=yapGO2C_00ymEx6TADdbU8Oyc1bWOrZY-fjP-agmFL4,1071
|
|
20
|
+
livellm-1.5.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|