api and provider codegen fixes

This commit is contained in:
Alexey Rybak 2025-09-23 09:25:57 -07:00
parent dcc065933e
commit 293d40f91c
3 changed files with 9 additions and 2 deletions

View file

@ -119,7 +119,7 @@ class Files(Protocol):
The file upload should be a multipart form request with: The file upload should be a multipart form request with:
- file: The File object (not file name) to be uploaded. - file: The File object (not file name) to be uploaded.
- purpose: The intended purpose of the uploaded file. - purpose: The intended purpose of the uploaded file.
- expires_after: Optional form values describing expiration for the file. Expected expires_after[anchor] = "created_at", expires_after[seconds] = <int>. Seconds must be between 3600 and 2592000 (1 hour to 30 days). - expires_after: Optional form values describing expiration for the file. Expected expires_after[anchor] = "created_at", expires_after[seconds] = {integer}. Seconds must be between 3600 and 2592000 (1 hour to 30 days).
:param file: The uploaded file object containing content and metadata (filename, content_type, etc.). :param file: The uploaded file object containing content and metadata (filename, content_type, etc.).
:param purpose: The intended purpose of the uploaded file (e.g., "assistants", "fine-tune"). :param purpose: The intended purpose of the uploaded file (e.g., "assistants", "fine-tune").

View file

@ -410,7 +410,7 @@ There are three implementations of search for PGVectoIndex available:
- How it works: - How it works:
- Uses PostgreSQL's vector extension (pgvector) to perform similarity search - Uses PostgreSQL's vector extension (pgvector) to perform similarity search
- Compares query embeddings against stored embeddings using Cosine distance or other distance metrics - Compares query embeddings against stored embeddings using Cosine distance or other distance metrics
- Eg. SQL query: SELECT document, embedding <=> %s::vector AS distance FROM table ORDER BY distance - Eg. SQL query: SELECT document, embedding &lt;=&gt; %s::vector AS distance FROM table ORDER BY distance
-Characteristics: -Characteristics:
- Semantic understanding - finds documents similar in meaning even if they don't share keywords - Semantic understanding - finds documents similar in meaning even if they don't share keywords

View file

@ -226,6 +226,13 @@ def generate_provider_docs(progress, provider_spec: Any, api_name: str) -> str:
field_type = field_info["type"].replace("|", "\\|") field_type = field_info["type"].replace("|", "\\|")
required = "Yes" if field_info["required"] else "No" required = "Yes" if field_info["required"] else "No"
default = str(field_info["default"]) if field_info["default"] is not None else "" default = str(field_info["default"]) if field_info["default"] is not None else ""
# Handle multiline default values and escape problematic characters for MDX
if "\n" in default:
default = default.replace("\n", "<br/>").replace("<", "&lt;").replace(">", "&gt;").replace("{", "&#123;").replace("}", "&#125;")
else:
default = default.replace("<", "&lt;").replace(">", "&gt;").replace("{", "&#123;").replace("}", "&#125;")
description_text = field_info["description"] or "" description_text = field_info["description"] or ""
md_lines.append(f"| `{field_name}` | `{field_type}` | {required} | {default} | {description_text} |") md_lines.append(f"| `{field_name}` | `{field_type}` | {required} | {default} | {description_text} |")