Closed sus2790 closed 2 weeks ago
any updates?
@sus2790 Hi there! 👋 I suggest posting this in the #help channel of our developer community on Discord if the following suggestions don't help.
I'm wondering if the way you're parsing your function arguments is leading to an issue. You're passing **function_args
to the function call, but it's a JSON string that needs to be parsed first. Try replacing with:
function_args = json.loads(tool_call.function.arguments)
function_response = await function_to_call(**function_args)
Also try modifying your _researches
function to accept **kwargs
:
async def _researches(**kwargs):
query = kwargs.get('query')
language = kwargs.get('language', 'zh-TW')
try:
result = await researches.asearch(query, hl=language)
return orjson.dumps({"result": result}).decode("utf-8")
except Exception as e:
return orjson.dumps({"error": str(e)}).decode("utf-8")
I often got a call_id:
pending
tool call, it seems like it is missingPython 3.12.5 & Groq 0.9.0 Pip List: pastebin Code: pastebin