Spaces:
				
			
			
	
			
			
		Sleeping
		
	
	
	
			
			
	
	
	
	
		
		
		Sleeping
		
	bug fix
Browse files
    	
        agents.py
    CHANGED
    
    | @@ -202,9 +202,9 @@ class GeminiAgent(LLMAgentBase): | |
| 202 | 
             
                    kwargs['start_timer_on_battle_start'] = True
         | 
| 203 | 
             
                    super().__init__(*args, **kwargs)
         | 
| 204 | 
             
                    self.model_name = model
         | 
| 205 | 
            -
                    used_api_key = api_key or os.environ.get(" | 
| 206 | 
             
                    if not used_api_key:
         | 
| 207 | 
            -
                        raise ValueError("Google API key not provided or found in  | 
| 208 |  | 
| 209 | 
             
                    # Initialize Gemini client using the correct API
         | 
| 210 | 
             
                    self.genai_client = genai.Client(api_key=used_api_key)
         | 
|  | |
| 202 | 
             
                    kwargs['start_timer_on_battle_start'] = True
         | 
| 203 | 
             
                    super().__init__(*args, **kwargs)
         | 
| 204 | 
             
                    self.model_name = model
         | 
| 205 | 
            +
                    used_api_key = api_key or os.environ.get("GEMINI_API_KEY")
         | 
| 206 | 
             
                    if not used_api_key:
         | 
| 207 | 
            +
                        raise ValueError("Google API key not provided or found in GEMINI_API_KEY env var.")
         | 
| 208 |  | 
| 209 | 
             
                    # Initialize Gemini client using the correct API
         | 
| 210 | 
             
                    self.genai_client = genai.Client(api_key=used_api_key)
         |