Skip to content

[ModelFactory] Implemented Chat factory#215

Merged
kinelski merged 3 commits into
joseharriaga:mainfrom
kinelski:factory
Aug 28, 2024
Merged

[ModelFactory] Implemented Chat factory#215
kinelski merged 3 commits into
joseharriaga:mainfrom
kinelski:factory

Conversation

@kinelski
Copy link
Copy Markdown
Collaborator

@kinelski kinelski commented Aug 20, 2024

Adding the Model Factory for Chat models. This factory can be used to instantiate models for mocking.

At the moment there's no way to have the factories generated automatically since they are split across multiple namespaces.

I tried to keep them as close to generated code as possible. In case we manage to have the code generator generating them automatically for us, it would be ideal if we could keep changes to a minimum when migrating from manually written to generated code.

The following models have not been included to the factory since they are also used as input for the client and can already be instantiated by costumers:

  • ChatMessage
  • ChatMessageContentPart
  • ChatFunctionCall
  • ChatToolCall

@kinelski kinelski self-assigned this Aug 20, 2024
Comment thread .dotnet/src/Custom/Chat/OpenAIChatModelFactory.cs
@kinelski kinelski marked this pull request as ready for review August 20, 2024 17:39
@kinelski kinelski requested a review from joseharriaga August 20, 2024 17:39
Comment thread .dotnet/src/Custom/Chat/OpenAIChatModelFactory.cs
Comment thread .dotnet/api/OpenAI.netstandard2.0.cs
@kinelski kinelski merged commit a6384fc into joseharriaga:main Aug 28, 2024
@kinelski kinelski deleted the factory branch August 28, 2024 23:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants