diff --git a/docs/docs/reference/python-sdk/weave/trace_server/weave.trace_server.trace_server_interface.md b/docs/docs/reference/python-sdk/weave/trace_server/weave.trace_server.trace_server_interface.md index 28cc024f15f..87efbca2693 100644 --- a/docs/docs/reference/python-sdk/weave/trace_server/weave.trace_server.trace_server_interface.md +++ b/docs/docs/reference/python-sdk/weave/trace_server/weave.trace_server.trace_server_interface.md @@ -115,8 +115,6 @@ sidebar_label: trace_server_interface -**Pydantic Fields:** - --- @@ -264,8 +262,6 @@ serialize_typed_dicts(v: Dict[str, Any]) → Dict[str, Any] -**Pydantic Fields:** - --- @@ -309,8 +305,6 @@ serialize_typed_dicts(v: Dict[str, Any]) → Dict[str, Any] -**Pydantic Fields:** - --- @@ -552,8 +546,6 @@ serialize_typed_dicts(v: Dict[str, Any]) → Dict[str, Any] -**Pydantic Fields:** - --- diff --git a/docs/scripts/generate_python_sdk_docs.py b/docs/scripts/generate_python_sdk_docs.py index d58cf1bf351..cf94e91977b 100644 --- a/docs/scripts/generate_python_sdk_docs.py +++ b/docs/scripts/generate_python_sdk_docs.py @@ -156,19 +156,19 @@ def fix_pydantic_model(text, obj, module_name): end_idx = text.find("""---""", start_idx) field_summary = "**Pydantic Fields:**\n\n" - for k, v in obj.model_fields.items(): - name = k - if hasattr(v, "alias") and v.alias != None: - name = v.alias - annotation = "Any" - if hasattr(v, "annotation") and v.annotation != None: - annotation = str(v.annotation) - annotation = annotation.replace(module_name + ".", "") - - field_summary += f"- `{name}`: `{annotation}`\n" - - replace_with = field_summary - text = text[:end_idx] + replace_with + text[end_idx:] + if obj.model_fields: + for k, v in obj.model_fields.items(): + name = k + if hasattr(v, "alias") and v.alias != None: + name = v.alias + annotation = "Any" + if hasattr(v, "annotation") and v.annotation != None: + annotation = str(v.annotation) + annotation = annotation.replace(module_name + ".", "") + + field_summary += f"- `{name}`: `{annotation}`\n" + + text = text[:end_idx] + field_summary + text[end_idx:] if text.endswith("---"): text = text[:-3]