Initial setup for the project

This commit is contained in:
Joakim Persson
2024-07-15 16:53:01 +02:00
parent 7340e32ce4
commit d771951b80
16 changed files with 488 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
# Example function to interact with OLLAMA
from ollama import Client
def get_response(user_query):
client = Client()
response = client.generate_response(user_query)
return response
# Flask endpoint for user interaction
from flask import Flask, request, jsonify
app = Flask(__name__)
@app.route('/smartassist', methods=['POST'])
def smartassist():
data = request.json
user_query = data['query']
response = get_response(user_query)
return jsonify({"response": response})
if __name__ == '__main__':
app.run(debug=True)