kodeagent 0.11.1__tar.gz → 0.11.2__tar.gz
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.
- {kodeagent-0.11.1/src/kodeagent.egg-info → kodeagent-0.11.2}/PKG-INFO +1 -1
- {kodeagent-0.11.1 → kodeagent-0.11.2}/src/kodeagent/_version.py +1 -1
- {kodeagent-0.11.1 → kodeagent-0.11.2}/src/kodeagent/fca.py +18 -2
- {kodeagent-0.11.1 → kodeagent-0.11.2/src/kodeagent.egg-info}/PKG-INFO +1 -1
- {kodeagent-0.11.1 → kodeagent-0.11.2}/LICENSE +0 -0
- {kodeagent-0.11.1 → kodeagent-0.11.2}/MANIFEST.in +0 -0
- {kodeagent-0.11.1 → kodeagent-0.11.2}/README.md +0 -0
- {kodeagent-0.11.1 → kodeagent-0.11.2}/pyproject.toml +0 -0
- {kodeagent-0.11.1 → kodeagent-0.11.2}/requirements.txt +0 -0
- {kodeagent-0.11.1 → kodeagent-0.11.2}/setup.cfg +0 -0
- {kodeagent-0.11.1 → kodeagent-0.11.2}/src/kodeagent/__init__.py +0 -0
- {kodeagent-0.11.1 → kodeagent-0.11.2}/src/kodeagent/code_reviewer.py +0 -0
- {kodeagent-0.11.1 → kodeagent-0.11.2}/src/kodeagent/code_runner.py +0 -0
- {kodeagent-0.11.1 → kodeagent-0.11.2}/src/kodeagent/examples.py +0 -0
- {kodeagent-0.11.1 → kodeagent-0.11.2}/src/kodeagent/file_tracker.py +0 -0
- {kodeagent-0.11.1 → kodeagent-0.11.2}/src/kodeagent/history_formatter.py +0 -0
- {kodeagent-0.11.1 → kodeagent-0.11.2}/src/kodeagent/kodeagent.py +0 -0
- {kodeagent-0.11.1 → kodeagent-0.11.2}/src/kodeagent/kutils.py +0 -0
- {kodeagent-0.11.1 → kodeagent-0.11.2}/src/kodeagent/models.py +0 -0
- {kodeagent-0.11.1 → kodeagent-0.11.2}/src/kodeagent/orchestrator.py +0 -0
- {kodeagent-0.11.1 → kodeagent-0.11.2}/src/kodeagent/pattern_detector.py +0 -0
- {kodeagent-0.11.1 → kodeagent-0.11.2}/src/kodeagent/prompts/agent_plan.txt +0 -0
- {kodeagent-0.11.1 → kodeagent-0.11.2}/src/kodeagent/prompts/code_guardrail.txt +0 -0
- {kodeagent-0.11.1 → kodeagent-0.11.2}/src/kodeagent/prompts/contextual_summary.txt +0 -0
- {kodeagent-0.11.1 → kodeagent-0.11.2}/src/kodeagent/prompts/observation.txt +0 -0
- {kodeagent-0.11.1 → kodeagent-0.11.2}/src/kodeagent/prompts/salvage_response.txt +0 -0
- {kodeagent-0.11.1 → kodeagent-0.11.2}/src/kodeagent/prompts/system/codeact.txt +0 -0
- {kodeagent-0.11.1 → kodeagent-0.11.2}/src/kodeagent/prompts/system/function_calling.txt +0 -0
- {kodeagent-0.11.1 → kodeagent-0.11.2}/src/kodeagent/prompts/system/observer.txt +0 -0
- {kodeagent-0.11.1 → kodeagent-0.11.2}/src/kodeagent/prompts/system/plan_updater.txt +0 -0
- {kodeagent-0.11.1 → kodeagent-0.11.2}/src/kodeagent/prompts/system/planner.txt +0 -0
- {kodeagent-0.11.1 → kodeagent-0.11.2}/src/kodeagent/prompts/system/react.txt +0 -0
- {kodeagent-0.11.1 → kodeagent-0.11.2}/src/kodeagent/prompts/update_plan.txt +0 -0
- {kodeagent-0.11.1 → kodeagent-0.11.2}/src/kodeagent/tools.py +0 -0
- {kodeagent-0.11.1 → kodeagent-0.11.2}/src/kodeagent/tracer.py +0 -0
- {kodeagent-0.11.1 → kodeagent-0.11.2}/src/kodeagent/usage_tracker.py +0 -0
- {kodeagent-0.11.1 → kodeagent-0.11.2}/src/kodeagent.egg-info/SOURCES.txt +0 -0
- {kodeagent-0.11.1 → kodeagent-0.11.2}/src/kodeagent.egg-info/dependency_links.txt +0 -0
- {kodeagent-0.11.1 → kodeagent-0.11.2}/src/kodeagent.egg-info/requires.txt +0 -0
- {kodeagent-0.11.1 → kodeagent-0.11.2}/src/kodeagent.egg-info/top_level.txt +0 -0
|
@@ -57,6 +57,7 @@ FINAL_ANSWER_TOOL_NAME = 'final_answer'
|
|
|
57
57
|
|
|
58
58
|
def final_answer(result: str) -> str:
|
|
59
59
|
"""Provide the final answer to the user's task and end the conversation.
|
|
60
|
+
Always call this tool when you have enough information to answer.
|
|
60
61
|
|
|
61
62
|
Args:
|
|
62
63
|
result: The final answer or result of the task.
|
|
@@ -64,7 +65,12 @@ def final_answer(result: str) -> str:
|
|
|
64
65
|
Returns:
|
|
65
66
|
The final answer text in user-readable format.
|
|
66
67
|
"""
|
|
67
|
-
|
|
68
|
+
if isinstance(result, dict):
|
|
69
|
+
# Drop keys, combine the values
|
|
70
|
+
return '\n\n'.join(str(v) for v in result.values())
|
|
71
|
+
if isinstance(result, list):
|
|
72
|
+
return '\n\n'.join(str(item) for item in result)
|
|
73
|
+
return str(result) if not isinstance(result, str) else result
|
|
68
74
|
|
|
69
75
|
|
|
70
76
|
class FunctionCallingAgent:
|
|
@@ -216,7 +222,7 @@ class FunctionCallingAgent:
|
|
|
216
222
|
)
|
|
217
223
|
else:
|
|
218
224
|
tool_result = None
|
|
219
|
-
for key in ('result', 'answer', 'response', 'output', 'reply'):
|
|
225
|
+
for key in ('result', 'reason', 'answer', 'response', 'output', 'reply'):
|
|
220
226
|
value = args.get(key)
|
|
221
227
|
if value is not None:
|
|
222
228
|
tool_result = value
|
|
@@ -224,6 +230,11 @@ class FunctionCallingAgent:
|
|
|
224
230
|
|
|
225
231
|
if tool_result is None:
|
|
226
232
|
result = 'Error: `final_answer` called without a result.'
|
|
233
|
+
elif isinstance(tool_result, (dict, list)):
|
|
234
|
+
try:
|
|
235
|
+
result = json.dumps(tool_result, ensure_ascii=False, indent=2)
|
|
236
|
+
except (TypeError, ValueError):
|
|
237
|
+
result = str(tool_result)
|
|
227
238
|
else:
|
|
228
239
|
result = str(tool_result)
|
|
229
240
|
else:
|
|
@@ -248,6 +259,11 @@ class FunctionCallingAgent:
|
|
|
248
259
|
f'Error: Tool `{name}` returned an empty result. '
|
|
249
260
|
'The query may have returned no data.'
|
|
250
261
|
)
|
|
262
|
+
elif isinstance(tool_result, (dict, list)):
|
|
263
|
+
try:
|
|
264
|
+
result = json.dumps(tool_result, ensure_ascii=False, indent=2)
|
|
265
|
+
except (TypeError, ValueError):
|
|
266
|
+
result = str(tool_result)
|
|
251
267
|
else:
|
|
252
268
|
result = str(tool_result)
|
|
253
269
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|