Skip to content

[FEATURE] Support non-stream in OpenAIModel #243

Open
@howardzhou

Description

@howardzhou

Problem Statement

Currently OpenAIModel only supports stream=True
Some model does not support that.
So I'd like to have an option with stream=False in OpenAIModel.

Proposed Solution

Similar implementation for Bedrock API with stream=False
3100ea0

Use Case

model = OpenAIModel(
    # can also pass dict as first argument
    client_args={"api_key": "abc123", "base_url": "http://localhost:8009/v1"},
    stream=False,
    # everything from this point is a kwarg though
    model_id="xxx",
)

agent = Agent(model=model, tools=[calculator])
agent("What is 2+2?")

Alternatives Solutions

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions