Merge pull request 'Windows css fixend and backend' (#17) from React-Group/ai-virtual-assistant:main into main
Reviewed-on: https://interstellardevelopment.org/code/code/sageTheDm/ai-virtual-assistant/pulls/17
This commit is contained in:
		
						commit
						3f379fef42
					
				
					 4 changed files with 10 additions and 8 deletions
				
			
		|  | @ -1,9 +1,9 @@ | ||||||
| import requests | import requests | ||||||
| import json | import json | ||||||
| from gradio_client import Client | from gradio_client import Client | ||||||
| import os |  | ||||||
| from mistralai import Mistral | from mistralai import Mistral | ||||||
| 
 | 
 | ||||||
|  | 
 | ||||||
| class API: | class API: | ||||||
|     @staticmethod |     @staticmethod | ||||||
|     def process_text_mistralai(prompt, model, system): |     def process_text_mistralai(prompt, model, system): | ||||||
|  | @ -27,6 +27,7 @@ class API: | ||||||
|             ] |             ] | ||||||
|         ) |         ) | ||||||
|         return chat_response.choices[0].message.content |         return chat_response.choices[0].message.content | ||||||
|  | 
 | ||||||
|     @staticmethod |     @staticmethod | ||||||
|     def process_text_gradio(prompt, model, system): |     def process_text_gradio(prompt, model, system): | ||||||
|         client = Client(model) |         client = Client(model) | ||||||
|  | @ -38,7 +39,7 @@ class API: | ||||||
|             top_p=0.95, |             top_p=0.95, | ||||||
|             api_name="/chat" |             api_name="/chat" | ||||||
|         ) |         ) | ||||||
|         return result; |         return result | ||||||
| 
 | 
 | ||||||
|     # This method processes a message via ollama |     # This method processes a message via ollama | ||||||
|     @staticmethod |     @staticmethod | ||||||
|  |  | ||||||
|  | @ -1,6 +1,6 @@ | ||||||
| #!/bin/bash | #!/bin/bash | ||||||
| 
 | 
 | ||||||
| python3 -m venv venv | python -m venv venv | ||||||
| source venv/bin/activate | source venv/bin/activate | ||||||
| pip install flask | pip install flask | ||||||
| pip install SpeechRecognition | pip install SpeechRecognition | ||||||
|  | @ -15,3 +15,5 @@ pip install mistralai | ||||||
| ollama pull phi3.5 | ollama pull phi3.5 | ||||||
| ollama pull codegemma:2b | ollama pull codegemma:2b | ||||||
| ollama pull gemma2:9b | ollama pull gemma2:9b | ||||||
|  | 
 | ||||||
|  | python web_flask.py | ||||||
|  | @ -280,6 +280,7 @@ header a:hover { | ||||||
|     color: white; |     color: white; | ||||||
|     border: none; |     border: none; | ||||||
|     padding: 0; |     padding: 0; | ||||||
|  |     margin: 5px; | ||||||
|     cursor: pointer; |     cursor: pointer; | ||||||
|     transition: transform 0.2s ease-in-out; |     transition: transform 0.2s ease-in-out; | ||||||
| } | } | ||||||
|  | @ -326,7 +327,8 @@ header a:hover { | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| .input button { | .input button { | ||||||
|     padding: 12px 20px; |     padding:1em; | ||||||
|  |     margin: 5px; | ||||||
|     background-color: var(--input-button-color); |     background-color: var(--input-button-color); | ||||||
|     color: white; |     color: white; | ||||||
|     border: none; |     border: none; | ||||||
|  |  | ||||||
|  | @ -1,5 +1,3 @@ | ||||||
| #!venv/bin/python |  | ||||||
| 
 |  | ||||||
| from flask import Flask, request, render_template | from flask import Flask, request, render_template | ||||||
| from api import API | from api import API | ||||||
| from voice_recognition import Voice | from voice_recognition import Voice | ||||||
|  | @ -40,12 +38,11 @@ def index(): | ||||||
| 
 | 
 | ||||||
|         system += "The chat log is now finished." |         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) |         messages.append(ai_response) | ||||||
| 
 | 
 | ||||||
|     return render_template('index.html', messages=messages) |     return render_template('index.html', messages=messages) | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
| @APP.route('/faq') | @APP.route('/faq') | ||||||
| def faq(): | def faq(): | ||||||
|     return render_template('faq.html') |     return render_template('faq.html') | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue