whapy
08/21/2024, 7:34 PMclass SearchKnowledgeBaseToolApi(APIView):
def post(self, request, public_id):
"""
Search Knowledge Base API
"""
function_call_id = request.data['message']['toolCalls'][0]['id']
function_call_search_term = request.data['message']['toolCalls'][0]['function']['arguments']['search_term']
print(function_call_id)
print(function_call_search_term)
function_call_response = 'Example response text'
return Response({
'role': 'tool',
'content': function_call_response,
'tool_call_id': function_call_id,
})
I return the response as OpenAI expects a response message, but my assistant doesn't seem to get the answer fed properly