Skip to content

Error during PostHog shutdown: cannot schedule new futures after interpreter shutdown #1011

@MervinPraison

Description

@MervinPraison
❯ python basic-agents.py
18:56:36 - LiteLLM:DEBUG: http_handler.py:579 - Using AiohttpTransport...
[18:56:36] DEBUG    [18:56:36] http_handler.py:579 DEBUG Using AiohttpTransport...       http_handler.py:579
18:56:36 - LiteLLM:DEBUG: http_handler.py:636 - Creating AiohttpTransport...
           DEBUG    [18:56:36] http_handler.py:636 DEBUG Creating AiohttpTransport...    http_handler.py:636
18:56:37 - LiteLLM:DEBUG: litellm_logging.py:182 - [Non-Blocking] Unable to import GenericAPILogger - LiteLLM Enterprise Feature - No module named 'litellm_enterprise'
[18:56:37] DEBUG    [18:56:37] litellm_logging.py:182 DEBUG [Non-Blocking] Unable to  litellm_logging.py:182
                    import GenericAPILogger - LiteLLM Enterprise Feature - No module                        
                    named 'litellm_enterprise'                                                              
18:56:37 - LiteLLM:DEBUG: transformation.py:17 - [Non-Blocking] Unable to import _ENTERPRISE_ResponsesSessionHandler - LiteLLM Enterprise Feature - No module named 'litellm_enterprise'
           DEBUG    [18:56:37] transformation.py:17 DEBUG [Non-Blocking] Unable to      transformation.py:17
                    import _ENTERPRISE_ResponsesSessionHandler - LiteLLM Enterprise                         
                    Feature - No module named 'litellm_enterprise'                                          
18:56:37 - LiteLLM:DEBUG: http_handler.py:579 - Using AiohttpTransport...
           DEBUG    [18:56:37] http_handler.py:579 DEBUG Using AiohttpTransport...       http_handler.py:579
18:56:37 - LiteLLM:DEBUG: http_handler.py:636 - Creating AiohttpTransport...
           DEBUG    [18:56:37] http_handler.py:636 DEBUG Creating AiohttpTransport...    http_handler.py:636
18:56:37 - LiteLLM:DEBUG: http_handler.py:579 - Using AiohttpTransport...
           DEBUG    [18:56:37] http_handler.py:579 DEBUG Using AiohttpTransport...       http_handler.py:579
18:56:37 - LiteLLM:DEBUG: http_handler.py:636 - Creating AiohttpTransport...
           DEBUG    [18:56:37] http_handler.py:636 DEBUG Creating AiohttpTransport...    http_handler.py:636
18:56:37 - LiteLLM:DEBUG: http_handler.py:579 - Using AiohttpTransport...
           DEBUG    [18:56:37] http_handler.py:579 DEBUG Using AiohttpTransport...       http_handler.py:579
18:56:37 - LiteLLM:DEBUG: http_handler.py:636 - Creating AiohttpTransport...
           DEBUG    [18:56:37] http_handler.py:636 DEBUG Creating AiohttpTransport...    http_handler.py:636
[18:56:38] DEBUG    [18:56:38] telemetry.py:88 DEBUG Telemetry enabled with session          telemetry.py:88
                    757e2bb29bb48c09                                                                        
           DEBUG    [18:56:38] agent.py:1208 DEBUG Agent.chat parameters: {                    agent.py:1208
                      "prompt": "Why sky is Blue?",                                                         
                      "temperature": 0.2,                                                                   
                      "tools": null,                                                                        
                      "output_json": null,                                                                  
                      "output_pydantic": null,                                                              
                      "reasoning_steps": false,                                                             
                      "agent_name": "Agent",                                                                
                      "agent_role": "Assistant",                                                            
                      "agent_goal": "You are a helpful assistant"                                           
                    }                                                                                       
╭─ Agent Info ─────────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                                                          │
│  👤 Agent: Agent                                                                                         │
│  Role: Assistant                                                                                         │
│                                                                                                          │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─────────────────── Instruction ────────────────────╮
│ Agent Agent is processing prompt: Why sky is Blue? │
╰────────────────────────────────────────────────────╯
           DEBUG    [18:56:38] agent.py:1079 DEBUG Agent sending messages to LLM: [{'role':    agent.py:1079
                    'system', 'content': 'You are a helpful assistant\n\nYour Role:                         
                    Assistant\n\nYour Goal: You are a helpful assistant'}, {'role': 'user',                 
                    'content': 'Why sky is Blue?'}]                                                         
[18:56:39] DEBUG    [18:56:39] main.py:253 DEBUG Empty content in display_generating, returning  main.py:253
                    early                                                                                   

[18:56:43] DEBUG    [18:56:43] agent.py:1408 DEBUG Agent Agent final response: The sky appears agent.py:1408
                    blue primarily due to a phenomenon called Rayleigh scattering. Here's how               
                    it works:                                                                               
                                                                                                            
                    1. **Sunlight Composition**: Sunlight, or white light, is made up of                    
                    different colors, each with different wavelengths. Blue light has a                     
                    shorter wavelength, while red light has a longer wavelength.                            
                                                                                                            
                    2. **Atmospheric Scattering**: When sunlight enters the Earth's                         
                    atmosphere, it collides with molecules and small particles in the air.                  
                    Because blue light has a shorter wavelength, it is scattered in all                     
                    directions more than the other colors with longer wavelengths (like red                 
                    and yellow).                                                                            
                                                                                                            
                    3. **Perception of Color**: When we look up at the sky, we see this                     
                    scattered blue light coming from all directions. This is why the sky                    
                    appears predominantly blue during the day.                                              
                                                                                                            
                    4. **Variations**: The color of the sky can change under different                      
                    conditions. For example, during sunrise or sunset, the sun's light has to               
                    pass through more of the Earth's atmosphere, scattering the shorter blue                
                    wavelengths and allowing the longer red and orange wavelengths to                       
                    dominate, resulting in beautiful colors at those times.                                 
                                                                                                            
                    In summary, the blue color of the sky is due to the scattering of sunlight              
                    by the atmosphere, with blue light being scattered more than other colors.              
Response generated in 5.4s
╭────────────────────────────────────────────────── Task ──────────────────────────────────────────────────╮
│ Why sky is Blue?                                                                                         │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭──────────────────────────────────────────────── Response ────────────────────────────────────────────────╮
│ The sky appears blue primarily due to a phenomenon called Rayleigh scattering. Here's how it works:      │
│                                                                                                          │
│  1 Sunlight Composition: Sunlight, or white light, is made up of different colors, each with different   │
│    wavelengths. Blue light has a shorter wavelength, while red light has a longer wavelength.            │
│  2 Atmospheric Scattering: When sunlight enters the Earth's atmosphere, it collides with molecules and   │
│    small particles in the air. Because blue light has a shorter wavelength, it is scattered in all       │
│    directions more than the other colors with longer wavelengths (like red and yellow).                  │
│  3 Perception of Color: When we look up at the sky, we see this scattered blue light coming from all     │
│    directions. This is why the sky appears predominantly blue during the day.                            │
│  4 Variations: The color of the sky can change under different conditions. For example, during sunrise   │
│    or sunset, the sun's light has to pass through more of the Earth's atmosphere, scattering the shorter │
│    blue wavelengths and allowing the longer red and orange wavelengths to dominate, resulting in         │
│    beautiful colors at those times.                                                                      │
│                                                                                                          │
│ In summary, the blue color of the sky is due to the scattering of sunlight by the atmosphere, with blue  │
│ light being scattered more than other colors.                                                            │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────╯
           DEBUG    [18:56:43] telemetry.py:138 DEBUG Agent execution tracked: success=True telemetry.py:138
           DEBUG    [18:56:43] telemetry.py:138 DEBUG Agent execution tracked: success=True telemetry.py:138
[18:56:44] DEBUG    [18:56:44] telemetry.py:303 DEBUG Telemetry flush: {'enabled': True,    telemetry.py:303
                    'session_id': '757e2bb29bb48c09', 'metrics': {'agent_executions': 2,                    
                    'task_completions': 0, 'tool_calls': 0, 'errors': 0}, 'environment':                    
                    {'python_version': '3.11.11', 'os_type': 'Darwin', 'framework_version':                 
                    'unknown'}}                                                                             
           ERROR    [18:56:44] telemetry.py:376 ERROR Error during PostHog shutdown: cannot telemetry.py:376
                    schedule new futures after interpreter shutdown                                         
           DEBUG    [18:56:44] selector_events.py:54 DEBUG Using selector:             selector_events.py:54
                    KqueueSelector                                                                          
❯ 

from praisonaiagents import Agent

agent = Agent(
    instructions="You are a helpful assistant",
    llm="gpt-4o-mini"
)
agent.start("Why sky is Blue?")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions