mirror of
https://github.com/tiennm99/DocsGPT.git
synced 2026-10-13 12:14:00 +00:00
fix: GoogleLLM, agent and handler according to the new genai SDK
This commit is contained in:
1 parent
ec270a3b54
commit
904b0bf2da
4 files changed
+116
-158
No files matched your search
@@ -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