vectara-agentic 0.2.8__py3-none-any.whl → 0.2.9__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.
Potentially problematic release.
This version of vectara-agentic might be problematic. Click here for more details.
- vectara_agentic/_callback.py +147 -45
- vectara_agentic/_version.py +1 -1
- vectara_agentic/agent.py +10 -2
- vectara_agentic/agent_config.py +11 -0
- vectara_agentic/tools.py +2 -2
- vectara_agentic/utils.py +3 -2
- {vectara_agentic-0.2.8.dist-info → vectara_agentic-0.2.9.dist-info}/METADATA +1 -1
- {vectara_agentic-0.2.8.dist-info → vectara_agentic-0.2.9.dist-info}/RECORD +11 -11
- {vectara_agentic-0.2.8.dist-info → vectara_agentic-0.2.9.dist-info}/WHEEL +0 -0
- {vectara_agentic-0.2.8.dist-info → vectara_agentic-0.2.9.dist-info}/licenses/LICENSE +0 -0
- {vectara_agentic-0.2.8.dist-info → vectara_agentic-0.2.9.dist-info}/top_level.txt +0 -0
vectara_agentic/_callback.py
CHANGED
|
@@ -4,12 +4,35 @@ Module to handle agent callbacks
|
|
|
4
4
|
|
|
5
5
|
import inspect
|
|
6
6
|
from typing import Any, Dict, Optional, List, Callable
|
|
7
|
+
from functools import wraps
|
|
7
8
|
|
|
8
9
|
from llama_index.core.callbacks.base_handler import BaseCallbackHandler
|
|
9
10
|
from llama_index.core.callbacks.schema import CBEventType, EventPayload
|
|
10
11
|
|
|
11
12
|
from .types import AgentStatusType
|
|
12
13
|
|
|
14
|
+
def wrap_callback_fn(callback):
|
|
15
|
+
"""
|
|
16
|
+
Wrap a callback function to ensure it only receives the parameters it can accept.
|
|
17
|
+
This is useful for ensuring that the callback function does not receive unexpected
|
|
18
|
+
parameters, especially when the callback is called from different contexts.
|
|
19
|
+
"""
|
|
20
|
+
if callback is None:
|
|
21
|
+
return None
|
|
22
|
+
try:
|
|
23
|
+
sig = inspect.signature(callback)
|
|
24
|
+
allowed_params = set(sig.parameters.keys())
|
|
25
|
+
except Exception:
|
|
26
|
+
# If we cannot determine the signature, return the callback as is.
|
|
27
|
+
return callback
|
|
28
|
+
|
|
29
|
+
@wraps(callback)
|
|
30
|
+
def new_callback(*args, **kwargs):
|
|
31
|
+
# Filter kwargs to only those that the original callback accepts.
|
|
32
|
+
filtered_kwargs = {k: v for k, v in kwargs.items() if k in allowed_params}
|
|
33
|
+
return callback(*args, **filtered_kwargs)
|
|
34
|
+
|
|
35
|
+
return new_callback
|
|
13
36
|
|
|
14
37
|
class AgentCallbackHandler(BaseCallbackHandler):
|
|
15
38
|
"""
|
|
@@ -24,7 +47,7 @@ class AgentCallbackHandler(BaseCallbackHandler):
|
|
|
24
47
|
|
|
25
48
|
def __init__(self, fn: Optional[Callable] = None) -> None:
|
|
26
49
|
super().__init__(event_starts_to_ignore=[], event_ends_to_ignore=[])
|
|
27
|
-
self.fn = fn
|
|
50
|
+
self.fn = wrap_callback_fn(fn)
|
|
28
51
|
|
|
29
52
|
# Existing synchronous methods
|
|
30
53
|
def on_event_start(
|
|
@@ -37,9 +60,11 @@ class AgentCallbackHandler(BaseCallbackHandler):
|
|
|
37
60
|
) -> str:
|
|
38
61
|
if self.fn is not None and payload is not None:
|
|
39
62
|
if inspect.iscoroutinefunction(self.fn):
|
|
40
|
-
raise ValueError(
|
|
63
|
+
raise ValueError(
|
|
64
|
+
"Synchronous callback handler cannot use async callback function"
|
|
65
|
+
)
|
|
41
66
|
# Handle events as before
|
|
42
|
-
self._handle_event(event_type, payload)
|
|
67
|
+
self._handle_event(event_type, payload, event_id)
|
|
43
68
|
return event_id
|
|
44
69
|
|
|
45
70
|
def start_trace(self, trace_id: Optional[str] = None) -> None:
|
|
@@ -73,9 +98,11 @@ class AgentCallbackHandler(BaseCallbackHandler):
|
|
|
73
98
|
"""
|
|
74
99
|
if self.fn is not None and payload is not None:
|
|
75
100
|
if inspect.iscoroutinefunction(self.fn):
|
|
76
|
-
raise ValueError(
|
|
101
|
+
raise ValueError(
|
|
102
|
+
"Synchronous callback handler cannot use async callback function"
|
|
103
|
+
)
|
|
77
104
|
# Handle events as before
|
|
78
|
-
self._handle_event(event_type, payload)
|
|
105
|
+
self._handle_event(event_type, payload, event_id)
|
|
79
106
|
|
|
80
107
|
# New asynchronous methods
|
|
81
108
|
async def aon_event_start(
|
|
@@ -100,7 +127,7 @@ class AgentCallbackHandler(BaseCallbackHandler):
|
|
|
100
127
|
event_id: the event ID
|
|
101
128
|
"""
|
|
102
129
|
if self.fn is not None and payload is not None:
|
|
103
|
-
await self._ahandle_event(event_type, payload)
|
|
130
|
+
await self._ahandle_event(event_type, payload, event_id)
|
|
104
131
|
return event_id
|
|
105
132
|
|
|
106
133
|
async def aon_event_end(
|
|
@@ -114,48 +141,66 @@ class AgentCallbackHandler(BaseCallbackHandler):
|
|
|
114
141
|
Handle the end of an event (async)
|
|
115
142
|
"""
|
|
116
143
|
if self.fn is not None and payload is not None:
|
|
117
|
-
await self._ahandle_event(event_type, payload)
|
|
144
|
+
await self._ahandle_event(event_type, payload, event_id)
|
|
118
145
|
|
|
119
146
|
# Helper methods for handling events
|
|
120
|
-
def _handle_event(
|
|
147
|
+
def _handle_event(
|
|
148
|
+
self, event_type: CBEventType, payload: Dict[str, Any], event_id: str
|
|
149
|
+
) -> None:
|
|
121
150
|
if event_type == CBEventType.LLM:
|
|
122
|
-
self._handle_llm(payload)
|
|
151
|
+
self._handle_llm(payload, event_id)
|
|
123
152
|
elif event_type == CBEventType.FUNCTION_CALL:
|
|
124
|
-
self._handle_function_call(payload)
|
|
153
|
+
self._handle_function_call(payload, event_id)
|
|
125
154
|
elif event_type == CBEventType.AGENT_STEP:
|
|
126
|
-
self._handle_agent_step(payload)
|
|
155
|
+
self._handle_agent_step(payload, event_id)
|
|
127
156
|
elif event_type == CBEventType.EXCEPTION:
|
|
128
157
|
print(f"Exception: {payload.get(EventPayload.EXCEPTION)}")
|
|
129
158
|
else:
|
|
130
159
|
print(f"Unknown event type: {event_type}, payload={payload}")
|
|
131
160
|
|
|
132
|
-
async def _ahandle_event(
|
|
161
|
+
async def _ahandle_event(
|
|
162
|
+
self, event_type: CBEventType, payload: Dict[str, Any], event_id: str
|
|
163
|
+
) -> None:
|
|
133
164
|
if event_type == CBEventType.LLM:
|
|
134
|
-
await self._ahandle_llm(payload)
|
|
165
|
+
await self._ahandle_llm(payload, event_id)
|
|
135
166
|
elif event_type == CBEventType.FUNCTION_CALL:
|
|
136
|
-
await self._ahandle_function_call(payload)
|
|
167
|
+
await self._ahandle_function_call(payload, event_id)
|
|
137
168
|
elif event_type == CBEventType.AGENT_STEP:
|
|
138
|
-
await self._ahandle_agent_step(payload)
|
|
169
|
+
await self._ahandle_agent_step(payload, event_id)
|
|
139
170
|
elif event_type == CBEventType.EXCEPTION:
|
|
140
171
|
print(f"Exception: {payload.get(EventPayload.EXCEPTION)}")
|
|
141
172
|
else:
|
|
142
173
|
print(f"Unknown event type: {event_type}, payload={payload}")
|
|
143
174
|
|
|
144
175
|
# Synchronous handlers
|
|
145
|
-
def _handle_llm(
|
|
176
|
+
def _handle_llm(
|
|
177
|
+
self,
|
|
178
|
+
payload: dict,
|
|
179
|
+
event_id: str,
|
|
180
|
+
) -> None:
|
|
146
181
|
if EventPayload.MESSAGES in payload:
|
|
147
182
|
response = str(payload.get(EventPayload.RESPONSE))
|
|
148
183
|
if response and response not in ["None", "assistant: None"]:
|
|
149
184
|
if self.fn:
|
|
150
|
-
self.fn(
|
|
185
|
+
self.fn(
|
|
186
|
+
status_type=AgentStatusType.AGENT_UPDATE,
|
|
187
|
+
msg=response,
|
|
188
|
+
event_id=event_id,
|
|
189
|
+
)
|
|
151
190
|
elif EventPayload.PROMPT in payload:
|
|
152
191
|
prompt = str(payload.get(EventPayload.PROMPT))
|
|
153
192
|
if self.fn:
|
|
154
|
-
self.fn(
|
|
193
|
+
self.fn(
|
|
194
|
+
status_type=AgentStatusType.AGENT_UPDATE,
|
|
195
|
+
msg=prompt,
|
|
196
|
+
event_id=event_id,
|
|
197
|
+
)
|
|
155
198
|
else:
|
|
156
|
-
print(
|
|
199
|
+
print(
|
|
200
|
+
f"vectara-agentic llm callback: no messages or prompt found in payload {payload}"
|
|
201
|
+
)
|
|
157
202
|
|
|
158
|
-
def _handle_function_call(self, payload: dict) -> None:
|
|
203
|
+
def _handle_function_call(self, payload: dict, event_id: str) -> None:
|
|
159
204
|
if EventPayload.FUNCTION_CALL in payload:
|
|
160
205
|
fcall = str(payload.get(EventPayload.FUNCTION_CALL))
|
|
161
206
|
tool = payload.get(EventPayload.TOOL)
|
|
@@ -163,46 +208,77 @@ class AgentCallbackHandler(BaseCallbackHandler):
|
|
|
163
208
|
tool_name = tool.name
|
|
164
209
|
if self.fn:
|
|
165
210
|
self.fn(
|
|
166
|
-
AgentStatusType.TOOL_CALL,
|
|
167
|
-
f"Executing '{tool_name}' with arguments: {fcall}",
|
|
211
|
+
status_type=AgentStatusType.TOOL_CALL,
|
|
212
|
+
msg=f"Executing '{tool_name}' with arguments: {fcall}",
|
|
213
|
+
event_id=event_id,
|
|
168
214
|
)
|
|
169
215
|
elif EventPayload.FUNCTION_OUTPUT in payload:
|
|
170
216
|
response = str(payload.get(EventPayload.FUNCTION_OUTPUT))
|
|
171
217
|
if self.fn:
|
|
172
|
-
self.fn(
|
|
218
|
+
self.fn(
|
|
219
|
+
status_type=AgentStatusType.TOOL_OUTPUT,
|
|
220
|
+
msg=response,
|
|
221
|
+
event_id=event_id,
|
|
222
|
+
)
|
|
173
223
|
else:
|
|
174
|
-
print(
|
|
224
|
+
print(
|
|
225
|
+
f"Vectara-agentic callback handler: no function call or output found in payload {payload}"
|
|
226
|
+
)
|
|
175
227
|
|
|
176
|
-
def _handle_agent_step(self, payload: dict) -> None:
|
|
228
|
+
def _handle_agent_step(self, payload: dict, event_id: str) -> None:
|
|
177
229
|
if EventPayload.MESSAGES in payload:
|
|
178
230
|
msg = str(payload.get(EventPayload.MESSAGES))
|
|
179
231
|
if self.fn:
|
|
180
|
-
self.fn(
|
|
232
|
+
self.fn(
|
|
233
|
+
status_type=AgentStatusType.AGENT_STEP,
|
|
234
|
+
msg=msg,
|
|
235
|
+
event_id=event_id,
|
|
236
|
+
)
|
|
181
237
|
elif EventPayload.RESPONSE in payload:
|
|
182
238
|
response = str(payload.get(EventPayload.RESPONSE))
|
|
183
239
|
if self.fn:
|
|
184
|
-
self.fn(
|
|
240
|
+
self.fn(
|
|
241
|
+
status_type=AgentStatusType.AGENT_STEP,
|
|
242
|
+
msg=response,
|
|
243
|
+
event_id=event_id,
|
|
244
|
+
)
|
|
185
245
|
else:
|
|
186
|
-
print(
|
|
246
|
+
print(
|
|
247
|
+
f"Vectara-agentic agent_step: no messages or prompt found in payload {payload}"
|
|
248
|
+
)
|
|
187
249
|
|
|
188
250
|
# Asynchronous handlers
|
|
189
|
-
async def _ahandle_llm(self, payload: dict) -> None:
|
|
251
|
+
async def _ahandle_llm(self, payload: dict, event_id: str) -> None:
|
|
190
252
|
if EventPayload.MESSAGES in payload:
|
|
191
253
|
response = str(payload.get(EventPayload.RESPONSE))
|
|
192
254
|
if response and response not in ["None", "assistant: None"]:
|
|
193
255
|
if self.fn:
|
|
194
256
|
if inspect.iscoroutinefunction(self.fn):
|
|
195
|
-
await self.fn(
|
|
257
|
+
await self.fn(
|
|
258
|
+
status_type=AgentStatusType.AGENT_UPDATE,
|
|
259
|
+
msg=response,
|
|
260
|
+
event_id=event_id,
|
|
261
|
+
)
|
|
196
262
|
else:
|
|
197
|
-
self.fn(
|
|
263
|
+
self.fn(
|
|
264
|
+
status_type=AgentStatusType.AGENT_UPDATE,
|
|
265
|
+
msg=response,
|
|
266
|
+
event_id=event_id,
|
|
267
|
+
)
|
|
198
268
|
elif EventPayload.PROMPT in payload:
|
|
199
269
|
prompt = str(payload.get(EventPayload.PROMPT))
|
|
200
270
|
if self.fn:
|
|
201
|
-
self.fn(
|
|
271
|
+
self.fn(
|
|
272
|
+
status_type=AgentStatusType.AGENT_UPDATE,
|
|
273
|
+
msg=prompt,
|
|
274
|
+
event_id=event_id,
|
|
275
|
+
)
|
|
202
276
|
else:
|
|
203
|
-
print(
|
|
277
|
+
print(
|
|
278
|
+
f"vectara-agentic llm callback: no messages or prompt found in payload {payload}"
|
|
279
|
+
)
|
|
204
280
|
|
|
205
|
-
async def _ahandle_function_call(self, payload: dict) -> None:
|
|
281
|
+
async def _ahandle_function_call(self, payload: dict, event_id: str) -> None:
|
|
206
282
|
if EventPayload.FUNCTION_CALL in payload:
|
|
207
283
|
fcall = str(payload.get(EventPayload.FUNCTION_CALL))
|
|
208
284
|
tool = payload.get(EventPayload.TOOL)
|
|
@@ -211,38 +287,64 @@ class AgentCallbackHandler(BaseCallbackHandler):
|
|
|
211
287
|
if self.fn:
|
|
212
288
|
if inspect.iscoroutinefunction(self.fn):
|
|
213
289
|
await self.fn(
|
|
214
|
-
AgentStatusType.TOOL_CALL,
|
|
215
|
-
f"Executing '{tool_name}' with arguments: {fcall}",
|
|
290
|
+
status_type=AgentStatusType.TOOL_CALL,
|
|
291
|
+
msg=f"Executing '{tool_name}' with arguments: {fcall}",
|
|
292
|
+
event_id=event_id,
|
|
216
293
|
)
|
|
217
294
|
else:
|
|
218
295
|
self.fn(
|
|
219
|
-
AgentStatusType.TOOL_CALL,
|
|
220
|
-
f"Executing '{tool_name}' with arguments: {fcall}",
|
|
296
|
+
status_type=AgentStatusType.TOOL_CALL,
|
|
297
|
+
msg=f"Executing '{tool_name}' with arguments: {fcall}",
|
|
298
|
+
event_id=event_id,
|
|
221
299
|
)
|
|
222
300
|
elif EventPayload.FUNCTION_OUTPUT in payload:
|
|
223
301
|
if self.fn:
|
|
224
302
|
response = str(payload.get(EventPayload.FUNCTION_OUTPUT))
|
|
225
303
|
if inspect.iscoroutinefunction(self.fn):
|
|
226
|
-
await self.fn(
|
|
304
|
+
await self.fn(
|
|
305
|
+
status_type=AgentStatusType.TOOL_OUTPUT,
|
|
306
|
+
msg=response,
|
|
307
|
+
event_id=event_id,
|
|
308
|
+
)
|
|
227
309
|
else:
|
|
228
|
-
self.fn(
|
|
310
|
+
self.fn(
|
|
311
|
+
status_type=AgentStatusType.TOOL_OUTPUT,
|
|
312
|
+
msg=response,
|
|
313
|
+
event_id=event_id,
|
|
314
|
+
)
|
|
229
315
|
else:
|
|
230
316
|
print(f"No function call or output found in payload {payload}")
|
|
231
317
|
|
|
232
|
-
async def _ahandle_agent_step(self, payload: dict) -> None:
|
|
318
|
+
async def _ahandle_agent_step(self, payload: dict, event_id: str) -> None:
|
|
233
319
|
if EventPayload.MESSAGES in payload:
|
|
234
320
|
if self.fn:
|
|
235
321
|
msg = str(payload.get(EventPayload.MESSAGES))
|
|
236
322
|
if inspect.iscoroutinefunction(self.fn):
|
|
237
|
-
await self.fn(
|
|
323
|
+
await self.fn(
|
|
324
|
+
status_type=AgentStatusType.AGENT_STEP,
|
|
325
|
+
msg=msg,
|
|
326
|
+
event_id=event_id,
|
|
327
|
+
)
|
|
238
328
|
else:
|
|
239
|
-
self.fn(
|
|
329
|
+
self.fn(
|
|
330
|
+
status_type=AgentStatusType.AGENT_STEP,
|
|
331
|
+
msg=msg,
|
|
332
|
+
event_id=event_id,
|
|
333
|
+
)
|
|
240
334
|
elif EventPayload.RESPONSE in payload:
|
|
241
335
|
if self.fn:
|
|
242
336
|
response = str(payload.get(EventPayload.RESPONSE))
|
|
243
337
|
if inspect.iscoroutinefunction(self.fn):
|
|
244
|
-
await self.fn(
|
|
338
|
+
await self.fn(
|
|
339
|
+
status_type=AgentStatusType.AGENT_STEP,
|
|
340
|
+
msg=response,
|
|
341
|
+
event_id=event_id,
|
|
342
|
+
)
|
|
245
343
|
else:
|
|
246
|
-
self.fn(
|
|
344
|
+
self.fn(
|
|
345
|
+
status_type=AgentStatusType.AGENT_STEP,
|
|
346
|
+
msg=response,
|
|
347
|
+
event_id=event_id,
|
|
348
|
+
)
|
|
247
349
|
else:
|
|
248
350
|
print(f"No messages or prompt found in payload {payload}")
|
vectara_agentic/_version.py
CHANGED
vectara_agentic/agent.py
CHANGED
|
@@ -33,7 +33,7 @@ from llama_index.core.agent.types import BaseAgent
|
|
|
33
33
|
from llama_index.core.workflow import Workflow
|
|
34
34
|
|
|
35
35
|
from .types import (
|
|
36
|
-
AgentType, AgentStatusType, LLMRole, ToolType,
|
|
36
|
+
AgentType, AgentStatusType, LLMRole, ToolType, ModelProvider,
|
|
37
37
|
AgentResponse, AgentStreamingResponse, AgentConfigType
|
|
38
38
|
)
|
|
39
39
|
from .utils import get_llm, get_tokenizer_for_model
|
|
@@ -278,6 +278,10 @@ class Agent:
|
|
|
278
278
|
llm.callback_manager = llm_callback_manager
|
|
279
279
|
|
|
280
280
|
if agent_type == AgentType.FUNCTION_CALLING:
|
|
281
|
+
if config.tool_llm_provider == ModelProvider.OPENAI:
|
|
282
|
+
raise ValueError(
|
|
283
|
+
"Vectara-agentic: Function calling agent type is not supported with the OpenAI LLM."
|
|
284
|
+
)
|
|
281
285
|
prompt = _get_prompt(GENERAL_PROMPT_TEMPLATE, self._topic, self._custom_instructions)
|
|
282
286
|
agent = FunctionCallingAgent.from_tools(
|
|
283
287
|
tools=self.tools,
|
|
@@ -286,7 +290,7 @@ class Agent:
|
|
|
286
290
|
verbose=self.verbose,
|
|
287
291
|
max_function_calls=config.max_reasoning_steps,
|
|
288
292
|
callback_manager=llm_callback_manager,
|
|
289
|
-
system_prompt
|
|
293
|
+
system_prompt=prompt,
|
|
290
294
|
allow_parallel_tool_calls=True,
|
|
291
295
|
)
|
|
292
296
|
elif agent_type == AgentType.REACT:
|
|
@@ -301,6 +305,10 @@ class Agent:
|
|
|
301
305
|
callable_manager=llm_callback_manager,
|
|
302
306
|
)
|
|
303
307
|
elif agent_type == AgentType.OPENAI:
|
|
308
|
+
if config.tool_llm_provider != ModelProvider.OPENAI:
|
|
309
|
+
raise ValueError(
|
|
310
|
+
"Vectara-agentic: OPENAI agent type requires the OpenAI LLM."
|
|
311
|
+
)
|
|
304
312
|
prompt = _get_prompt(GENERAL_PROMPT_TEMPLATE, self._topic, self._custom_instructions)
|
|
305
313
|
agent = OpenAIAgent.from_tools(
|
|
306
314
|
tools=self.tools,
|
vectara_agentic/agent_config.py
CHANGED
|
@@ -71,6 +71,17 @@ class AgentConfig:
|
|
|
71
71
|
default_factory=lambda: int(os.getenv("VECTARA_AGENTIC_MAX_REASONING_STEPS", "50"))
|
|
72
72
|
)
|
|
73
73
|
|
|
74
|
+
def __post_init__(self):
|
|
75
|
+
# Use object.__setattr__ since the dataclass is frozen
|
|
76
|
+
if isinstance(self.agent_type, str):
|
|
77
|
+
object.__setattr__(self, "agent_type", AgentType(self.agent_type))
|
|
78
|
+
if isinstance(self.main_llm_provider, str):
|
|
79
|
+
object.__setattr__(self, "main_llm_provider", ModelProvider(self.main_llm_provider))
|
|
80
|
+
if isinstance(self.tool_llm_provider, str):
|
|
81
|
+
object.__setattr__(self, "tool_llm_provider", ModelProvider(self.tool_llm_provider))
|
|
82
|
+
if isinstance(self.observer, str):
|
|
83
|
+
object.__setattr__(self, "observer", ObserverType(self.observer))
|
|
84
|
+
|
|
74
85
|
def to_dict(self) -> dict:
|
|
75
86
|
"""
|
|
76
87
|
Convert the AgentConfig to a dictionary.
|
vectara_agentic/tools.py
CHANGED
|
@@ -539,8 +539,8 @@ class VectaraToolFactory:
|
|
|
539
539
|
summary = summaries_dict.get(doc_id, "")
|
|
540
540
|
tool_output += f"document_id: '{doc_id}'\nmetadata: '{metadata}'\nsummary: '{summary}'\n\n"
|
|
541
541
|
else:
|
|
542
|
-
for
|
|
543
|
-
tool_output += f"document_id: '{
|
|
542
|
+
for doc_id, metadata in docs:
|
|
543
|
+
tool_output += f"document_id: '{doc_id}'\nmetadata: '{metadata}'\n\n"
|
|
544
544
|
|
|
545
545
|
out = ToolOutput(
|
|
546
546
|
tool_name=search_function.__name__,
|
vectara_agentic/utils.py
CHANGED
|
@@ -43,7 +43,7 @@ def _get_llm_params_for_role(
|
|
|
43
43
|
config = config or AgentConfig() # fallback to default config
|
|
44
44
|
|
|
45
45
|
if role == LLMRole.TOOL:
|
|
46
|
-
model_provider = config.tool_llm_provider
|
|
46
|
+
model_provider = ModelProvider(config.tool_llm_provider)
|
|
47
47
|
# If the user hasn’t explicitly set a tool_llm_model_name,
|
|
48
48
|
# fallback to provider default from provider_to_default_model_name
|
|
49
49
|
model_name = (
|
|
@@ -51,7 +51,7 @@ def _get_llm_params_for_role(
|
|
|
51
51
|
or provider_to_default_model_name.get(model_provider)
|
|
52
52
|
)
|
|
53
53
|
else:
|
|
54
|
-
model_provider = config.main_llm_provider
|
|
54
|
+
model_provider = ModelProvider(config.main_llm_provider)
|
|
55
55
|
model_name = (
|
|
56
56
|
config.main_llm_model_name
|
|
57
57
|
or provider_to_default_model_name.get(model_provider)
|
|
@@ -110,6 +110,7 @@ def get_llm(
|
|
|
110
110
|
llm = Gemini(
|
|
111
111
|
model=model_name, temperature=0,
|
|
112
112
|
is_function_calling_model=True,
|
|
113
|
+
allow_parallel_tool_calls=True,
|
|
113
114
|
max_tokens=max_tokens,
|
|
114
115
|
)
|
|
115
116
|
elif model_provider == ModelProvider.TOGETHER:
|
|
@@ -9,21 +9,21 @@ tests/test_serialization.py,sha256=Ed23GN2zhSJNdPFrVK4aqLkOhJKviczR_o0t-r9TuRI,4
|
|
|
9
9
|
tests/test_tools.py,sha256=IVKn0HoS2erTCr1mOEGzTkktiY0PCfKNvqnD_pizjOg,3977
|
|
10
10
|
tests/test_workflow.py,sha256=lVyrVHdRO5leYNbYtHTmKqMX0c8_xehCpUA7cXQKVsc,2175
|
|
11
11
|
vectara_agentic/__init__.py,sha256=2GLDS3U6KckK-dBRl9v_x1kSV507gEhjOfuMmmu0Qxg,850
|
|
12
|
-
vectara_agentic/_callback.py,sha256=
|
|
12
|
+
vectara_agentic/_callback.py,sha256=lU35-Pxp-fsMpOi4woY6oLECAhO1nSmLIy3b8fbgT54,13029
|
|
13
13
|
vectara_agentic/_observability.py,sha256=fTL3KW0jQU-_JSpFgjO6-XzgDut_oiq9kt4QR-FkSqU,3804
|
|
14
14
|
vectara_agentic/_prompts.py,sha256=LYyiOAiC8imz3U7MSJiuCYAP39afsp7ycXY7-9biyJI,9314
|
|
15
|
-
vectara_agentic/_version.py,sha256=
|
|
16
|
-
vectara_agentic/agent.py,sha256=
|
|
17
|
-
vectara_agentic/agent_config.py,sha256=
|
|
15
|
+
vectara_agentic/_version.py,sha256=H4T1Nr91mODgWHnEWr2XhUyVnkEh_ZuEEayYoJS0Iis,65
|
|
16
|
+
vectara_agentic/agent.py,sha256=ItNy6QRfgkk-zePK05k8yhsov_TVh5ScB-BbiQdUbTY,43956
|
|
17
|
+
vectara_agentic/agent_config.py,sha256=E-rtYMcpoGxnEAyy8231bizo2n0uGQ2qWxuSgTEfwdQ,4327
|
|
18
18
|
vectara_agentic/agent_endpoint.py,sha256=QIMejCLlpW2qzXxeDAxv3anF46XMDdVMdKGWhJh3azY,1996
|
|
19
19
|
vectara_agentic/db_tools.py,sha256=Go03bzma9m-qDH0CPP8hWhf1nu_4S6s7ke0jGqz58Pk,10296
|
|
20
20
|
vectara_agentic/sub_query_workflow.py,sha256=3WoVnryR2NXyYXbLDM1XVLd7DtbCG0jgrVqeDUN4YNQ,10943
|
|
21
|
-
vectara_agentic/tools.py,sha256=
|
|
21
|
+
vectara_agentic/tools.py,sha256=vOIevyGhApeZ46UelSTXmKXWE26Z2KtjLgsb4cHP49M,42579
|
|
22
22
|
vectara_agentic/tools_catalog.py,sha256=oiw3wAfbpFhh0_6rMvZsyPqWV6QIzHqhZCNzqRxuyV8,4818
|
|
23
23
|
vectara_agentic/types.py,sha256=HcS7vR8P2v2xQTlOc6ZFV2vvlr3OpzSNWhtcLMxqUZc,1792
|
|
24
|
-
vectara_agentic/utils.py,sha256=
|
|
25
|
-
vectara_agentic-0.2.
|
|
26
|
-
vectara_agentic-0.2.
|
|
27
|
-
vectara_agentic-0.2.
|
|
28
|
-
vectara_agentic-0.2.
|
|
29
|
-
vectara_agentic-0.2.
|
|
24
|
+
vectara_agentic/utils.py,sha256=4vA5MyNoG47_7eHuLFQByiG_FHWbrQ6ZJDsdqHUwiJA,7720
|
|
25
|
+
vectara_agentic-0.2.9.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
26
|
+
vectara_agentic-0.2.9.dist-info/METADATA,sha256=FfjEtidIWQlsUXY_cdVIxPc6h07M3JwXjQKEj3aCMLY,25046
|
|
27
|
+
vectara_agentic-0.2.9.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
|
28
|
+
vectara_agentic-0.2.9.dist-info/top_level.txt,sha256=Y7TQTFdOYGYodQRltUGRieZKIYuzeZj2kHqAUpfCUfg,22
|
|
29
|
+
vectara_agentic-0.2.9.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|