Skip to content

Commit

Permalink
WIP: Mirror Ollama chat API
Browse files Browse the repository at this point in the history
  • Loading branch information
TilmanGriesel committed Jan 29, 2025
1 parent 6313d37 commit 1c749ff
Showing 1 changed file with 5 additions and 16 deletions.
21 changes: 5 additions & 16 deletions services/api/src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,22 +481,11 @@ def handle_standard_response(
success = False
logger.error(f"Error in RAG pipeline: {e}", exc_info=True)

if success and result:
latest_message = {
"role": "assistant",
"content": result["llm"]["replies"][0],
"timestamp": datetime.now().isoformat(),
}
conversation.append(latest_message)

return jsonify(
{
"success": success,
"timestamp": datetime.now().isoformat(),
"result": result,
"messages": conversation,
}
)
return jsonify({
"success": success,
"timestamp": datetime.now().isoformat(),
"result": result
})

@app.route("/", methods=["GET"])
@app.route("/health", methods=["GET"])
Expand Down

0 comments on commit 1c749ff

Please sign in to comment.