Windows css fixend and backend #17

Merged
sageTheDm merged 6 commits from React-Group/ai-virtual-assistant:main into main 2024-09-17 13:51:15 +02:00
3 changed files with 7 additions and 6 deletions
Showing only changes of commit 0f3b5cb49a - Show all commits

View file

@ -1,9 +1,9 @@
import requests
import json
from gradio_client import Client
import os
from mistralai import Mistral
class API:
@staticmethod
def process_text_mistralai(prompt, model, system):
@ -27,6 +27,7 @@ class API:
]
)
return chat_response.choices[0].message.content
@staticmethod
def process_text_gradio(prompt, model, system):
client = Client(model)
@ -38,7 +39,7 @@ class API:
top_p=0.95,
api_name="/chat"
)
return result;
return result
# This method processes a message via ollama
@staticmethod

View file

@ -1,6 +1,6 @@
#!/bin/bash
python3 -m venv venv
python -m venv venv
source venv/bin/activate
pip install flask
pip install SpeechRecognition
@ -15,3 +15,5 @@ pip install mistralai
ollama pull phi3.5
ollama pull codegemma:2b
ollama pull gemma2:9b
python web_flask.py

View file

@ -1,5 +1,3 @@
#!venv/bin/python
from flask import Flask, request, render_template
from api import API
from voice_recognition import Voice
@ -40,7 +38,7 @@ def index():
system += "The chat log is now finished."
ai_response = "AI: " + api.send_message(user_message, 5, system)
ai_response = "AI: " + api.send_message(user_message, 4, system)
messages.append(ai_response)
return render_template('index.html', messages=messages)