Update app.py
Browse files
app.py
CHANGED
|
@@ -9,6 +9,8 @@ from Gradio_UI import GradioUI
|
|
| 9 |
from typing import Dict, List
|
| 10 |
from bs4 import BeautifulSoup
|
| 11 |
|
|
|
|
|
|
|
| 12 |
@tool
|
| 13 |
def get_exchange_rate(base_currency: str, target_currency: str) -> float:
|
| 14 |
"""A tool that fetches the current exchange rate between two currencies.
|
|
@@ -80,7 +82,7 @@ def get_supported_currencies() -> List[Dict[str, str]]:
|
|
| 80 |
return response.json()["data"]
|
| 81 |
|
| 82 |
final_answer = FinalAnswerTool()
|
| 83 |
-
|
| 84 |
model = HfApiModel(
|
| 85 |
max_tokens=2096,
|
| 86 |
temperature=0.5,
|
|
@@ -92,10 +94,10 @@ model = OpenAIServerModel(
|
|
| 92 |
max_tokens=2096,
|
| 93 |
temperature=0.5,
|
| 94 |
model_id="gpt-4o-mini",
|
| 95 |
-
api_key=
|
| 96 |
custom_role_conversions=None,
|
| 97 |
)
|
| 98 |
-
|
| 99 |
|
| 100 |
# Import tool from Hub
|
| 101 |
image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
|
|
|
|
| 9 |
from typing import Dict, List
|
| 10 |
from bs4 import BeautifulSoup
|
| 11 |
|
| 12 |
+
apikey = os.getenv("OPENAI_API_KEY")
|
| 13 |
+
|
| 14 |
@tool
|
| 15 |
def get_exchange_rate(base_currency: str, target_currency: str) -> float:
|
| 16 |
"""A tool that fetches the current exchange rate between two currencies.
|
|
|
|
| 82 |
return response.json()["data"]
|
| 83 |
|
| 84 |
final_answer = FinalAnswerTool()
|
| 85 |
+
"""
|
| 86 |
model = HfApiModel(
|
| 87 |
max_tokens=2096,
|
| 88 |
temperature=0.5,
|
|
|
|
| 94 |
max_tokens=2096,
|
| 95 |
temperature=0.5,
|
| 96 |
model_id="gpt-4o-mini",
|
| 97 |
+
api_key= apikey,
|
| 98 |
custom_role_conversions=None,
|
| 99 |
)
|
| 100 |
+
|
| 101 |
|
| 102 |
# Import tool from Hub
|
| 103 |
image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
|