sqfoo commited on
Commit
c984898
·
verified ·
1 Parent(s): 7834ac8

Update agent.py

Browse files
Files changed (1) hide show
  1. agent.py +14 -7
agent.py CHANGED
@@ -1,7 +1,7 @@
1
  import os
2
  from typing import TypedDict, List, Dict, Any, Optional
3
  from langgraph.graph import StateGraph, START, END
4
- from langchain_anthropic import ChatAnthropic
5
  from langchain_core.tools import tool
6
  from langchain_core.messages import HumanMessage
7
  from langchain_core.prompts import ChatPromptTemplate
@@ -79,20 +79,27 @@ def image_caption(dir: str) -> str:
79
  # 2. Coding
80
  # 3. Multi-Modality
81
 
82
-
83
-
84
  # ("human", f"Question: {question}\nReport to validate: {final_answer}")
85
  class BasicAgent:
86
  def __init__(self):
87
- model = ChatAnthropic(
88
- model="claude-3-5-sonnet-20240620",
89
  temperature=0,
90
- max_tokens=20000,
91
  timeout=None,
92
  max_retries=2,
93
- api_key=os.getenv("ANTHROPIC_API_KEY"),
94
  # other params...
95
  )
 
 
 
 
 
 
 
 
 
96
  # System Prompt for few shot prompting
97
  self.sys_prompt = """"
98
  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].
 
1
  import os
2
  from typing import TypedDict, List, Dict, Any, Optional
3
  from langgraph.graph import StateGraph, START, END
4
+ from langchain_google_genai import ChatGoogleGenerativeAI
5
  from langchain_core.tools import tool
6
  from langchain_core.messages import HumanMessage
7
  from langchain_core.prompts import ChatPromptTemplate
 
79
  # 2. Coding
80
  # 3. Multi-Modality
81
 
 
 
82
  # ("human", f"Question: {question}\nReport to validate: {final_answer}")
83
  class BasicAgent:
84
  def __init__(self):
85
+ model = ChatGoogleGenerativeAI(
86
+ model="gemini-2.0-flash",
87
  temperature=0,
88
+ max_tokens=None,
89
  timeout=None,
90
  max_retries=2,
91
+ google_api_key="AIzaSyAxVUPaGJIgdxB46ZR0RWPKSjB9a63Z80o",
92
  # other params...
93
  )
94
+ # model = ChatAnthropic(
95
+ # model="claude-3-5-sonnet-20240620",
96
+ # temperature=0,
97
+ # max_tokens=20000,
98
+ # timeout=None,
99
+ # max_retries=2,
100
+ # api_key=os.getenv("ANTHROPIC_API_KEY"),
101
+ # # other params...
102
+ # )
103
  # System Prompt for few shot prompting
104
  self.sys_prompt = """"
105
  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].