Spaces:
Running
Running
from smolagents import OpenAIServerModel,CodeAgent | |
from dotenv import load_dotenv | |
import os | |
from tools import AtlasiaHubInfoTool | |
from retrieve import about_atlasia | |
load_dotenv() | |
def init_model(): | |
key=os.getenv("GOOGLE_API_KEY") | |
model=OpenAIServerModel( | |
api_base="https://generativelanguage.googleapis.com/v1beta", | |
api_key=key, | |
model_id="gemini-2.0-flash" | |
) | |
return model | |
def init_agent(): | |
model=init_model() | |
agent=CodeAgent( | |
tools=[AtlasiaHubInfoTool(),about_atlasia], | |
model=model, | |
) | |
return agent |