CoolFace
Apppublic

mathidot111/First_agent_template

sourceHugging Faceupdated 4mo agoView on Hugging Face
0likes
test.py35 linesDownload Raw Back to root
1from llama_index.llms.huggingface_api import HuggingFaceInferenceAPI2import os3from dotenv import load_dotenv4 5# Load the .env file6load_dotenv()7 8# Retrieve HF_TOKEN from the environment variables9hf_token = os.getenv("HF_TOKEN")10gemini_api_key = os.getenv("GEMINI_API_KEY");11 12 13model = LiteLLMModel(14    model_id="gemini/gemini-2.5-flash",15    temperature=0.216)17 18agent = CodeAgent(19    tools=[query_market_asset], 20    model=model,21    max_steps=522)23 24llm = HuggingFaceInferenceAPI(25    model_name="Qwen/Qwen2.5-Coder-32B-Instruct",26    temperature=0.7,27    max_tokens=100,28    token=hf_token,29    provider="auto"30)31 32response = llm.complete("Hello, how are you?")33print(response)34# I am good, how can I help you today?35