Update app.py
Browse files
app.py
CHANGED
@@ -4,7 +4,7 @@ import requests
|
|
4 |
import pandas as pd
|
5 |
from dotenv import load_dotenv
|
6 |
from langchain_openai import ChatOpenAI
|
7 |
-
|
8 |
|
9 |
# Load environment variables
|
10 |
load_dotenv()
|
@@ -14,8 +14,8 @@ DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
|
14 |
|
15 |
# --- Basic Agent Definition ---
|
16 |
class BasicAgent:
|
17 |
-
def __init__(self):
|
18 |
-
|
19 |
self.instructions = """You are a helpful assistant. For every question, reply with only the answer—no explanation, "
|
20 |
"no units, and no extra words. If the answer is a number, just return the number. "
|
21 |
"If it is a word or phrase, return only that. If it is a list, return a comma-separated list with no extra words. "
|
|
|
4 |
import pandas as pd
|
5 |
from dotenv import load_dotenv
|
6 |
from langchain_openai import ChatOpenAI
|
7 |
+
from langchain_nvidia_ai_endpoints import ChatNVIDIA
|
8 |
|
9 |
# Load environment variables
|
10 |
load_dotenv()
|
|
|
14 |
|
15 |
# --- Basic Agent Definition ---
|
16 |
class BasicAgent:
|
17 |
+
def __init__(self):
|
18 |
+
llm=ChatNVIDIA(model="meta/llama-3.3-70b-instruct",nvidia_api_key=os.getenv("NVIDIA_API_KEY"))
|
19 |
self.instructions = """You are a helpful assistant. For every question, reply with only the answer—no explanation, "
|
20 |
"no units, and no extra words. If the answer is a number, just return the number. "
|
21 |
"If it is a word or phrase, return only that. If it is a list, return a comma-separated list with no extra words. "
|