Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OAI Prototype: Remove ClientPipelineExtensions #213

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

annelo-msft
Copy link
Collaborator

No description provided.

@@ -44,7 +45,6 @@ internal PipelineMessage CreateCreateChatCompletionRequest(BinaryContent content
request.Headers.Set("Accept", "application/json");
request.Headers.Set("Content-Type", "application/json");
request.Content = content;
message.Apply(options);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This moves into ClientPipeline.ProcessMessage

@@ -35,6 +35,7 @@ internal PipelineMessage CreateCreateChatCompletionRequest(BinaryContent content
{
var message = _pipeline.CreateMessage();
message.ResponseClassifier = PipelineMessageClassifier200;
message.ExceptionFactory = _exceptionFactory;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Custom exception factory is set on the message.

@@ -65,6 +66,7 @@ protected internal ChatClient(ClientPipeline pipeline, string model, Uri endpoin
_pipeline = pipeline;
_endpoint = endpoint;
_telemetry = new OpenTelemetrySource(model, endpoint);
_exceptionFactory = new OpenAIExceptionFactory();
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Customization layer sets this in the client constructor, or generated code sets it to ClientResultExceptionFactory.Default.

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.

1 participant