Skip to content

Driver Api Key Validation #1455

@griptapeOsipa

Description

@griptapeOsipa

Describe the issue
Missing API keys show up in logs/errors as timeouts/retries that require an interruption to proceed.

Describe the solution you'd like
Could we surface a "missing api key" error that halts the script execution?

Additional context

from griptape.structures import Agent
agent = Agent()
agent.run('What are the colors of the rainbow?')

Results in:

[12/17/24 09:47:05] INFO     PromptTask 688ec1b7830f4d6ebf2df8310b5c41e6                                                         
                             Input: What are the colors of the rainbow?                                                          
WARNING:root:<RetryCallState 4383057408: attempt #1; slept for 0.0; last result: failed (OpenAIError The api_key client option must be set either by passing api_key to the client or by setting the OPENAI_API_KEY environment variable)>
WARNING:root:<RetryCallState 4383057408: attempt #2; slept for 2.0; last result: failed (OpenAIError The api_key client option must be set either by passing api_key to the client or by setting the OPENAI_API_KEY environment variable)>
WARNING:root:<RetryCallState 4383057408: attempt #3; slept for 4.0; last result: failed (OpenAIError The api_key client option must be set either by passing api_key to the client or by setting the OPENAI_API_KEY environment variable)>

...<interrupted>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions