Skip to content

Support most AI providers #84

@gvanrossum-ms

Description

@gvanrossum-ms

We should completely redesign the way models (both embedding and LLM) are accessed. Most likely we can use Pydantic.AI for this. (We could use it instead of TypeChat too, but when I tried that, results were worse than TypeChat, and I didn't have the time to delve deeper into the reasons.)

  • The AsyncEmbeddingModel class should wrap a Pydantic.AI embedding API (assuming one exists) instead of going straight to the openai package.
  • The TypeChatModel (sp?) class should wrap a Pydantic.AI model class.
  • Environment variables should be redesigned to support setting the provider and model name; but you should also be allowed to create your own Pydantic.AI-based implementations of those classes.
  • The current set of environment variables (esp. for AZURE_OPENAI) should still be supported.

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