publicSystem.Collections.Generic.IReadOnlyList<Microsoft.SemanticKernel.Connectors.Google.GeminiSafetyRating>? ResponseSafetyRatings {get; } Property Value IReadOnlyList<GeminiSafetyRating> Applies to ProduktVersions Semantic Kernel DotnetLatest I denne artikel ...
safety_ratings { category: HARM_CATEGORY_SEXUALLY_EXPLICIT probability: NEGLIGIBLE } safety_ratings { category: HARM_CATEGORY_HATE_SPEECH probability: NEGLIGIBLE } safety_ratings { category: HARM_CATEGORY_HARASSMENT probability: NEGLIGIBLE } safety_ratings { category: HARM_CATEGORY_DANGEROUS_CONTENT probabi...
{"finishReason":"SAFETY","index":0,"safetyRatings": [ {"category":"HARM_CATEGORY_SEXUALLY_EXPLICIT","probability":"HIGH"}, {"category":"HARM_CATEGORY_HATE_SPEECH","probability":"NEGLIGIBLE"}, {"category":"HARM_CATEGORY_HARASSMENT","probability":"NEGLIGIBLE"}, {"category":"HARM_CATEGORY_D...
"}],"role":"model"},"finishReason":"STOP","index":0,"safetyRatings":[{"category":"HARM_CATEGORY_SEXUALLY_EXPLICIT","probability":"NEGLIGIBLE"},{"category":"HARM_CATEGORY_HATE_SPEECH","probability":"NEGLIGIBLE"},{"category":"HARM_CATEGORY_HARASSMENT","probability":"NEGLIGIBLE"},{"category...
"safetyRatings": [] } ], "usageMetadata": {} } 请求地址中需要拼接你申请好的 API key,请求参数的格式中 text 需要传入提示词,mimeType 需要传入图片格式,data 需要传入 base64 图片数据。返回结构中的 text 字段即为大模型的输出。 接口处理
https://makersuite.google.com/app/apikey 二、在国外服务器上部署一个接口用于真正的请求 const sdAxiosOnAzure = async (req, res) => { let { config = { url: 'https://sinkin.ai/api/inference', method: 'post', data: {}, timeout: 30 * 60 * 1000, ...
],"role":"model"},"finishReason":"STOP","index":0,"safetyRatings": [ {"category":"HARM_CATEGORY_SEXUALLY_EXPLICIT","probability":"NEGLIGIBLE"}, {"category":"HARM_CATEGORY_HATE_SPEECH","probability":"NEGLIGIBLE"}, {"category":"HARM_CATEGORY_HARASSMENT","probability":"NEGLIGIBLE"}, ...
category candidates.safetyRatings.category string 確率 candidates.safetyRatings.probability string safetyRatings promptFeedback.safetyRatings array of object category promptFeedback.safetyRatings.category string 確率 promptFeedback.safetyRatings.probability string テ...
@@ -219,6 +253,7 @@ type GeminiChatSafetyRating struct { } type GeminiChatPromptFeedback struct { BlockReason string `json:"blockReason"` SafetyRatings []GeminiChatSafetyRating `json:"safetyRatings"` } @@ -338,3 +373,21 @@ type ModelDetails struct { Name string `json:"name"` Suppor...
in BaseGenerateContentResponse.text(self) 400 if not parts: 401 raise ValueError( 402 "The `response.text` quick accessor only works when the response contains a valid " 403 "`Part`, but none was returned. Check the `candidate.safety_ratings` to see if the " 404 "response was blocked....