# ChatGptFactoryServiceCollectionExtensions.AddChatGptClientFactory method

Registers a ChatGptClientFactory instance.

```csharp
public static IServiceCollection AddChatGptClientFactory(this IServiceCollection services, 
    Action<ChatGptOptionsBuilder>? builder = null)
```

| parameter | description |
| --- | --- |
| services | The IServiceCollection to add services to. |
| builder | The Action to configure the provided [`ChatGptOptions`](../ChatGptOptions.md). |

## Return Value

A reference to this instance after the operation has completed.

## See Also

* class [ChatGptOptionsBuilder](../ChatGptOptionsBuilder.md)
* class [ChatGptFactoryServiceCollectionExtensions](../ChatGptFactoryServiceCollectionExtensions.md)
* namespace [ChatGptNet](../../ChatGptNet.md)

<!-- DO NOT EDIT: generated by xmldocmd for ChatGptNet.dll -->
