Skip to content

Commit 0042302

Browse files
Added .Model properties to clients (#564)
* added .Model properties to clients that store it currently as a private filed * for now removing model property from responses
1 parent 5b5f6f6 commit 0042302

File tree

5 files changed

+25
-0
lines changed

5 files changed

+25
-0
lines changed

src/Custom/Audio/AudioClient.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ protected internal AudioClient(ClientPipeline pipeline, string model, OpenAIClie
8888
_endpoint = OpenAIClient.GetEndpoint(options);
8989
}
9090

91+
/// <summary>
92+
/// Gets the name of the model used in requests sent to the service.
93+
/// </summary>
94+
public string Model => _model;
95+
9196
#region GenerateSpeech
9297

9398
/// <summary> Generates a life-like, spoken audio recording of the input text. </summary>

src/Custom/Chat/ChatClient.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,11 @@ protected internal ChatClient(ClientPipeline pipeline, string model, OpenAIClien
102102
_telemetry = new OpenTelemetrySource(model, _endpoint);
103103
}
104104

105+
/// <summary>
106+
/// Gets the name of the model used in requests sent to the service.
107+
/// </summary>
108+
public string Model => _model;
109+
105110
/// <summary> Generates a completion for the given chat. </summary>
106111
/// <param name="messages"> The messages comprising the chat so far. </param>
107112
/// <param name="options"> The options to configure the chat completion. </param>

src/Custom/Embeddings/EmbeddingClient.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@ protected internal EmbeddingClient(ClientPipeline pipeline, string model, OpenAI
8989
_endpoint = OpenAIClient.GetEndpoint(options);
9090
}
9191

92+
/// <summary>
93+
/// Gets the name of the model used in requests sent to the service.
94+
/// </summary>
95+
public string Model => _model;
96+
9297
// CUSTOM: Added to simplify generating a single embedding from a string input.
9398
/// <summary> Generates an embedding representing the text input. </summary>
9499
/// <param name="input"> The text input to generate an embedding for. </param>

src/Custom/Images/ImageClient.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,11 @@ protected internal ImageClient(ClientPipeline pipeline, string model, OpenAIClie
8686
Pipeline = pipeline;
8787
_endpoint = OpenAIClient.GetEndpoint(options);
8888
}
89+
90+
/// <summary>
91+
/// Gets the name of the model used in requests sent to the service.
92+
/// </summary>
93+
public string Model => _model;
8994

9095
#region GenerateImages
9196

src/Custom/Moderations/ModerationClient.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@ protected internal ModerationClient(ClientPipeline pipeline, string model, OpenA
8989
_endpoint = OpenAIClient.GetEndpoint(options);
9090
}
9191

92+
/// <summary>
93+
/// Gets the name of the model used in requests sent to the service.
94+
/// </summary>
95+
public string Model => _model;
96+
9297
/// <summary> Classifies if the text input is potentially harmful across several categories. </summary>
9398
/// <param name="input"> The text input to classify. </param>
9499
/// <param name="cancellationToken"> A token that can be used to cancel this method call. </param>

0 commit comments

Comments
 (0)