Initial setup for the project
This commit is contained in:
@@ -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)
|
||||
Reference in New Issue
Block a user