Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
tssweeney committed Aug 9, 2024
1 parent 132509c commit 9640ecd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,6 @@ sidebar_label: trace_server_interface



**Pydantic Fields:**


---

Expand Down Expand Up @@ -264,8 +262,6 @@ serialize_typed_dicts(v: Dict[str, Any]) → Dict[str, Any]



**Pydantic Fields:**


---

Expand Down Expand Up @@ -309,8 +305,6 @@ serialize_typed_dicts(v: Dict[str, Any]) → Dict[str, Any]



**Pydantic Fields:**


---

Expand Down Expand Up @@ -552,8 +546,6 @@ serialize_typed_dicts(v: Dict[str, Any]) → Dict[str, Any]



**Pydantic Fields:**


---

Expand Down
26 changes: 13 additions & 13 deletions docs/scripts/generate_python_sdk_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 9640ecd

Please sign in to comment.