mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-05 02:07:21 +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
@@ -92,16 +92,7 @@ public class ProviderGoogle() : BaseProvider(LLMProviders.GOOGLE, new Uri("https
|
||||
}
|
||||
|
||||
// Prepare the Google Gemini embedding request:
|
||||
var payload = new
|
||||
{
|
||||
content = new
|
||||
{
|
||||
parts = texts.Select(text => new { text }).ToArray()
|
||||
},
|
||||
|
||||
taskType = "SEMANTIC_SIMILARITY"
|
||||
};
|
||||
|
||||
var payload = GoogleEmbeddingRequest.Of(texts);
|
||||
var embeddingRequest = JsonSerializer.Serialize(payload, JSON_SERIALIZER_OPTIONS);
|
||||
var embedUrl = $"https://generativelanguage.googleapis.com/v1beta/models/{modelName}:embedContent";
|
||||
using var request = new HttpRequestMessage(HttpMethod.Post, embedUrl);
|
||||
|
||||
Reference in new issue
Block a user