Transformers
Italian
English
semantic-search
explainable-ai
faiss
ai-ethics
responsible-ai
llm
prompt-engineering
multimodal-ai
ai-transparency
ethical-intelligence
explainable-llm
cognitive-ai
ethical-ai
scientific-retrieval
modular-ai
memory-augmented-llm
trustworthy-ai
reasoning-engine
ai-alignment
next-gen-llm
thinking-machines
open-source-ai
explainability
ai-research
semantic audit
cognitive agent
human-centered-ai
Create interaction/final_response.py
Browse files
src/interaction/final_response.py
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#Visualizzazione risposta
|
| 2 |
+
risposta = None
|
| 3 |
+
try:
|
| 4 |
+
risposta = llm.invoke(prompt.strip())
|
| 5 |
+
except Exception as e:
|
| 6 |
+
logging.error(f"Errore nella generazione della risposta: {e}")
|
| 7 |
+
|
| 8 |
+
if risposta:
|
| 9 |
+
print("\nRisultato:\n")
|
| 10 |
+
print(getattr(risposta, "content", str(risposta)))
|
| 11 |
+
else:
|
| 12 |
+
print("Nessuna risposta disponibile.")
|