Skip to content

Commit

Permalink
🐛
Browse files Browse the repository at this point in the history
  • Loading branch information
henryhamon committed May 7, 2024
1 parent b9411a5 commit df6728c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/dc/irisMediCopilot/core/MediCopilot.cls
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Method ExecuteRequest(question As %String, sessionId As %String = "") As %Dynami

ClassMethod RetrieveAnswer(apiKey As %String, collectionName As %String, question As %String, sessionId As %String = "") [ Language = python ]
{
import json
from langchain_iris import IRISVector
from langchain_community.chat_message_histories import ChatMessageHistory
from langchain_core.chat_history import BaseChatMessageHistory
Expand Down Expand Up @@ -114,9 +115,9 @@ ClassMethod RetrieveAnswer(apiKey As %String, collectionName As %String, questio
},
)

return "{'answer': '" + ai_msg_1['answer'] +", 'context': '"+ai_msg_1['context']+"'}"
return json.dumps({"answer": ai_msg_1['answer'], "context": ai_msg_1['context']})
except:
return "{'error': 'API ERROR'}"
return json.dumps({"error": "API ERROR"})
}

}

0 comments on commit df6728c

Please sign in to comment.