From ca515bc728db446a6698a1fc11ffe1d867a0495d Mon Sep 17 00:00:00 2001 From: Serhii Denshchyk Date: Fri, 1 Aug 2025 09:29:50 +0200 Subject: [PATCH] Fix DI example in README.md --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4fb5f6a74..057b7a666 100644 --- a/README.md +++ b/README.md @@ -151,8 +151,9 @@ Register the `ChatClient` as a singleton in your `Program.cs`: builder.Services.AddSingleton(serviceProvider => { var apiKey = Environment.GetEnvironmentVariable("OPENAI_API_KEY"); + var model = "gpt-4o"; - return new ChatClient(apiKey); + return new ChatClient(model, apiKey); }); ``` @@ -1095,4 +1096,4 @@ By default, the client classes will automatically retry the following errors up ### Observability -OpenAI .NET library supports experimental distributed tracing and metrics with OpenTelemetry. Check out [Observability with OpenTelemetry](./docs/observability.md) for more details. \ No newline at end of file +OpenAI .NET library supports experimental distributed tracing and metrics with OpenTelemetry. Check out [Observability with OpenTelemetry](./docs/observability.md) for more details.