mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-11 14:29:05 +00:00
Generated the JSON contracts of providers, the runtime, and services at compile time (#1150)
This commit is contained in:
1 parent
e954881fda
commit
24e3c22db3
140 files changed
+1415
-292
No files matched your search
@@ -0,0 +1,22 @@
|
||||
namespace AIStudio.Provider.Google;
|
||||
|
||||
/// <summary>
|
||||
/// A request for an embedding to the Gemini API.
|
||||
/// </summary>
|
||||
/// <param name="Content">The texts to embed.</param>
|
||||
public sealed record GoogleEmbeddingRequest(GoogleEmbeddingContent Content)
|
||||
{
|
||||
/// <summary>
|
||||
/// Asks for vectors which tell how similar texts are.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Written as task_type, like every other field of our requests. The API reads both its field names in
|
||||
/// snake case and in camel case.
|
||||
/// </remarks>
|
||||
public string TaskType => "SEMANTIC_SIMILARITY";
|
||||
|
||||
/// <summary>
|
||||
/// Creates the request for the given texts, each of them as a part of its own.
|
||||
/// </summary>
|
||||
public static GoogleEmbeddingRequest Of(IEnumerable<string> texts) => new(new GoogleEmbeddingContent([..texts.Select(text => new GoogleEmbeddingPart(text))]));
|
||||
}
|
||||
Reference in new issue
Block a user