You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// Asks the <see cref="IChatClient"/> for an object of type <typeparamref name="TService"/>
59
+
/// and throws an exception if one isn't available.
60
+
/// </summary>
61
+
/// <typeparam name="TService">The type of the object to be retrieved.</typeparam>
62
+
/// <param name="client">The client.</param>
63
+
/// <param name="serviceKey">An optional key that can be used to help identify the target service.</param>
64
+
/// <returns>The found object.</returns>
65
+
/// <exception cref="ArgumentNullException"><paramref name="client"/> is <see langword="null"/>.</exception>
66
+
/// <exception cref="InvalidOperationException">No service of the requested type for the specified key is available.</exception>
67
+
/// <remarks>
68
+
/// The purpose of this method is to allow for the retrieval of strongly typed services that are required to be provided by the <see cref="IChatClient"/>,
69
+
/// including itself or any services it might be wrapping.
/// <summary>Sends a user chat text message and returns the response messages.</summary>
@@ -33,6 +86,8 @@ public static class ChatClientExtensions
33
86
/// <param name="options">The chat options to configure the request.</param>
34
87
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to monitor for cancellation requests. The default is <see cref="CancellationToken.None"/>.</param>
35
88
/// <returns>The response messages generated by the client.</returns>
89
+
/// <exception cref="ArgumentNullException"><paramref name="client"/> is <see langword="null"/>.</exception>
90
+
/// <exception cref="ArgumentNullException"><paramref name="chatMessage"/> is <see langword="null"/>.</exception>
36
91
publicstaticTask<ChatResponse>GetResponseAsync(
37
92
thisIChatClientclient,
38
93
stringchatMessage,
@@ -51,6 +106,8 @@ public static Task<ChatResponse> GetResponseAsync(
51
106
/// <param name="options">The chat options to configure the request.</param>
52
107
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to monitor for cancellation requests. The default is <see cref="CancellationToken.None"/>.</param>
53
108
/// <returns>The response messages generated by the client.</returns>
109
+
/// <exception cref="ArgumentNullException"><paramref name="client"/> is <see langword="null"/>.</exception>
110
+
/// <exception cref="ArgumentNullException"><paramref name="chatMessage"/> is <see langword="null"/>.</exception>
54
111
publicstaticTask<ChatResponse>GetResponseAsync(
55
112
thisIChatClientclient,
56
113
ChatMessagechatMessage,
@@ -69,6 +126,8 @@ public static Task<ChatResponse> GetResponseAsync(
69
126
/// <param name="options">The chat options to configure the request.</param>
70
127
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to monitor for cancellation requests. The default is <see cref="CancellationToken.None"/>.</param>
71
128
/// <returns>The response messages generated by the client.</returns>
129
+
/// <exception cref="ArgumentNullException"><paramref name="client"/> is <see langword="null"/>.</exception>
130
+
/// <exception cref="ArgumentNullException"><paramref name="chatMessage"/> is <see langword="null"/>.</exception>
@@ -87,6 +146,8 @@ public static IAsyncEnumerable<ChatResponseUpdate> GetStreamingResponseAsync(
87
146
/// <param name="options">The chat options to configure the request.</param>
88
147
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to monitor for cancellation requests. The default is <see cref="CancellationToken.None"/>.</param>
89
148
/// <returns>The response messages generated by the client.</returns>
149
+
/// <exception cref="ArgumentNullException"><paramref name="client"/> is <see langword="null"/>.</exception>
150
+
/// <exception cref="ArgumentNullException"><paramref name="chatMessage"/> is <see langword="null"/>.</exception>
/// <summary>Generates an embedding vector from the specified <paramref name="value"/>.</summary>
56
136
/// <typeparam name="TInput">The type from which embeddings will be generated.</typeparam>
57
137
/// <typeparam name="TEmbeddingElement">The numeric type of the embedding data.</typeparam>
@@ -60,6 +140,9 @@ public static class EmbeddingGeneratorExtensions
60
140
/// <param name="options">The embedding generation options to configure the request.</param>
61
141
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to monitor for cancellation requests. The default is <see cref="CancellationToken.None"/>.</param>
62
142
/// <returns>The generated embedding for the specified <paramref name="value"/>.</returns>
143
+
/// <exception cref="ArgumentNullException"><paramref name="generator"/> is <see langword="null"/>.</exception>
144
+
/// <exception cref="ArgumentNullException"><paramref name="value"/> is <see langword="null"/>.</exception>
145
+
/// <exception cref="InvalidOperationException">The generator did not produce exactly one embedding.</exception>
63
146
/// <remarks>
64
147
/// This operation is equivalent to using <see cref="GenerateEmbeddingAsync"/> and returning the
@@ -84,6 +167,9 @@ public static async Task<ReadOnlyMemory<TEmbeddingElement>> GenerateEmbeddingVec
84
167
/// <returns>
85
168
/// The generated embedding for the specified <paramref name="value"/>.
86
169
/// </returns>
170
+
/// <exception cref="ArgumentNullException"><paramref name="generator"/> is <see langword="null"/>.</exception>
171
+
/// <exception cref="ArgumentNullException"><paramref name="value"/> is <see langword="null"/>.</exception>
172
+
/// <exception cref="InvalidOperationException">The generator did not produce exactly one embedding.</exception>
87
173
/// <remarks>
88
174
/// This operations is equivalent to using <see cref="IEmbeddingGenerator{TInput, TEmbedding}.GenerateAsync"/> with a
89
175
/// collection composed of the single <paramref name="value"/> and then returning the first embedding element from the
@@ -125,6 +211,9 @@ public static async Task<TEmbedding> GenerateEmbeddingAsync<TInput, TEmbedding>(
125
211
/// <param name="options">The embedding generation options to configure the request.</param>
126
212
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to monitor for cancellation requests. The default is <see cref="CancellationToken.None"/>.</param>
127
213
/// <returns>An array containing tuples of the input values and the associated generated embeddings.</returns>
214
+
/// <exception cref="ArgumentNullException"><paramref name="generator"/> is <see langword="null"/>.</exception>
215
+
/// <exception cref="ArgumentNullException"><paramref name="values"/> is <see langword="null"/>.</exception>
216
+
/// <exception cref="InvalidOperationException">The generator did not produce one embedding for each input value.</exception>
0 commit comments