Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions llm/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1458,7 +1458,7 @@ def log_to_db(self, db):
"response_id": response_id,
}
)
for tool_call in self.tool_calls(): # TODO Should be _or_raise()
for tool_call in self.tool_calls():
db["tool_calls"].insert(
{
"response_id": response_id,
Expand All @@ -1470,15 +1470,16 @@ def log_to_db(self, db):
)
for tool_result in self.prompt.tool_results:
instance_id = None
tool_def = tool_ids_by_name.get(tool_result.name)
if tool_result.instance:
try:
if not tool_result.instance.instance_id:
tool_result.instance.instance_id = (
db["tool_instances"]
.insert(
{
"plugin": tool.plugin,
"name": tool.name.split("_")[0],
"plugin": (tool_def.plugin if tool_def else None),
"name": (tool_def.name.split("_")[0] if tool_def else None),
"arguments": json.dumps(
tool_result.instance._config
),
Expand Down