Mike Jay
wip run using API env vars
a85a69f
raw
history blame
677 Bytes
"""Application File"""
import os
from smolagents import GradioUI, CodeAgent, InferenceClientModel
from retriever import load_guest_dataset
OPENAI_API_KEY = os.environ["OPENAI_API_KEY"]
BASE_URL = os.environ["BASE_URL"]
model = InferenceClientModel(api_key=OPENAI_API_KEY, base_url=BASE_URL)
# Load the guest dataset and initialize the guest info tool
guest_info_tool = load_guest_dataset()
# Create Alfred with all the tools
alfred = CodeAgent(
tools=[guest_info_tool],
model=model,
add_base_tools=True, # Add any additional base tools
planning_interval=3, # Enable planning every 3 steps
)
if __name__ == "__main__":
GradioUI(alfred).launch()