Skip to content

Incompatible with async assistant initialization, AssistantInstance requires synchronous creation #12

@ayomaska18

Description

@ayomaska18

When using grafi-dev with assistants that require async initialization e.g. MCP server connections, the cli fails as the module immediately looks for the assistant variable, if set assistant = None globally, it wouldn't work as None type does not have the to_dict() method, and showing:

AttributeError: 'NoneType' object has no attribute 'to_dict'

The solution I could find is to create a simple dummy assistant first, which allows it to use the to_dict() method, and then override the dummy assistant with your actual assistant inside the async function

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