mirror of
https://github.com/arc53/DocsGPT.git
synced 2025-11-29 16:43:16 +00:00
fix: GoogleLLM, agent and handler according to the new genai SDK
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
import json
|
||||
|
||||
from google.protobuf.json_format import MessageToDict
|
||||
|
||||
|
||||
class ToolActionParser:
|
||||
def __init__(self, llm_type):
|
||||
@@ -22,8 +20,7 @@ class ToolActionParser:
|
||||
return tool_id, action_name, call_args
|
||||
|
||||
def _parse_google_llm(self, call):
|
||||
call = MessageToDict(call._pb)
|
||||
call_args = call["args"]
|
||||
tool_id = call["name"].split("_")[-1]
|
||||
action_name = call["name"].rsplit("_", 1)[0]
|
||||
call_args = call.args
|
||||
tool_id = call.name.split("_")[-1]
|
||||
action_name = call.name.rsplit("_", 1)[0]
|
||||
return tool_id, action_name, call_args
|
||||
|
||||
Reference in New Issue
Block a user