mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-10-04 20:14:13 +00:00
api and provider codegen fixes
This commit is contained in:
parent
dcc065933e
commit
293d40f91c
3 changed files with 9 additions and 2 deletions
|
@ -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").
|
||||||
|
|
|
@ -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 <=> %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
|
||||||
|
|
|
@ -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("<", "<").replace(">", ">").replace("{", "{").replace("}", "}")
|
||||||
|
else:
|
||||||
|
default = default.replace("<", "<").replace(">", ">").replace("{", "{").replace("}", "}")
|
||||||
|
|
||||||
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} |")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue