David commited on
Commit ·
095d02f
1
Parent(s): cefa420
Setting gemini with llamaindex
Browse filesFiles changed (3)
- agent.pyAdded+16
- gaia_system_prompt.pyAdded+6
- requirements.txt+1
12345678910111213141516from llama_index.llms.google_genai import GoogleGenAIimport os
GEMINI_API_KEY = os.getenv("GEMINI_TOKEN")GEMINI_MODEL_NAME = "gemini-2.5-flash-preview-04-17"
class FinalAgent: def __init__(self): self.llm = GoogleGenAI(model=GEMINI_MODEL_NAME, api_key=GEMINI_API_KEY)
print("FinalAgent initialized.") def __call__(self, question: str) -> str: print(f"Agent received question (first 50 chars): {question[:50]}...") fixed_answer = "This is a default answer." print(f"Agent returning fixed answer: {fixed_answer}") return fixed_answer123456GAIA_SYSTEM_PROMPT="""You are a general AI assistant. I will ask you a question. Report your thoughts, and finish your answer with the following template: FINAL ANSWER: [YOUR FINAL ANSWER]. YOUR FINAL ANSWER should be a number OR as few words as possible OR a comma separated list of numbers and/or strings. If you are asked for a number, don't use comma to write your number neither use units such as $ or percent sign unless specified otherwise. If you are asked for a string, don't use articles, neither abbreviations (e.g. for cities), and write the digits in plain text unless specified otherwise. If you are asked for a comma separated list, apply the above rules depending of whether the element to be put in the list is a number or a string."""3 unmodified lines456783 unmodified linespandasllama-indexllama-index-llms-geminillama-index-llms-google-genaillama-index-utils-workflowagent.pyAdded+16
gaia_system_prompt.pyAdded+6
requirements.txt+1