Update app.py
Browse files
app.py
CHANGED
|
@@ -2,23 +2,23 @@ import os
|
|
| 2 |
import json
|
| 3 |
import requests
|
| 4 |
import gradio as gr
|
| 5 |
-
from
|
| 6 |
from langchain.prompts import ChatPromptTemplate
|
| 7 |
|
| 8 |
API_URL = "https://agents-course-unit4-scoring.hf.space"
|
| 9 |
|
| 10 |
-
|
|
|
|
| 11 |
def build_agent():
|
| 12 |
prompt = ChatPromptTemplate.from_messages([
|
| 13 |
-
("system",
|
| 14 |
-
"You are
|
| 15 |
-
"You
|
| 16 |
-
"No explanation. No steps."),
|
| 17 |
("user", "{question}")
|
| 18 |
])
|
| 19 |
|
| 20 |
llm = ChatOpenAI(
|
| 21 |
-
|
| 22 |
temperature=0
|
| 23 |
)
|
| 24 |
|
|
|
|
| 2 |
import json
|
| 3 |
import requests
|
| 4 |
import gradio as gr
|
| 5 |
+
from langchain.chat_models import ChatOpenAI
|
| 6 |
from langchain.prompts import ChatPromptTemplate
|
| 7 |
|
| 8 |
API_URL = "https://agents-course-unit4-scoring.hf.space"
|
| 9 |
|
| 10 |
+
|
| 11 |
+
# --- AGENT DE BASE (LCEL) ---
|
| 12 |
def build_agent():
|
| 13 |
prompt = ChatPromptTemplate.from_messages([
|
| 14 |
+
("system",
|
| 15 |
+
"You are a precise reasoning AI. "
|
| 16 |
+
"You answer ONLY the final answer, no explanations."),
|
|
|
|
| 17 |
("user", "{question}")
|
| 18 |
])
|
| 19 |
|
| 20 |
llm = ChatOpenAI(
|
| 21 |
+
model_name="gpt-4o-mini",
|
| 22 |
temperature=0
|
| 23 |
)
|
| 24 |
|