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
Refactor: Enable type checking for core/ops and fix type errors (#26414)
Asuka Minatoe1691fddaaa2
diff --git a/api/core/ops/aliyun_trace/entities/aliyun_trace_entity.py b/api/core/ops/aliyun_trace/entities/aliyun_trace_entity.pyindex 0ee71fc23fd..20ff2d08755 100644--- a/api/core/ops/aliyun_trace/entities/aliyun_trace_entity.py+++ b/api/core/ops/aliyun_trace/entities/aliyun_trace_entity.py@@ -3,7 +3,8 @@ from dataclasses import dataclassfrom typing import Anyfrom opentelemetry import trace as trace_api-from opentelemetry.sdk.trace import Event, Status, StatusCode+from opentelemetry.sdk.trace import Event+from opentelemetry.trace import Status, StatusCodefrom pydantic import BaseModel, Fielddiff --git a/api/core/ops/ops_trace_manager.py b/api/core/ops/ops_trace_manager.pyindex 0679b27271d..e181373bd04 100644--- a/api/core/ops/ops_trace_manager.py+++ b/api/core/ops/ops_trace_manager.py@@ -155,7 +155,10 @@ class OpsTraceManager:if key in tracing_config:if "*" in tracing_config[key]:# If the key contains '*', retain the original value from the current config- new_config[key] = current_trace_config.get(key, tracing_config[key])+ if current_trace_config:+ new_config[key] = current_trace_config.get(key, tracing_config[key])+ else:+ new_config[key] = tracing_config[key]else:# Otherwise, encrypt the keynew_config[key] = encrypt_token(tenant_id, tracing_config[key])diff --git a/api/core/ops/weave_trace/weave_trace.py b/api/core/ops/weave_trace/weave_trace.pyindex 339694cf07f..185bdd81798 100644--- a/api/core/ops/weave_trace/weave_trace.py+++ b/api/core/ops/weave_trace/weave_trace.py@@ -62,7 +62,8 @@ class WeaveDataTrace(BaseTraceInstance):self,):try:- project_url = f"https://wandb.ai/{self.weave_client._project_id()}"+ project_identifier = f"{self.entity}/{self.project_name}" if self.entity else self.project_name+ project_url = f"https://wandb.ai/{project_identifier}"return project_urlexcept Exception as e:logger.debug("Weave get run url failed: %s", str(e))@@ -424,7 +425,23 @@ class WeaveDataTrace(BaseTraceInstance):raise ValueError(f"Weave API check failed: {str(e)}")def start_call(self, run_data: WeaveTraceModel, parent_run_id: str | None = None):- call = self.weave_client.create_call(op=run_data.op, inputs=run_data.inputs, attributes=run_data.attributes)+ inputs = run_data.inputs+ if inputs is None:+ inputs = {}+ elif not isinstance(inputs, dict):+ inputs = {"inputs": str(inputs)}++ attributes = run_data.attributes+ if attributes is None:+ attributes = {}+ elif not isinstance(attributes, dict):+ attributes = {"attributes": str(attributes)}++ call = self.weave_client.create_call(+ op=run_data.op,+ inputs=inputs,+ attributes=attributes,+ )self.calls[run_data.id] = callif parent_run_id:self.calls[run_data.id].parent_id = parent_run_id@@ -432,6 +449,7 @@ class WeaveDataTrace(BaseTraceInstance):def finish_call(self, run_data: WeaveTraceModel):call = self.calls.get(run_data.id)if call:- self.weave_client.finish_call(call=call, output=run_data.outputs, exception=run_data.exception)+ exception = Exception(run_data.exception) if run_data.exception else None+ self.weave_client.finish_call(call=call, output=run_data.outputs, exception=exception)else:raise ValueError(f"Call with id {run_data.id} not found")diff --git a/api/pyrightconfig.json b/api/pyrightconfig.jsonindex 23db443a397..caa194c9062 100644--- a/api/pyrightconfig.json+++ b/api/pyrightconfig.json@@ -6,7 +6,6 @@"migrations/","core/rag","extensions",- "core/ops","core/workflow/nodes","core/app/app_config/easy_ui_based_app/dataset"],