Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
fix: remove harm category setting from vertex ai (#8721)
Shota Totsuka1c7877b048d2
diff --git a/api/core/model_runtime/model_providers/vertex_ai/llm/llm.py b/api/core/model_runtime/model_providers/vertex_ai/llm/llm.pyindex da69b7cdf38..1dd785d5454 100644--- a/api/core/model_runtime/model_providers/vertex_ai/llm/llm.py+++ b/api/core/model_runtime/model_providers/vertex_ai/llm/llm.py@@ -2,6 +2,7 @@ import base64import ioimport jsonimport logging+import timefrom collections.abc import Generatorfrom typing import Optional, Union, cast@@ -20,7 +21,6 @@ from google.api_core import exceptionsfrom google.cloud import aiplatformfrom google.oauth2 import service_accountfrom PIL import Image-from vertexai.generative_models import HarmBlockThreshold, HarmCategoryfrom core.model_runtime.entities.llm_entities import LLMResult, LLMResultChunk, LLMResultChunkDelta, LLMUsagefrom core.model_runtime.entities.message_entities import (@@ -34,6 +34,7 @@ from core.model_runtime.entities.message_entities import (ToolPromptMessage,UserPromptMessage,)+from core.model_runtime.entities.model_entities import PriceTypefrom core.model_runtime.errors.invoke import (InvokeAuthorizationError,InvokeBadRequestError,@@ -503,20 +504,12 @@ class VertexAiLargeLanguageModel(LargeLanguageModel):else:history.append(content)- safety_settings = {- HarmCategory.HARM_CATEGORY_HARASSMENT: HarmBlockThreshold.BLOCK_NONE,- HarmCategory.HARM_CATEGORY_HATE_SPEECH: HarmBlockThreshold.BLOCK_NONE,- HarmCategory.HARM_CATEGORY_SEXUALLY_EXPLICIT: HarmBlockThreshold.BLOCK_NONE,- HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT: HarmBlockThreshold.BLOCK_NONE,- }-google_model = glm.GenerativeModel(model_name=model, system_instruction=system_instruction)response = google_model.generate_content(contents=history,generation_config=glm.GenerationConfig(**config_kwargs),stream=stream,- safety_settings=safety_settings,tools=self._convert_tools_to_glm_tool(tools) if tools else None,)