jcleee commited on
Commit
349c2a9
·
verified ·
1 Parent(s): c589af7

Update agent.py

Browse files
Files changed (1) hide show
  1. agent.py +25 -26
agent.py CHANGED
@@ -697,44 +697,43 @@ def get_youtube_transcript(url: str) -> str:
697
  except:
698
  pass
699
 
 
 
 
700
  class BasicAgent:
701
  def __init__(self):
702
  print("BasicAgent initialized.")
703
- # Initialize the Anthropic models
704
- # Standard model for supervisor and validator
705
  self.langfuse_handler = CallbackHandler()
706
 
707
- self.supervisor_model = ChatAnthropic(
708
- model="claude-3-7-sonnet-20250219",
709
- max_tokens=20000,
710
- anthropic_api_key=os.getenv("ANTHROPIC_API_KEY"),
711
- temperature=0.6,
712
- # thinking={
713
- # "type": "enabled",
714
- # "budget_tokens": 5000
715
- # }
716
  )
717
 
718
- # Standard model for validator
719
- self.validator_model = ChatAnthropic(
720
- model="claude-3-7-sonnet-20250219",
721
- max_tokens=20000,
722
- temperature=0.5, # Lower temperature for more consistent validation
723
- anthropic_api_key=os.getenv("ANTHROPIC_API_KEY")
724
  )
725
 
726
- # Tool-enabled model for worker
727
- self.worker_model_base = ChatAnthropic(
728
- model="claude-3-7-sonnet-20250219",
729
- max_tokens=20000,
730
  temperature=0.75,
731
- anthropic_api_key=os.getenv("ANTHROPIC_API_KEY")
732
  )
733
 
734
- # Initialize tools
735
- self.tools = [search_web_tavily, search_web_serper, execute_code_securely, execute_shell_command, sandbox_file_operation, extract_document_data, extract_image_data, extract_url_content, get_youtube_transcript]
736
-
737
- # Bind tools only to the worker model
738
  self.worker_model = self.worker_model_base.bind_tools(self.tools)
739
 
740
  # Create the tool node for executing tools
 
697
  except:
698
  pass
699
 
700
+ from litellm import LiteLLMModel
701
+ import os
702
+
703
  class BasicAgent:
704
  def __init__(self):
705
  print("BasicAgent initialized.")
706
+ # Initialize callback handler
 
707
  self.langfuse_handler = CallbackHandler()
708
 
709
+ # Supervisor model using Gemini
710
+ self.supervisor_model = LiteLLMModel(
711
+ model_id="gemini/gemini-2.0-flash-lite",
712
+ api_key=os.getenv("GEMINI_API_KEY"),
713
+ temperature=0.5,
714
+ max_tokens=1024,
 
 
 
715
  )
716
 
717
+ # Validator model using Gemini
718
+ self.validator_model = LiteLLMModel(
719
+ model_id="gemini/gemini-2.0-flash-lite",
720
+ api_key=os.getenv("GEMINI_API_KEY"),
721
+ temperature=0.5,
722
+ max_tokens=1024,
723
  )
724
 
725
+ # Worker base model using Gemini
726
+ self.worker_model_base = LiteLLMModel(
727
+ model_id="gemini/gemini-2.0-flash-lite",
728
+ api_key=os.getenv("GEMINI_API_KEY"),
729
  temperature=0.75,
730
+ max_tokens=20000,
731
  )
732
 
733
+ # Bind tools to the worker model
734
+ self.tools = [search_web_tavily, search_web_serper, execute_code_securely,
735
+ execute_shell_command, sandbox_file_operation, extract_document_data,
736
+ extract_image_data, extract_url_content, get_youtube_transcript]
737
  self.worker_model = self.worker_model_base.bind_tools(self.tools)
738
 
739
  # Create the tool node for executing tools