diff --git a/docs.json b/docs.json index 3172b7ac28..5a0cac429b 100644 --- a/docs.json +++ b/docs.json @@ -961,6 +961,14 @@ "pages": [ "weave/reference/python-sdk/trace_server_bindings/remote_http_trace_server" ] + }, + { + "group": "Other", + "pages": [ + "weave/reference/python-sdk/weave/trace/op", + "weave/reference/python-sdk/weave/trace/weave_client", + "weave/reference/python-sdk/weave/trace_server/trace_server_interface" + ] } ] }, @@ -971,14 +979,15 @@ { "group": "Classes", "pages": [ - "weave/reference/typescript-sdk/classes/Dataset", - "weave/reference/typescript-sdk/classes/Evaluation", - "weave/reference/typescript-sdk/classes/EvaluationLogger", - "weave/reference/typescript-sdk/classes/MessagesPrompt", - "weave/reference/typescript-sdk/classes/ScoreLogger", - "weave/reference/typescript-sdk/classes/StringPrompt", - "weave/reference/typescript-sdk/classes/WeaveClient", - "weave/reference/typescript-sdk/classes/WeaveObject" + "weave/reference/typescript-sdk/classes/dataset", + "weave/reference/typescript-sdk/classes/evaluation", + "weave/reference/typescript-sdk/classes/evaluationlogger", + "weave/reference/typescript-sdk/classes/messagesprompt", + "weave/reference/typescript-sdk/classes/objectref", + "weave/reference/typescript-sdk/classes/scorelogger", + "weave/reference/typescript-sdk/classes/stringprompt", + "weave/reference/typescript-sdk/classes/weaveclient", + "weave/reference/typescript-sdk/classes/weaveobject" ] }, { @@ -987,27 +996,27 @@ "weave/reference/typescript-sdk/functions/init", "weave/reference/typescript-sdk/functions/login", "weave/reference/typescript-sdk/functions/op", - "weave/reference/typescript-sdk/functions/requireCurrentCallStackEntry", - "weave/reference/typescript-sdk/functions/requireCurrentChildSummary", - "weave/reference/typescript-sdk/functions/weaveAudio", - "weave/reference/typescript-sdk/functions/weaveImage", - "weave/reference/typescript-sdk/functions/wrapOpenAI" + "weave/reference/typescript-sdk/functions/requirecurrentcallstackentry", + "weave/reference/typescript-sdk/functions/requirecurrentchildsummary", + "weave/reference/typescript-sdk/functions/weaveaudio", + "weave/reference/typescript-sdk/functions/weaveimage", + "weave/reference/typescript-sdk/functions/wrapopenai" ] }, { "group": "Interfaces", "pages": [ - "weave/reference/typescript-sdk/interfaces/CallSchema", - "weave/reference/typescript-sdk/interfaces/CallsFilter", - "weave/reference/typescript-sdk/interfaces/WeaveAudio", - "weave/reference/typescript-sdk/interfaces/WeaveImage" + "weave/reference/typescript-sdk/interfaces/callschema", + "weave/reference/typescript-sdk/interfaces/callsfilter", + "weave/reference/typescript-sdk/interfaces/weaveaudio", + "weave/reference/typescript-sdk/interfaces/weaveimage" ] }, { "group": "Type Aliases", "pages": [ - "weave/reference/typescript-sdk/type-aliases/Op", - "weave/reference/typescript-sdk/type-aliases/OpDecorator" + "weave/reference/typescript-sdk/type-aliases/op", + "weave/reference/typescript-sdk/type-aliases/opdecorator" ] } ] diff --git a/scripts/reference-generation/weave/fix_casing.py b/scripts/reference-generation/weave/fix_casing.py index b1225629c5..7971d5475d 100755 --- a/scripts/reference-generation/weave/fix_casing.py +++ b/scripts/reference-generation/weave/fix_casing.py @@ -12,108 +12,47 @@ from pathlib import Path def fix_typescript_casing(base_path): - """Fix TypeScript SDK file casing.""" - print("Fixing TypeScript SDK file casing...") + """Fix TypeScript SDK file casing - ensure all files use lowercase.""" + print("Fixing TypeScript SDK file casing to lowercase...") - ts_base = Path(base_path) / "weave/reference/typescript-sdk/weave" + ts_base = Path(base_path) / "weave/reference/typescript-sdk" if not ts_base.exists(): print(f" TypeScript SDK path not found: {ts_base}") return - # Define correct names for each directory - casing_rules = { - "classes": { - "dataset": "Dataset", - "evaluation": "Evaluation", - "weaveclient": "WeaveClient", - "weaveobject": "WeaveObject", - }, - "interfaces": { - "callschema": "CallSchema", - "callsfilter": "CallsFilter", - "weaveaudio": "WeaveAudio", - "weaveimage": "WeaveImage", - }, - "functions": { - # Functions should be lowercase/camelCase - "init": "init", - "login": "login", - "op": "op", - "requirecurrentcallstackentry": "requireCurrentCallStackEntry", - "requirecurrentchildsummary": "requireCurrentChildSummary", - "weaveaudio": "weaveAudio", - "weaveimage": "weaveImage", - "wrapopenai": "wrapOpenAI", - }, - "type-aliases": { - "op": "Op", # Type alias Op is uppercase - "opdecorator": "OpDecorator", - "messagesprompt": "MessagesPrompt", - "stringprompt": "StringPrompt", - } - } + # All TypeScript SDK files should use lowercase filenames for consistency + # This applies to classes, functions, interfaces, and type-aliases + subdirs_to_check = ["classes", "functions", "interfaces", "type-aliases"] - for dir_name, rules in casing_rules.items(): - dir_path = ts_base / dir_name + for subdir in subdirs_to_check: + dir_path = ts_base / subdir if not dir_path.exists(): continue for file in dir_path.glob("*.mdx"): - basename = file.stem.lower() - if basename in rules: - correct_name = rules[basename] - if file.stem != correct_name: - new_path = file.parent / f"{correct_name}.mdx" - print(f" Renaming: {file.name} → {correct_name}.mdx") - shutil.move(str(file), str(new_path)) + # Convert filename to lowercase + lowercase_name = file.stem.lower() + if file.stem != lowercase_name: + new_path = file.parent / f"{lowercase_name}.mdx" + print(f" Renaming: {file.name} → {lowercase_name}.mdx") + shutil.move(str(file), str(new_path)) def fix_python_casing(base_path): - """Fix Python SDK file casing.""" - print("Fixing Python SDK file casing...") + """Fix Python SDK file casing for WEAVE reference docs only.""" + print("Fixing Weave Python SDK file casing...") - py_base = Path(base_path) / "models/ref/python/public-api" + # IMPORTANT: This should ONLY touch Weave reference docs, never Models reference docs + py_base = Path(base_path) / "weave/reference/python-sdk" if not py_base.exists(): - print(f" Python SDK path not found: {py_base}") + print(f" Weave Python SDK path not found: {py_base}") return - # Python class files that should be uppercase - uppercase_files = { - "artifactcollection": "ArtifactCollection", - "artifactcollections": "ArtifactCollections", - "artifactfiles": "ArtifactFiles", - "artifacttype": "ArtifactType", - "artifacttypes": "ArtifactTypes", - "betareport": "BetaReport", - "file": "File", - "member": "Member", - "project": "Project", - "registry": "Registry", - "run": "Run", - "runartifacts": "RunArtifacts", - "sweep": "Sweep", - "team": "Team", - "user": "User", - } - - # Files that should remain lowercase - lowercase_files = ["api", "artifacts", "automations", "files", "projects", - "reports", "runs", "sweeps", "_index"] + # For Weave Python SDK, we generally want lowercase filenames + # Only specific files might need special casing - currently none known + # Most Weave modules use lowercase with underscores (e.g., weave_client.mdx) - for file in py_base.glob("*.mdx"): - basename = file.stem.lower() - - if basename in uppercase_files: - correct_name = uppercase_files[basename] - if file.stem != correct_name: - new_path = file.parent / f"{correct_name}.mdx" - print(f" Renaming: {file.name} → {correct_name}.mdx") - shutil.move(str(file), str(new_path)) - elif basename in lowercase_files: - # Ensure these stay lowercase - if file.stem != basename: - new_path = file.parent / f"{basename}.mdx" - print(f" Renaming: {file.name} → {basename}.mdx") - shutil.move(str(file), str(new_path)) + print(f" Weave Python SDK files are generated with correct casing") + print(f" No casing changes needed for Weave reference documentation") def main(): """Main function to fix all casing issues.""" diff --git a/scripts/reference-generation/weave/generate_python_sdk_docs.py b/scripts/reference-generation/weave/generate_python_sdk_docs.py index 46f6d0e9bd..63f22ee16b 100755 --- a/scripts/reference-generation/weave/generate_python_sdk_docs.py +++ b/scripts/reference-generation/weave/generate_python_sdk_docs.py @@ -255,6 +255,10 @@ def generate_module_docs(module, module_name: str, src_root_path: str, version: # Remove ` at the start of lines that don't have a closing content = re.sub(r'^- `([^`\n]*?)$', r'- \1', content, flags=re.MULTILINE) + # Remove malformed table separators that lazydocs sometimes generates + # These appear as standalone lines with just dashes (------) which break markdown parsing + content = re.sub(r'\n\s*------+\s*\n', '\n\n', content) + # Fix parameter lists that have been broken by lazydocs # Strategy: Parse all parameters into a structured format, then reconstruct them properly def fix_parameter_lists(text): diff --git a/scripts/reference-generation/weave/generate_python_sdk_minimal.py b/scripts/reference-generation/weave/generate_python_sdk_minimal.py index a82466fafe..8279caf161 100755 --- a/scripts/reference-generation/weave/generate_python_sdk_minimal.py +++ b/scripts/reference-generation/weave/generate_python_sdk_minimal.py @@ -24,9 +24,44 @@ def install_weave(version="latest"): def get_docstring(obj): - """Extract and format docstring.""" + """Extract and format docstring for MDX compatibility.""" + import re + doc = inspect.getdoc(obj) - return doc if doc else "No description available." + if not doc: + return "No description available." + + # Remove Pydantic documentation links that reference non-existent concept pages + # These come from Pydantic's own docstrings and aren't relevant for our docs + # Pattern: [text](../concepts/anything.md) or similar concept page links + doc = re.sub(r'\[([^\]]+)\]\(\.\./concepts/[^\)]+\)', r'\1', doc) + doc = re.sub(r'\[([^\]]+)\]\(\./concepts/[^\)]+\)', r'\1', doc) + doc = re.sub(r'\[([^\]]+)\]\(concepts/[^\)]+\)', r'\1', doc) + + # Remove "Usage Documentation" admonition blocks that contain broken links + doc = re.sub(r'!!! abstract "Usage Documentation"\s+\[`[^`]+`\]\([^\)]+\)\s*\n\s*\n', '', doc) + + # Escape curly braces for MDX (they're interpreted as JSX expressions) + # We need to be careful to only escape braces that aren't in code blocks + lines = doc.split('\n') + result_lines = [] + in_code_block = False + + for line in lines: + # Check if this is a code block marker (triple backticks or indented code after ::) + if line.strip().startswith('```'): + in_code_block = not in_code_block + result_lines.append(line) + elif not in_code_block: + # Escape curly braces outside of code blocks + # Replace { with \{ and } with \} + line = line.replace('{', '\\{').replace('}', '\\}') + result_lines.append(line) + else: + # Inside code block, keep as-is + result_lines.append(line) + + return '\n'.join(result_lines) def get_function_signature(func): diff --git a/scripts/reference-generation/weave/generate_service_api_spec.py b/scripts/reference-generation/weave/generate_service_api_spec.py index ad7bb0f456..9a8df03e8f 100755 --- a/scripts/reference-generation/weave/generate_service_api_spec.py +++ b/scripts/reference-generation/weave/generate_service_api_spec.py @@ -12,59 +12,19 @@ def main(): """Main function.""" print("Service API configuration:") - print(" Using remote OpenAPI spec: https://trace.wandb.ai/openapi.json") - print(" Mintlify will generate documentation for all 41 endpoints") + print(" Using OpenAPI spec from sync_openapi_spec.py") + print(" Mintlify will generate documentation for endpoints") print("") - # Create the service-api directory structure + # Create the service-api directory structure for openapi.json + # Note: The landing page is service-api.mdx (not service-api/index.mdx) + # and is managed by update_service_api_landing.py service_api_dir = Path("weave/reference/service-api") service_api_dir.mkdir(parents=True, exist_ok=True) - # Create an index file if it doesn't exist - index_file = service_api_dir / "index.mdx" - if not index_file.exists(): - index_content = """--- -title: "Service API" -description: "REST API endpoints for the Weave service" ---- - -# Weave Service API - -The Weave Service API provides REST endpoints for interacting with the Weave tracing service. - -## Available Endpoints - -This documentation is automatically generated from the OpenAPI specification at https://trace.wandb.ai/openapi.json. - -The API includes endpoints for: -- **Calls**: Start, end, update, query, and manage traces -- **Tables**: Create, update, and query data tables -- **Files**: Upload and manage file attachments -- **Objects**: Store and retrieve versioned objects -- **Feedback**: Collect and query user feedback -- **Costs**: Track and query usage costs -- **Inference**: OpenAI-compatible inference endpoints - -## Authentication - -Most endpoints require authentication. Include your W&B API key in the request headers: - -``` -Authorization: Bearer YOUR_API_KEY -``` - -## Base URL - -All API requests should be made to: - -``` -https://trace.wandb.ai -``` -""" - index_file.write_text(index_content) - print(f"✓ Created Service API index at {index_file}") - - print("✓ Service API setup complete!") + print("✓ Service API directory structure ready") + print(" Note: Landing page at weave/reference/service-api.mdx") + print(" Note: OpenAPI spec at weave/reference/service-api/openapi.json") if __name__ == "__main__": diff --git a/scripts/reference-generation/weave/generate_typescript_sdk_docs.py b/scripts/reference-generation/weave/generate_typescript_sdk_docs.py index d980f999ff..a41db337bd 100755 --- a/scripts/reference-generation/weave/generate_typescript_sdk_docs.py +++ b/scripts/reference-generation/weave/generate_typescript_sdk_docs.py @@ -214,12 +214,9 @@ def convert_to_mintlify_format(docs_dir): # Fix parameter tables content = re.sub(r'\|\s*:--\s*\|', '| --- |', content) - # Fix internal links to use relative paths - # Keep relative links as-is for files in subdirectories - # TypeDoc generates links like ../classes/WeaveObject.md which are already relative - # We just need to remove the .md extension + # Fix internal links to use relative paths with lowercase filenames + # TypeDoc generates links like ../classes/WeaveObject.md which need fixing - # Fix internal links # 1. Remove .md extensions from all links content = re.sub(r'\.md(#[^)]+)?\)', r'\1)', content) @@ -228,24 +225,30 @@ def convert_to_mintlify_format(docs_dir): content = re.sub(r'\]\(\.\./index', '](../', content) content = re.sub(r'\]\(README', '](typescript-sdk', content) - # 3. Fix same-directory links (e.g., WeaveObject -> ./WeaveObject) - # For links to class names (start with capital letter) that don't have a path - content = re.sub(r'\]\(([A-Z][a-zA-Z]+)(#[^)]+)?\)', r'](./\1\2)', content) - - # 4. Fix cross-directory links based on file location - if '/functions/' in str(md_file): - # Functions linking to classes/interfaces need ../ - content = re.sub(r'\]\(classes/([^)]+)\)', r'](../classes/\1)', content) - content = re.sub(r'\]\(interfaces/([^)]+)\)', r'](../interfaces/\1)', content) - elif '/type-aliases/' in str(md_file): - # Type aliases linking to classes need ../ - content = re.sub(r'\]\(classes/([^)]+)\)', r'](../classes/\1)', content) - elif md_file.name == 'README.md' or md_file.name == 'index.mdx': - # Index/README will become landing page, so needs ./typescript-sdk/ prefix - content = re.sub(r'\]\(classes/([^)]+)\)', r'](./typescript-sdk/classes/\1)', content) - content = re.sub(r'\]\(interfaces/([^)]+)\)', r'](./typescript-sdk/interfaces/\1)', content) - content = re.sub(r'\]\(functions/([^)]+)\)', r'](./typescript-sdk/functions/\1)', content) - content = re.sub(r'\]\(type-aliases/([^)]+)\)', r'](./typescript-sdk/type-aliases/\1)', content) + # 3. Fix all TypeDoc-generated links to lowercase + # Paths that already have directory structure (../classes/, ../interfaces/, etc.) + content = re.sub(r'\]\(\.\./classes/([^)#]+)(#[^)]+)?\)', lambda m: f'](../classes/{m.group(1).lower()}{m.group(2) or ""})', content) + content = re.sub(r'\]\(\.\./interfaces/([^)#]+)(#[^)]+)?\)', lambda m: f'](../interfaces/{m.group(1).lower()}{m.group(2) or ""})', content) + content = re.sub(r'\]\(\.\./functions/([^)#]+)(#[^)]+)?\)', lambda m: f'](../functions/{m.group(1).lower()}{m.group(2) or ""})', content) + content = re.sub(r'\]\(\.\./type-aliases/([^)#]+)(#[^)]+)?\)', lambda m: f'](../type-aliases/{m.group(1).lower()}{m.group(2) or ""})', content) + + # 4. Fix relative links without ../ prefix (same directory or subdirectory) + content = re.sub(r'\]\(classes/([^)#]+)(#[^)]+)?\)', lambda m: f'](../classes/{m.group(1).lower()}{m.group(2) or ""})', content) + content = re.sub(r'\]\(interfaces/([^)#]+)(#[^)]+)?\)', lambda m: f'](../interfaces/{m.group(1).lower()}{m.group(2) or ""})', content) + content = re.sub(r'\]\(functions/([^)#]+)(#[^)]+)?\)', lambda m: f'](../functions/{m.group(1).lower()}{m.group(2) or ""})', content) + content = re.sub(r'\]\(type-aliases/([^)#]+)(#[^)]+)?\)', lambda m: f'](../type-aliases/{m.group(1).lower()}{m.group(2) or ""})', content) + + # 5. Fix same-directory class/interface links (start with capital letter, no path separator) + content = re.sub(r'\]\(([A-Z][a-zA-Z]+)(#[^)]+)?\)', lambda m: f'](./{m.group(1).lower()}{m.group(2) or ""})', content) + + # 6. Special fix for README/landing page - it becomes typescript-sdk.mdx at parent level + if md_file.name == 'README.md': + # The landing page will be at weave/reference/typescript-sdk.mdx + # so links to subdirectories need ./typescript-sdk/ prefix + content = re.sub(r'\]\(\.\./classes/([^)#]+)(#[^)]+)?\)', lambda m: f'](./typescript-sdk/classes/{m.group(1).lower()}{m.group(2) or ""})', content) + content = re.sub(r'\]\(\.\./interfaces/([^)#]+)(#[^)]+)?\)', lambda m: f'](./typescript-sdk/interfaces/{m.group(1).lower()}{m.group(2) or ""})', content) + content = re.sub(r'\]\(\.\./functions/([^)#]+)(#[^)]+)?\)', lambda m: f'](./typescript-sdk/functions/{m.group(1).lower()}{m.group(2) or ""})', content) + content = re.sub(r'\]\(\.\./type-aliases/([^)#]+)(#[^)]+)?\)', lambda m: f'](./typescript-sdk/type-aliases/{m.group(1).lower()}{m.group(2) or ""})', content) # Special handling for index files (README.md) # These files are at the root level and link directly to subdirectories @@ -255,8 +258,9 @@ def convert_to_mintlify_format(docs_dir): # Just ensure .md extension is removed (already done above) pass - # Write as .mdx file - mdx_file = md_file.with_suffix('.mdx') + # Write as .mdx file with lowercase filename (avoid Git case sensitivity issues) + lowercase_stem = md_file.stem.lower() + mdx_file = md_file.parent / f"{lowercase_stem}.mdx" mdx_file.write_text(content) # Remove original .md file @@ -305,6 +309,17 @@ def extract_members_to_separate_files(docs_path): func_content = match.group(1) func_name = match.group(2) + # Fix links when moving from landing page to functions subdirectory + # ./typescript-sdk/classes/X -> ../classes/X + # ./typescript-sdk/interfaces/X -> ../interfaces/X + func_content = func_content.replace('./typescript-sdk/classes/', '../classes/') + func_content = func_content.replace('./typescript-sdk/interfaces/', '../interfaces/') + func_content = func_content.replace('./typescript-sdk/type-aliases/', '../type-aliases/') + func_content = func_content.replace('./typescript-sdk/functions/', './') + + # Fix TypeDoc-generated anchor links like (typescript-sdk#op) -> (../type-aliases/op) + func_content = re.sub(r'\]\(typescript-sdk#([^)]+)\)', r'](../type-aliases/\1)', func_content) + # Create the function file content func_title = func_name func_file_content = f"""--- @@ -314,20 +329,22 @@ def extract_members_to_separate_files(docs_path): {func_content.replace(f'### {func_name}', f'# {func_name}')}""" - # Write the function file - func_file = functions_dir / f"{func_name}.mdx" + # Write the function file with lowercase filename (avoid Git case sensitivity issues) + func_filename = func_name.lower() + func_file = functions_dir / f"{func_filename}.mdx" func_file.write_text(func_file_content) - functions_found.append(func_name) - print(f" ✓ Extracted {func_name}.mdx") + functions_found.append(func_filename) + print(f" ✓ Extracted {func_filename}.mdx") if functions_found: # Remove the detailed function documentation from index content = function_pattern.sub('', content) - # Update the Functions section with links + # Update the Functions section with links (functions_found already has lowercase names) + # The landing page is at typescript-sdk.mdx, so links need ./typescript-sdk/ prefix functions_section = "\n### Functions\n\n" for func in functions_found: - functions_section += f"- [{func}](functions/{func})\n" + functions_section += f"- [{func}](./typescript-sdk/functions/{func})\n" # Replace existing Functions section with links content = re.sub( @@ -354,6 +371,17 @@ def extract_members_to_separate_files(docs_path): # Skip if it's not a type alias (e.g., if it's a function or class) if not alias_content.startswith(f"### {alias_name}\n\nƬ "): continue + + # Fix links when moving from landing page to type-aliases subdirectory + # ./typescript-sdk/classes/X -> ../classes/X + # ./typescript-sdk/interfaces/X -> ../interfaces/X + alias_content = alias_content.replace('./typescript-sdk/classes/', '../classes/') + alias_content = alias_content.replace('./typescript-sdk/interfaces/', '../interfaces/') + alias_content = alias_content.replace('./typescript-sdk/functions/', '../functions/') + alias_content = alias_content.replace('./typescript-sdk/type-aliases/', './') + + # Fix TypeDoc-generated anchor links like (typescript-sdk#op) -> (./op) + alias_content = re.sub(r'\]\(typescript-sdk#([^)]+)\)', lambda m: f'](./{m.group(1).lower()})', alias_content) # Create the type alias file content alias_file_content = f"""--- @@ -363,17 +391,19 @@ def extract_members_to_separate_files(docs_path): {alias_content.replace(f'### {alias_name}', f'# {alias_name}')}""" - # Write the type alias file - alias_file = type_aliases_dir / f"{alias_name}.mdx" + # Write the type alias file with lowercase filename (avoid Git case sensitivity issues) + alias_filename = alias_name.lower() + alias_file = type_aliases_dir / f"{alias_filename}.mdx" alias_file.write_text(alias_file_content) - print(f" ✓ Extracted {alias_name}.mdx") + print(f" ✓ Extracted {alias_filename}.mdx") # Remove all extracted type aliases from index content = type_alias_pattern.sub('', content) - # Update Type Aliases section with links to all extracted type aliases + # Update Type Aliases section with links to all extracted type aliases (use lowercase filenames) + # The landing page is at typescript-sdk.mdx, so links need ./typescript-sdk/ prefix if type_aliases: - type_aliases_links = [f"- [{name}](type-aliases/{name})" for _, name in type_aliases if _.startswith(f"### {name}\n\nƬ ")] + type_aliases_links = [f"- [{name}](./typescript-sdk/type-aliases/{name.lower()})" for _, name in type_aliases if _.startswith(f"### {name}\n\nƬ ")] if type_aliases_links: type_aliases_section = "\n### Type Aliases\n\n" + "\n".join(sorted(type_aliases_links)) + "\n" @@ -473,4 +503,4 @@ def main(): if __name__ == "__main__": - main() \ No newline at end of file + main() diff --git a/scripts/reference-generation/weave/sync_openapi_spec.py b/scripts/reference-generation/weave/sync_openapi_spec.py index fff938e415..b6302557ed 100755 --- a/scripts/reference-generation/weave/sync_openapi_spec.py +++ b/scripts/reference-generation/weave/sync_openapi_spec.py @@ -16,8 +16,11 @@ import sys from typing import Optional, Tuple +# Remote OpenAPI spec URL +REMOTE_SPEC_URL = "https://raw.githubusercontent.com/wandb/weave/refs/heads/master/tools/codegen/openapi.json" -def fetch_remote_spec(url: str = "https://trace.wandb.ai/openapi.json") -> dict: + +def fetch_remote_spec(url: str = REMOTE_SPEC_URL) -> dict: """Fetch the OpenAPI spec from the remote service.""" print(f" Fetching remote spec from {url}...") try: @@ -44,6 +47,62 @@ def spec_hash(spec: dict) -> str: return hashlib.sha256(spec_str.encode()).hexdigest() +def validate_spec(spec: dict) -> list: + """ + Validate the OpenAPI spec for potential issues. + Returns list of warning messages about spec issues. + """ + warnings = [] + + paths = spec.get("paths", {}) + + # Track endpoint definitions to detect duplicates + endpoint_map = {} # (method, path) -> [operation_ids] + tag_endpoint_map = {} # tag -> [(method, path)] + + for path, path_item in paths.items(): + for method in ["get", "post", "put", "delete", "patch"]: + if method not in path_item: + continue + + operation = path_item[method] + operation_id = operation.get("operationId", "") + tags = operation.get("tags", []) + + # Check for duplicate endpoint definitions + endpoint_key = (method.upper(), path) + if endpoint_key not in endpoint_map: + endpoint_map[endpoint_key] = [] + endpoint_map[endpoint_key].append(operation_id) + + # Track endpoints by tag to detect if endpoints appear in multiple tags + for tag in tags: + if tag not in tag_endpoint_map: + tag_endpoint_map[tag] = [] + tag_endpoint_map[tag].append(endpoint_key) + + # Check for actual duplicates (same endpoint with different operation IDs) + for endpoint_key, operation_ids in endpoint_map.items(): + if len(operation_ids) > 1: + method, path = endpoint_key + warnings.append(f" ⚠ Duplicate endpoint: {method} {path} defined {len(operation_ids)} times with operation IDs: {operation_ids}") + + # Check for endpoints appearing in multiple categories (tags) + endpoint_tag_count = {} + for tag, endpoints in tag_endpoint_map.items(): + for endpoint in endpoints: + if endpoint not in endpoint_tag_count: + endpoint_tag_count[endpoint] = [] + endpoint_tag_count[endpoint].append(tag) + + for endpoint, tags in endpoint_tag_count.items(): + if len(tags) > 1: + method, path = endpoint + warnings.append(f" ℹ Endpoint {method} {path} appears in multiple categories: {tags}") + + return warnings + + def compare_specs(local_spec: dict, remote_spec: dict) -> Tuple[bool, list]: """ Compare local and remote specs. @@ -100,7 +159,7 @@ def update_docs_json(use_local: bool = False): print(" ✓ Updated docs.json to use local OpenAPI spec") else: # Use remote spec - ref_page["openapi"] = {"source": "https://trace.wandb.ai/openapi.json"} + ref_page["openapi"] = {"source": REMOTE_SPEC_URL} print(" ✓ Updated docs.json to use remote OpenAPI spec") with open(docs_json_path, 'w') as f: @@ -117,10 +176,9 @@ def main(): print("Syncing OpenAPI specification...") local_spec_path = Path("weave/reference/service-api/openapi.json") - remote_url = "https://trace.wandb.ai/openapi.json" # Fetch remote spec - remote_spec = fetch_remote_spec(remote_url) + remote_spec = fetch_remote_spec(REMOTE_SPEC_URL) if not remote_spec: # If can't fetch remote, ensure we're using local if local_spec_path.exists(): @@ -131,6 +189,20 @@ def main(): print(" ✗ No local spec and couldn't fetch remote spec") return 1 + # Validate the remote spec for issues + print("\n Validating OpenAPI spec...") + spec_warnings = validate_spec(remote_spec) + if spec_warnings: + print(" ⚠ OpenAPI spec validation warnings:") + for warning in spec_warnings: + print(warning) + if any("Duplicate endpoint" in w for w in spec_warnings): + print("\n ⚠ CRITICAL: Duplicate endpoint definitions found!") + print(" This may indicate an issue in the upstream OpenAPI spec.") + print(" Consider reporting this to the Weave team: https://github.com/wandb/weave/issues") + else: + print(" ✓ OpenAPI spec validation passed") + # Load local spec local_spec = load_local_spec(local_spec_path) @@ -183,7 +255,7 @@ def main(): if using_local: print(f"\n ℹ Currently using local OpenAPI spec ({local_spec_path})") else: - print("\n ℹ Currently using remote OpenAPI spec (https://trace.wandb.ai/openapi.json)") + print(f"\n ℹ Currently using remote OpenAPI spec ({REMOTE_SPEC_URL})") print("\n Tip: Use --use-local to configure docs.json to use the local spec") print(" Use --use-remote to configure docs.json to use the remote spec") diff --git a/scripts/reference-generation/weave/update_service_api_landing.py b/scripts/reference-generation/weave/update_service_api_landing.py index 77abeb8052..bcfd038378 100755 --- a/scripts/reference-generation/weave/update_service_api_landing.py +++ b/scripts/reference-generation/weave/update_service_api_landing.py @@ -96,13 +96,24 @@ def generate_endpoints_section(endpoints: Dict[str, List[Tuple[str, str, str, st if tag not in category_order: category_order.append(tag) + # Track which categories we've already written to prevent duplicate H3s + written_categories = set() + for category in category_order: - if category not in endpoints: + if category not in endpoints or category in written_categories: continue - + + written_categories.add(category) lines.append(f"\n### {category}\n\n") + # Deduplicate endpoints within the category by (method, path) to avoid listing the same endpoint twice + seen_endpoints = set() for method, path, operation_id, summary in endpoints[category]: + endpoint_key = (method, path) + if endpoint_key in seen_endpoints: + continue + seen_endpoints.add(endpoint_key) + url = generate_endpoint_url(operation_id, category) lines.append(f"- **[{method} {path}]({url})** - {summary}\n") diff --git a/scripts/reference-generation/weave/update_weave_toc.py b/scripts/reference-generation/weave/update_weave_toc.py index aef71eda26..9c342273ed 100755 --- a/scripts/reference-generation/weave/update_weave_toc.py +++ b/scripts/reference-generation/weave/update_weave_toc.py @@ -30,17 +30,15 @@ def get_generated_python_modules(): parts = list(rel_path.parts) parts[-1] = parts[-1].replace('.mdx', '') - # Determine the group based on path - if len(parts) >= 2: - if parts[0] == "weave": - if parts[1] == "trace": - group = "Core" - elif parts[1] == "trace_server": - group = "Trace Server" - elif parts[1] == "trace_server_bindings": - group = "Trace Server Bindings" - else: - group = "Other" + # Determine the group based on path structure + # Paths are relative to python-sdk/, so parts[0] is the module directory + if len(parts) >= 1: + if parts[0] == "trace": + group = "Core" + elif parts[0] == "trace_server": + group = "Trace Server" + elif parts[0] == "trace_server_bindings": + group = "Trace Server Bindings" else: group = "Other" else: @@ -131,12 +129,8 @@ def update_docs_json(python_modules, typescript_items, service_endpoints): # Update Python SDK for page in reference_pages: if isinstance(page, dict) and page.get("group") == "Python SDK": - # Keep the index page if it exists - new_pages = [] - for existing_page in page.get("pages", []): - if isinstance(existing_page, str) and existing_page.endswith("/index"): - new_pages.append(existing_page) - break + # Always start with the root page + new_pages = ["weave/reference/python-sdk"] # Add the grouped modules if "Core" in python_modules and python_modules["Core"]: @@ -170,11 +164,8 @@ def update_docs_json(python_modules, typescript_items, service_endpoints): # Update TypeScript SDK for page in reference_pages: if isinstance(page, dict) and page.get("group") == "TypeScript SDK": - # Keep the index and README if they exist - new_pages = [] - for existing_page in page.get("pages", []): - if isinstance(existing_page, str) and (existing_page.endswith("/index") or existing_page.endswith("/README")): - new_pages.append(existing_page) + # Always start with the root page + new_pages = ["weave/reference/typescript-sdk"] # Add the categorized items with proper casing if "classes" in typescript_items and typescript_items["classes"]: @@ -205,26 +196,8 @@ def update_docs_json(python_modules, typescript_items, service_endpoints): print(f"✓ Updated TypeScript SDK with {sum(len(items) for items in typescript_items.values())} items") updated = True - # Update Service API - for page in reference_pages: - if isinstance(page, dict) and page.get("group") == "Service API": - # Point to the versioned OpenAPI spec in the Weave repo - # This spec already has the necessary filters applied - import os - version = os.environ.get('WEAVE_VERSION', 'latest') - - # The version should already be resolved by the Python SDK generation - # which converts "latest" to an actual version number - if version and version != "latest": - # Use the specific version tag - openapi_url = f"https://raw.githubusercontent.com/wandb/weave/v{version}/sdks/node/weave.openapi.json" - else: - # Fallback to master if somehow we don't have a version - openapi_url = "https://raw.githubusercontent.com/wandb/weave/master/sdks/node/weave.openapi.json" - - page["openapi"] = openapi_url - print(f"✓ Updated Service API to use versioned OpenAPI spec: {openapi_url}") - updated = True + # Note: Service API OpenAPI configuration is managed by sync_openapi_spec.py + # We don't modify it here to preserve the local vs remote spec choice break break diff --git a/weave/guides/tracking/tracing.mdx b/weave/guides/tracking/tracing.mdx index e1f72dafcf..d17f9c8890 100644 --- a/weave/guides/tracking/tracing.mdx +++ b/weave/guides/tracking/tracing.mdx @@ -813,7 +813,7 @@ The easiest way to get started is to construct a view in the UI, then learn more - To fetch calls using the TypeScript API, you can use the [`client.getCalls`](/weave/reference/typescript-sdk/classes/WeaveClient#getcalls) method. + To fetch calls using the TypeScript API, you can use the [`client.getCalls`](/weave/reference/typescript-sdk/classes/weaveclient#getcalls) method. ```typescript import * as weave from 'weave' diff --git a/weave/reference/python-sdk/weave/index.mdx b/weave/reference/python-sdk/weave/index.mdx new file mode 100644 index 0000000000..d46fe09319 --- /dev/null +++ b/weave/reference/python-sdk/weave/index.mdx @@ -0,0 +1,6825 @@ +--- +title: weave +--- + +# weave + +## Functions + +### `as_op(fn: 'Callable[P, R]') -> 'Op[P, R]'` + +Given a @weave.op() decorated function, return its Op. + +@weave.op() decorated functions are instances of Op already, so this +function should be a no-op at runtime. But you can use it to satisfy type checkers +if you need to access OpDef attributes in a typesafe way. + +Args: + fn: A weave.op() decorated function. + +Returns: + The Op of the function. + +### `attributes(attributes: 'dict[str, Any]') -> 'Iterator'` + +Context manager for setting attributes on a call. + +Example: +```python +with weave.attributes({'env': 'production'}): + print(my_function.call("World")) +``` + +### `finish() -> 'None'` + +Stops logging to weave. + +Following finish, calls of weave.op() decorated functions will no longer be logged. You will need to run weave.init() again to resume logging. + +### `get(uri: 'str | ObjectRef') -> 'Any'` + +A convenience function for getting an object from a URI. + +Many objects logged by Weave are automatically registered with the Weave +server. This function allows you to retrieve those objects by their URI. + +Args: + uri: A fully-qualified weave ref URI. + +Returns: + The object. + +Example: +```python +weave.init("weave_get_example") +dataset = weave.Dataset(rows=[{"a": 1, "b": 2}]) +ref = weave.publish(dataset) + +dataset2 = weave.get(ref) # same as dataset! +``` + +### `get_client() -> 'weave_client.WeaveClient | None'` + +No description available. + +### `get_current_call() -> 'Call | None'` + +Get the Call object for the currently executing Op, within that Op. + +Returns: + The Call object for the currently executing Op, or + None if tracking has not been initialized or this method is + invoked outside an Op. + +Note: + The returned Call's ``attributes`` dictionary becomes immutable + once the call starts. Use :func:`weave.attributes` to set + call metadata before invoking an Op. The ``summary`` field may + be updated while the Op executes and will be merged with + computed summary information when the call finishes. + +### `init(project_name: 'str', *, settings: 'UserSettings | dict[str, Any] | None' = None, autopatch_settings: 'AutopatchSettings | None' = None, global_postprocess_inputs: 'PostprocessInputsFunc | None' = None, global_postprocess_output: 'PostprocessOutputFunc | None' = None, global_attributes: 'dict[str, Any] | None' = None) -> 'weave_client.WeaveClient'` + +Initialize weave tracking, logging to a wandb project. + +Logging is initialized globally, so you do not need to keep a reference +to the return value of init. + +Following init, calls of weave.op() decorated functions will be logged +to the specified project. + +Args: + project_name: The name of the Weights & Biases team and project to log to. If you don't + specify a team, your default entity is used. + To find or update your default entity, refer to [User Settings](https://docs.wandb.ai/guides/models/app/settings-page/user-settings/#default-team) in the W&B Models documentation. + settings: Configuration for the Weave client generally. + autopatch_settings: (Deprecated) Configuration for autopatch integrations. Use explicit patching instead. + global_postprocess_inputs: A function that will be applied to all inputs of all ops. + global_postprocess_output: A function that will be applied to all outputs of all ops. + global_attributes: A dictionary of attributes that will be applied to all traces. + +NOTE: Global postprocessing settings are applied to all ops after each op's own +postprocessing. The order is always: +1. Op-specific postprocessing +2. Global postprocessing + +Returns: + A Weave client. + +### `op(func: 'Callable[P, R] | None' = None, *, name: 'str | None' = None, call_display_name: 'str | CallDisplayNameFunc | None' = None, postprocess_inputs: 'PostprocessInputsFunc | None' = None, postprocess_output: 'PostprocessOutputFunc | None' = None, tracing_sample_rate: 'float' = 1.0, enable_code_capture: 'bool' = True, accumulator: 'Callable[[Any | None, Any], Any] | None' = None) -> 'Callable[[Callable[P, R]], Op[P, R]] | Op[P, R]'` + +A decorator to weave op-ify a function or method. Works for both sync and async. +Automatically detects iterator functions and applies appropriate behavior. + +### `publish(obj: 'Any', name: 'str | None' = None) -> 'ObjectRef'` + +Save and version a Python object. + +Weave creates a new version of the object if the object's name already exists and its content hash does +not match the latest version of that object. + +Args: + obj: The object to save and version. + name: The name to save the object under. + +Returns: + A Weave Ref to the saved object. + +### `ref(location: 'str') -> 'ObjectRef'` + +Creates a Ref to an existing Weave object. This does not directly retrieve +the object but allows you to pass it to other Weave API functions. + +Args: + location: A Weave Ref URI, or if `weave.init()` has been called, `name:version` or `name`. If no version is provided, `latest` is used. + +Returns: + A Weave Ref to the object. + +### `require_current_call() -> 'Call'` + +Get the Call object for the currently executing Op, within that Op. + +This allows you to access attributes of the Call such as its id or feedback +while it is running. + +```python +@weave.op +def hello(name: str) -> None: + print(f"Hello {name}!") + current_call = weave.require_current_call() + print(current_call.id) +``` + +It is also possible to access a Call after the Op has returned. + +If you have the Call's id, perhaps from the UI, you can use the `get_call` method on the +`WeaveClient` returned from `weave.init` to retrieve the Call object. + +```python +client = weave.init("") +mycall = client.get_call("") +``` + +Alternately, after defining your Op you can use its `call` method. For example: + +```python +@weave.op +def add(a: int, b: int) -> int: + return a + b + +result, call = add.call(1, 2) +print(call.id) +``` + +Returns: + The Call object for the currently executing Op + +Raises: + NoCurrentCallError: If tracking has not been initialized or this method is + invoked outside an Op. + +### `set_view(name: 'str', content: 'Content | str', *, extension: 'str | None' = None, mimetype: 'str | None' = None, metadata: 'dict[str, Any] | None' = None, encoding: 'str' = 'utf-8') -> 'None'` + +Attach a custom view to the current call summary at `_weave.views.`. + +Args: + name: The view name (key under `summary._weave.views`). + content: A `weave.Content` instance or raw string. Strings are wrapped via + `Content.from_text` using the supplied extension or mimetype. + extension: Optional file extension to use when `content` is a string. + mimetype: Optional MIME type to use when `content` is a string. + metadata: Optional metadata to attach when creating `Content` from text. + encoding: Text encoding to apply when creating `Content` from text. + +Returns: + None + +Examples: + >>> import weave + >>> weave.init("proj") + >>> @weave.op + ... def foo(): + ... weave.set_view("readme", "# Hello", extension="md") + ... return 1 + >>> foo() + +### `thread(thread_id: 'str | None | object' = ) -> 'Iterator[ThreadContext]'` + +Context manager for setting thread_id on calls within the context. + +Examples: +```python +# Auto-generate thread_id +with weave.thread() as t: + print(f"Thread ID: {t.thread_id}") + result = my_function("input") # This call will have the auto-generated thread_id + print(f"Current turn: {t.turn_id}") + +# Explicit thread_id +with weave.thread("custom_thread") as t: + result = my_function("input") # This call will have thread_id="custom_thread" + +# Disable threading +with weave.thread(None) as t: + result = my_function("input") # This call will have thread_id=None +``` + +Args: + thread_id: The thread identifier to associate with calls in this context. + If not provided, a UUID v7 will be auto-generated. + If None, thread tracking will be disabled. + +Yields: + ThreadContext: An object providing access to thread_id and current turn_id. + +### `wandb_init_hook() -> None` + +No description available. + +## Classes + +### Agent + +Base class for Weave objects that can be tracked and versioned. + +This class extends Pydantic's BaseModel to provide Weave-specific functionality +for object tracking, referencing, and serialization. Objects can have names, +descriptions, and references that allow them to be stored and retrieved from +the Weave system. + +Attributes: + name (Optional[str]): A human-readable name for the object. + description (Optional[str]): A description of what the object represents. + ref (Optional[ObjectRef]): A reference to the object in the Weave system. + +Examples: + ```python + # Create a simple object + obj = Object(name="my_object", description="A test object") + + # Create an object from a URI + obj = Object.from_uri("weave:///entity/project/object:digest") + ``` + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `from_uri(uri: str, *, objectify: bool = True) -> typing_extensions.Self` + +Create an object instance from a Weave URI. + +Args: + uri (str): The Weave URI pointing to the object. + objectify (bool): Whether to objectify the result. Defaults to True. + +Returns: + Self: An instance of the class created from the URI. + +Raises: + NotImplementedError: If the class doesn't implement the required + methods for deserialization. + +Examples: + ```python + obj = MyObject.from_uri("weave:///entity/project/object:digest") + ``` + +##### `handle_relocatable_object(v: Any, handler: pydantic_core.core_schema.ValidatorFunctionWrapHandler, info: pydantic_core.core_schema.ValidationInfo) -> Any` + +Handle validation of relocatable objects including ObjectRef and WeaveObject. + +This validator handles special cases where the input is an ObjectRef or +WeaveObject that needs to be properly converted to a standard Object instance. +It ensures that references are preserved and that ignored types are handled +correctly during the validation process. + +Args: + v (Any): The value to validate. + handler (ValidatorFunctionWrapHandler): The standard pydantic validation handler. + info (ValidationInfo): Validation context information. + +Returns: + Any: The validated object instance. + +Examples: + This method is called automatically during object creation and validation. + It handles cases like: + ```python + # When an ObjectRef is passed + obj = MyObject(some_object_ref) + + # When a WeaveObject is passed + obj = MyObject(some_weave_object) + ``` + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `step(self, state: weave.agent.agent.AgentState) -> weave.agent.agent.AgentState` + +Run a step of the agent. + +Args: + state: The current state of the environment. + action: The action to take. + +Returns: + The new state of the environment. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### AgentState + +Base class for Weave objects that can be tracked and versioned. + +This class extends Pydantic's BaseModel to provide Weave-specific functionality +for object tracking, referencing, and serialization. Objects can have names, +descriptions, and references that allow them to be stored and retrieved from +the Weave system. + +Attributes: + name (Optional[str]): A human-readable name for the object. + description (Optional[str]): A description of what the object represents. + ref (Optional[ObjectRef]): A reference to the object in the Weave system. + +Examples: + ```python + # Create a simple object + obj = Object(name="my_object", description="A test object") + + # Create an object from a URI + obj = Object.from_uri("weave:///entity/project/object:digest") + ``` + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `from_uri(uri: str, *, objectify: bool = True) -> typing_extensions.Self` + +Create an object instance from a Weave URI. + +Args: + uri (str): The Weave URI pointing to the object. + objectify (bool): Whether to objectify the result. Defaults to True. + +Returns: + Self: An instance of the class created from the URI. + +Raises: + NotImplementedError: If the class doesn't implement the required + methods for deserialization. + +Examples: + ```python + obj = MyObject.from_uri("weave:///entity/project/object:digest") + ``` + +##### `handle_relocatable_object(v: Any, handler: pydantic_core.core_schema.ValidatorFunctionWrapHandler, info: pydantic_core.core_schema.ValidationInfo) -> Any` + +Handle validation of relocatable objects including ObjectRef and WeaveObject. + +This validator handles special cases where the input is an ObjectRef or +WeaveObject that needs to be properly converted to a standard Object instance. +It ensures that references are preserved and that ignored types are handled +correctly during the validation process. + +Args: + v (Any): The value to validate. + handler (ValidatorFunctionWrapHandler): The standard pydantic validation handler. + info (ValidationInfo): Validation context information. + +Returns: + Any: The validated object instance. + +Examples: + This method is called automatically during object creation and validation. + It handles cases like: + ```python + # When an ObjectRef is passed + obj = MyObject(some_object_ref) + + # When a WeaveObject is passed + obj = MyObject(some_weave_object) + ``` + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### AnnotationSpec + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `preprocess_field_schema(data: dict) -> dict` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +##### `validate_field_schema(schema: dict) -> dict` + +No description available. + +##### `value_is_valid(self, payload: Any) -> bool` + +Validates a payload against this annotation spec's schema. + +Args: + payload: The data to validate against the schema + +Returns: + bool: True if validation succeeds, False otherwise + +### Audio + +A class representing audio data in a supported format (wav or mp3). + +This class handles audio data storage and provides methods for loading from +different sources and exporting to files. + +Attributes: + format: The audio format (currently supports 'wav' or 'mp3') + data: The raw audio data as bytes + +Args: + data: The audio data (bytes or base64 encoded string) + format: The audio format ('wav' or 'mp3') + validate_base64: Whether to attempt base64 decoding of the input data + +Raises: + ValueError: If audio data is empty or format is not supported + +#### Methods + +##### `__init__(self, data: 'bytes', format: 'SUPPORTED_FORMATS_TYPE', validate_base64: 'bool' = True) -> 'None'` + +Initialize self. See help(type(self)) for accurate signature. + +##### `export(self, path: 'str | bytes | Path | os.PathLike') -> 'None'` + +Export audio data to a file. + +Args: + path: Path where the audio file should be written + +##### `from_data(data: 'str | bytes', format: 'str') -> 'Audio'` + +Create an Audio object from raw data and specified format. + +Args: + data: Audio data as bytes or base64 encoded string + format: Audio format ('wav' or 'mp3') + +Returns: + Audio: A new Audio instance + +Raises: + ValueError: If format is not supported + +##### `from_path(path: 'str | bytes | Path | os.PathLike') -> 'Audio'` + +Create an Audio object from a file path. + +Args: + path: Path to an audio file (must have .wav or .mp3 extension) + +Returns: + Audio: A new Audio instance loaded from the file + +Raises: + ValueError: If file doesn't exist or has unsupported extension + +### Content + +A class to represent content from various sources, resolving them +to a unified byte-oriented representation with associated metadata. + +This class must be instantiated using one of its classmethods: +- from_path() +- from_bytes() +- from_text() +- from_url() +- from_base64() +- from_data_url() + +#### Methods + +##### `__init__(self, *args: 'Any', **kwargs: 'Any') -> 'None'` + +Direct initialization is disabled. +Please use a classmethod like `Content.from_path()` to create an instance. + +##### `as_string(self) -> 'str'` + +Display the data as a string. Bytes are decoded using the `encoding` attribute +If base64, the data will be re-encoded to base64 bytes then decoded to an ASCII string +Returns: + str. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_base64(b64_data: 'str | bytes', /, extension: 'str | None' = None, mimetype: 'str | None' = None, metadata: 'dict[str, Any] | None' = None) -> 'Self'` + +Initializes Content from a base64 encoded string or bytes. + +##### `from_bytes(data: 'bytes', /, extension: 'str | None' = None, mimetype: 'str | None' = None, metadata: 'dict[str, Any] | None' = None, encoding: 'str' = 'utf-8') -> 'Self'` + +Initializes Content from raw bytes. + +##### `from_data_url(url: 'str', /, metadata: 'dict[str, Any] | None' = None) -> 'Self'` + +Initializes Content from a data URL. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `from_path(path: 'str | Path', /, encoding: 'str' = 'utf-8', mimetype: 'str | None' = None, metadata: 'dict[str, Any] | None' = None) -> 'Self'` + +Initializes Content from a local file path. + +##### `from_text(text: 'str', /, extension: 'str | None' = None, mimetype: 'str | None' = None, metadata: 'dict[str, Any] | None' = None, encoding: 'str' = 'utf-8') -> 'Self'` + +Initializes Content from a string of text. + +##### `from_url(url: 'str', /, headers: 'dict[str, Any] | None' = None, timeout: 'int | None' = 30, metadata: 'dict[str, Any] | None' = None) -> 'Self'` + +Initializes Content by fetching bytes from an HTTP(S) URL. + +Downloads the content, infers mimetype/extension from headers, URL path, +and data, and constructs a Content object from the resulting bytes. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `init_private_attributes(self: 'BaseModel', context: 'Any', /) -> 'None'` + +This function is meant to behave like a BaseModel method to initialise private attributes. + +It takes context as an argument since that's what pydantic-core passes when calling it. + +Args: + self: The BaseModel instance. + context: The context. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'dict[str, Any] | None' = None) -> 'Self'` + +Override model_validate to handle Content reconstruction from dict. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'dict[str, Any] | None' = None) -> 'Self'` + +Override model_validate_json to handle Content reconstruction from JSON. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `open(self) -> 'bool'` + +Open the file using the operating system's default application. + +This method uses the platform-specific mechanism to open the file with +the default application associated with the file's type. + +Returns: + bool: True if the file was successfully opened, False otherwise. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `save(self, dest: 'str | Path') -> 'None'` + +Copy the file to the specified destination path. +Updates the filename and the path of the content to reflect the last saved copy. + +Args: + dest: Destination path where the file will be copied to (string or pathlib.Path) + The destination path can be a file or a directory. + If dest has no file extension (e.g. .txt), destination will be considered a directory. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `serialize_data(self, data: 'bytes') -> 'str'` + +When dumping model in json mode + +##### `to_data_url(self, use_base64: 'bool' = True) -> 'str'` + +Constructs a data URL from the content. + +Args: + use_base64: If True, the data will be base64 encoded. + Otherwise, it will be percent-encoded. Defaults to True. + +Returns: + A data URL string. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### Dataset + +Dataset object with easy saving and automatic versioning. + +Examples: +```python +# Create a dataset +dataset = Dataset(name='grammar', rows=[ + {'id': '0', 'sentence': "He no likes ice cream.", 'correction': "He doesn't like ice cream."}, + {'id': '1', 'sentence': "She goed to the store.", 'correction': "She went to the store."}, + {'id': '2', 'sentence': "They plays video games all day.", 'correction': "They play video games all day."} +]) + +# Publish the dataset +weave.publish(dataset) + +# Retrieve the dataset +dataset_ref = weave.ref('grammar').get() + +# Access a specific example +example_label = dataset_ref.rows[2]['sentence'] +``` + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `add_rows(self, rows: collections.abc.Iterable) -> 'Dataset'` + +Create a new dataset version by appending rows to the existing dataset. + +This is useful for adding examples to large datasets without having to +load the entire dataset into memory. + +Args: + rows: The rows to add to the dataset. + +Returns: + The updated dataset. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `convert_to_table(rows: Any) -> Union[weave.trace.table.Table, weave.trace.vals.WeaveTable]` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_calls(calls: collections.abc.Iterable) -> typing_extensions.Self` + +No description available. + +##### `from_hf(hf_dataset: Union[ForwardRef('HFDataset'), ForwardRef('HFDatasetDict')]) -> typing_extensions.Self` + +No description available. + +##### `from_obj(obj: weave.trace.vals.WeaveObject) -> typing_extensions.Self` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `from_pandas(df: 'pd.DataFrame') -> typing_extensions.Self` + +No description available. + +##### `from_uri(uri: str, *, objectify: bool = True) -> typing_extensions.Self` + +Create an object instance from a Weave URI. + +Args: + uri (str): The Weave URI pointing to the object. + objectify (bool): Whether to objectify the result. Defaults to True. + +Returns: + Self: An instance of the class created from the URI. + +Raises: + NotImplementedError: If the class doesn't implement the required + methods for deserialization. + +Examples: + ```python + obj = MyObject.from_uri("weave:///entity/project/object:digest") + ``` + +##### `handle_relocatable_object(v: Any, handler: pydantic_core.core_schema.ValidatorFunctionWrapHandler, info: pydantic_core.core_schema.ValidationInfo) -> Any` + +Handle validation of relocatable objects including ObjectRef and WeaveObject. + +This validator handles special cases where the input is an ObjectRef or +WeaveObject that needs to be properly converted to a standard Object instance. +It ensures that references are preserved and that ignored types are handled +correctly during the validation process. + +Args: + v (Any): The value to validate. + handler (ValidatorFunctionWrapHandler): The standard pydantic validation handler. + info (ValidationInfo): Validation context information. + +Returns: + Any: The validated object instance. + +Examples: + This method is called automatically during object creation and validation. + It handles cases like: + ```python + # When an ObjectRef is passed + obj = MyObject(some_object_ref) + + # When a WeaveObject is passed + obj = MyObject(some_weave_object) + ``` + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `select(self, indices: collections.abc.Iterable) -> typing_extensions.Self` + +Select rows from the dataset based on the provided indices. + +Args: + indices: An iterable of integer indices specifying which rows to select. + +Returns: + A new Dataset object containing only the selected rows. + +##### `to_hf(self) -> 'HFDataset'` + +No description available. + +##### `to_pandas(self) -> 'pd.DataFrame'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### EasyPrompt + +A more or less complete user-defined wrapper around list objects. + +#### Methods + +##### `__init__(self, content: Union[str, dict, list, NoneType] = None, *, role: Optional[str] = None, dedent: bool = False, **kwargs: Any) -> None` + +Initialize self. See help(type(self)) for accurate signature. + +##### `append(self, item: Any, role: Optional[str] = None, dedent: bool = False) -> None` + +S.append(value) -- append value to the end of the sequence + +##### `as_dict(self) -> dict` + +No description available. + +##### `as_pydantic_dict(self) -> dict` + +No description available. + +##### `bind(self, *args: Any, **kwargs: Any) -> 'Prompt'` + +No description available. + +##### `bind_rows(self, dataset: Union[list[dict], Any]) -> list` + +No description available. + +##### `clear(self)` + +S.clear() -> None -- remove all items from S + +##### `config_table(self, title: Optional[str] = None) -> weave.trace.display.display.Table` + +No description available. + +##### `configure(self, config: Optional[dict] = None, **kwargs: Any) -> 'Prompt'` + +No description available. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self)` + +No description available. + +##### `count(self, item)` + +S.count(value) -> integer -- return number of occurrences of value + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `dump(self, fp: ) -> None` + +No description available. + +##### `dump_file(self, filepath: Union[str, pathlib.Path]) -> None` + +No description available. + +##### `extend(self, other)` + +S.extend(iterable) -- extend sequence by appending elements from the iterable + +##### `format(self, **kwargs: Any) -> Any` + +No description available. + +##### `from_obj(obj: weave.trace.vals.WeaveObject) -> typing_extensions.Self` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `from_uri(uri: str, *, objectify: bool = True) -> typing_extensions.Self` + +Create an object instance from a Weave URI. + +Args: + uri (str): The Weave URI pointing to the object. + objectify (bool): Whether to objectify the result. Defaults to True. + +Returns: + Self: An instance of the class created from the URI. + +Raises: + NotImplementedError: If the class doesn't implement the required + methods for deserialization. + +Examples: + ```python + obj = MyObject.from_uri("weave:///entity/project/object:digest") + ``` + +##### `handle_relocatable_object(v: Any, handler: pydantic_core.core_schema.ValidatorFunctionWrapHandler, info: pydantic_core.core_schema.ValidationInfo) -> Any` + +Handle validation of relocatable objects including ObjectRef and WeaveObject. + +This validator handles special cases where the input is an ObjectRef or +WeaveObject that needs to be properly converted to a standard Object instance. +It ensures that references are preserved and that ignored types are handled +correctly during the validation process. + +Args: + v (Any): The value to validate. + handler (ValidatorFunctionWrapHandler): The standard pydantic validation handler. + info (ValidationInfo): Validation context information. + +Returns: + Any: The validated object instance. + +Examples: + This method is called automatically during object creation and validation. + It handles cases like: + ```python + # When an ObjectRef is passed + obj = MyObject(some_object_ref) + + # When a WeaveObject is passed + obj = MyObject(some_weave_object) + ``` + +##### `index(self, item, *args)` + +S.index(value, [start, [stop]]) -> integer -- return first index of value. +Raises ValueError if the value is not present. + +Supporting start and stop arguments is optional, but +recommended. + +##### `insert(self, i, item)` + +S.insert(index, value) -- insert value before index + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `load(fp: ) -> typing_extensions.Self` + +No description available. + +##### `load_file(filepath: Union[str, pathlib.Path]) -> typing_extensions.Self` + +No description available. + +##### `messages_table(self, title: Optional[str] = None) -> weave.trace.display.display.Table` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `init_private_attributes(self: 'BaseModel', context: 'Any', /) -> 'None'` + +This function is meant to behave like a BaseModel method to initialise private attributes. + +It takes context as an argument since that's what pydantic-core passes when calling it. + +Args: + self: The BaseModel instance. + context: The context. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `pop(self, i=-1)` + +S.pop([index]) -> item -- remove and return item at index (default last). +Raise IndexError if list is empty or index is out of range. + +##### `print(self) -> str` + +No description available. + +##### `publish(self, name: Optional[str] = None) -> weave.trace.refs.ObjectRef` + +No description available. + +##### `remove(self, item)` + +S.remove(value) -- remove first occurrence of value. +Raise ValueError if the value is not present. + +##### `require(self, param_name: str, **kwargs: Any) -> 'Prompt'` + +No description available. + +##### `reverse(self)` + +S.reverse() -- reverse *IN PLACE* + +##### `run(self) -> Any` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `sort(self, /, *args, **kwds)` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +##### `validate_requirement(self, key: str, value: Any) -> list` + +No description available. + +##### `validate_requirements(self, values: dict) -> list` + +No description available. + +##### `values_table(self, title: Optional[str] = None) -> weave.trace.display.display.Table` + +No description available. + +### Evaluation + +Sets up an evaluation which includes a set of scorers and a dataset. + +Calling evaluation.evaluate(model) will pass in rows from a dataset into a model matching + the names of the columns of the dataset to the argument names in model.predict. + +Then it will call all of the scorers and save the results in weave. + +If you want to preprocess the rows from the dataset you can pass in a function +to preprocess_model_input. + +Examples: +```python +# Collect your examples +examples = [ + {"question": "What is the capital of France?", "expected": "Paris"}, + {"question": "Who wrote 'To Kill a Mockingbird'?", "expected": "Harper Lee"}, + {"question": "What is the square root of 64?", "expected": "8"}, +] + +# Define any custom scoring function +@weave.op() +def match_score1(expected: str, model_output: dict) -> dict: + # Here is where you'd define the logic to score the model output + return {'match': expected == model_output['generated_text']} + +@weave.op() +def function_to_evaluate(question: str): + # here's where you would add your LLM call and return the output + return {'generated_text': 'Paris'} + +# Score your examples using scoring functions +evaluation = Evaluation( + dataset=examples, scorers=[match_score1] +) + +# Start tracking the evaluation +weave.init('intro-example') +# Run the evaluation +asyncio.run(evaluation.evaluate(function_to_evaluate)) +``` + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `evaluate(self, model: Union[weave.trace.op_protocol.Op, weave.flow.model.Model]) -> dict` + +No description available. + +##### `from_obj(obj: weave.trace.vals.WeaveObject) -> typing_extensions.Self` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `from_uri(uri: str, *, objectify: bool = True) -> typing_extensions.Self` + +Create an object instance from a Weave URI. + +Args: + uri (str): The Weave URI pointing to the object. + objectify (bool): Whether to objectify the result. Defaults to True. + +Returns: + Self: An instance of the class created from the URI. + +Raises: + NotImplementedError: If the class doesn't implement the required + methods for deserialization. + +Examples: + ```python + obj = MyObject.from_uri("weave:///entity/project/object:digest") + ``` + +##### `get_eval_results(self, model: Union[weave.trace.op_protocol.Op, weave.flow.model.Model]) -> weave.evaluation.eval.EvaluationResults` + +No description available. + +##### `get_evaluate_calls(self) -> weave.utils.paginated_iterator.PaginatedIterator[weave.trace_server.trace_server_interface.CallSchema, weave.trace.vals.WeaveObject]` + +Retrieve all evaluation calls that used this Evaluation object. + +Note that this returns a CallsIter instead of a single call because it's +possible to have multiple evaluation calls for a single evaluation (e.g. +if you run the same evaluation multiple times). + +Returns: + CallsIter: An iterator over Call objects representing evaluation runs. + +Raises: + ValueError: If the evaluation has no ref (hasn't been saved/run yet). + +Examples: + ```python + evaluation = Evaluation(dataset=examples, scorers=[scorer]) + await evaluation.evaluate(model) # Run evaluation first + calls = evaluation.get_evaluate_calls() + for call in calls: + print(f"Evaluation run: {call.id} at {call.started_at}") + ``` + +##### `get_score_calls(self) -> dict` + +Retrieve scorer calls for each evaluation run, grouped by trace ID. + +Returns: + dict[str, list[Call]]: A dictionary mapping trace IDs to lists of scorer Call objects. + Each trace ID represents one evaluation run, and the list contains all scorer + calls executed during that run. + +Examples: + ```python + evaluation = Evaluation(dataset=examples, scorers=[accuracy_scorer, f1_scorer]) + await evaluation.evaluate(model) + score_calls = evaluation.get_score_calls() + for trace_id, calls in score_calls.items(): + print(f"Trace {trace_id}: {len(calls)} scorer calls") + for call in calls: + scorer_name = call.summary.get("weave", {}).get("trace_name") + print(f" Scorer: {scorer_name}, Output: {call.output}") + ``` + +##### `get_scores(self) -> dict` + +Extract and organize scorer outputs from evaluation runs. + +Returns: + dict[str, dict[str, list[Any]]]: A nested dictionary structure where: + - First level keys are trace IDs (evaluation runs) + - Second level keys are scorer names + - Values are lists of scorer outputs for that run and scorer + +Examples: + ```python + evaluation = Evaluation(dataset=examples, scorers=[accuracy_scorer, f1_scorer]) + await evaluation.evaluate(model) + scores = evaluation.get_scores() + # Access scores by trace and scorer + for trace_id, trace_scores in scores.items(): + print(f"Evaluation run {trace_id}:") + for scorer_name, outputs in trace_scores.items(): + print(f" {scorer_name}: {outputs}") + ``` + + Expected output: + + ``` + { + "trace_123": { + "accuracy_scorer": [{"accuracy": 0.85}], + "f1_scorer": [{"f1": 0.78}] + } + } + ``` + +##### `handle_relocatable_object(v: Any, handler: pydantic_core.core_schema.ValidatorFunctionWrapHandler, info: pydantic_core.core_schema.ValidationInfo) -> Any` + +Handle validation of relocatable objects including ObjectRef and WeaveObject. + +This validator handles special cases where the input is an ObjectRef or +WeaveObject that needs to be properly converted to a standard Object instance. +It ensures that references are preserved and that ignored types are handled +correctly during the validation process. + +Args: + v (Any): The value to validate. + handler (ValidatorFunctionWrapHandler): The standard pydantic validation handler. + info (ValidationInfo): Validation context information. + +Returns: + Any: The validated object instance. + +Examples: + This method is called automatically during object creation and validation. + It handles cases like: + ```python + # When an ObjectRef is passed + obj = MyObject(some_object_ref) + + # When a WeaveObject is passed + obj = MyObject(some_weave_object) + ``` + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, _Evaluation__context: Any) -> None` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `predict_and_score(self, model: Union[weave.trace.op_protocol.Op, weave.flow.model.Model], example: dict) -> dict` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `summarize(self, eval_table: weave.evaluation.eval.EvaluationResults) -> dict` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### EvaluationLogger + +This class provides an imperative interface for logging evaluations. + +An evaluation is started automatically when the first prediction is logged +using the `log_prediction` method, and finished when the `log_summary` method +is called. + +Each time you log a prediction, you will get back a `ScoreLogger` object. +You can use this object to log scores and metadata for that specific +prediction. For more information, see the `ScoreLogger` class. + +Basic usage - log predictions with inputs and outputs directly: + +```python +ev = EvaluationLogger() + +# Log predictions with known inputs/outputs +pred = ev.log_prediction(inputs={'q': 'Hello'}, outputs={'a': 'Hi there!'}) +pred.log_score("correctness", 0.9) + +# Finish the evaluation +ev.log_summary({"avg_score": 0.9}) +``` + +Advanced usage - use context manager for dynamic outputs and nested operations: + +```python +ev = EvaluationLogger() + +# Use context manager when you need to capture nested operations +with ev.log_prediction(inputs={'q': 'Hello'}) as pred: + # Any operations here (like LLM calls) automatically become + # children of the predict call + response = your_llm_call(...) + pred.output = response.content + pred.log_score("correctness", 0.9) + +# Finish the evaluation +ev.log_summary({"avg_score": 0.9}) +``` + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `fail(self, exception: 'BaseException') -> 'None'` + +Convenience method to fail the evaluation with an exception. + +##### `finish(self, exception: 'BaseException | None' = None) -> 'None'` + +Clean up the evaluation resources explicitly without logging a summary. + +Ensures all prediction calls and the main evaluation call are finalized. +This is automatically called if the logger is used as a context manager. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `log_prediction(self, inputs: 'dict[str, Any]', output: 'Any | _NotSetType' = ) -> 'ScoreLogger | _LogPredictionContext'` + +Log a prediction to the Evaluation. + +If output is provided, returns a ScoreLogger for direct use. +If output is not provided, returns a PredictionContext for use as a context manager. + +Args: + inputs: The input data for the prediction + output: The output value. If not provided, use as context manager to set later. + +Returns: + ScoreLogger if output provided, PredictionContext if not. + +Example (direct): + pred = ev.log_prediction(\{'q': '...'\}, output="answer") + pred.log_score("correctness", 0.9) + pred.finish() + +Example (context manager): + with ev.log_prediction(\{'q': '...'\}) as pred: + response = model(...) + pred.output = response + pred.log_score("correctness", 0.9) + +##### `log_summary(self, summary: 'dict | None' = None, auto_summarize: 'bool' = True) -> 'None'` + +Log a summary dict to the Evaluation. + +This will calculate the summary, call the summarize op, and then finalize +the evaluation, meaning no more predictions or scores can be logged. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, _EvaluationLogger__context: 'Any') -> 'None'` + +Initialize the pseudo evaluation with the dataset from the model. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `set_view(self, name: 'str', content: 'Content | str', *, extension: 'str | None' = None, mimetype: 'str | None' = None, metadata: 'dict[str, Any] | None' = None, encoding: 'str' = 'utf-8') -> 'None'` + +Attach a view to the evaluation's main call summary under `weave.views`. + +Saves the provided content as an object in the project and writes its +reference URI under `summary.weave.views.` for the evaluation's +`evaluate` call. String inputs are wrapped as text content using +`Content.from_text` with the provided extension or mimetype. + +Args: + name: The view name to display, used as the key under `summary.weave.views`. + content: A `weave.Content` instance or string to serialize. + extension: Optional file extension for string content inputs. + mimetype: Optional MIME type for string content inputs. + metadata: Optional metadata attached to newly created `Content`. + encoding: Text encoding for string content inputs. + +Returns: + None + +Examples: + >>> import weave + >>> ev = weave.EvaluationLogger() + >>> ev.set_view("report", "# Report", extension="md") + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### File + +A class representing a file with path, mimetype, and size information. + +#### Methods + +##### `__init__(self, path: 'str | Path', mimetype: 'str | None' = None)` + +Initialize a File object. + +Args: + path: Path to the file (string or pathlib.Path) + mimetype: Optional MIME type of the file - will be inferred from extension if not provided + +##### `open(self) -> 'bool'` + +Open the file using the operating system's default application. + +This method uses the platform-specific mechanism to open the file with +the default application associated with the file's type. + +Returns: + bool: True if the file was successfully opened, False otherwise. + +##### `save(self, dest: 'str | Path') -> 'None'` + +Copy the file to the specified destination path. + +Args: + dest: Destination path where the file will be copied to (string or pathlib.Path) + The destination path can be a file or a directory. + +### Markdown + +A Markdown renderable. + +Args: + markup (str): A string containing markdown. + code_theme (str, optional): Pygments theme for code blocks. Defaults to "monokai". See https://pygments.org/styles/ for code themes. + justify (JustifyMethod, optional): Justify value for paragraphs. Defaults to None. + style (Union[str, Style], optional): Optional style to apply to markdown. + hyperlinks (bool, optional): Enable hyperlinks. Defaults to ``True``. + inline_code_lexer: (str, optional): Lexer to use if inline code highlighting is + enabled. Defaults to None. + inline_code_theme: (Optional[str], optional): Pygments theme for inline code + highlighting, or None for no highlighting. Defaults to None. + +#### Methods + +##### `__init__(self, markup: 'str', code_theme: 'str' = 'monokai', justify: 'JustifyMethod | None' = None, style: 'str | Style' = 'none', hyperlinks: 'bool' = True, inline_code_lexer: 'str | None' = None, inline_code_theme: 'str | None' = None) -> 'None'` + +Initialize self. See help(type(self)) for accurate signature. + +### MessagesPrompt + +Base class for Weave objects that can be tracked and versioned. + +This class extends Pydantic's BaseModel to provide Weave-specific functionality +for object tracking, referencing, and serialization. Objects can have names, +descriptions, and references that allow them to be stored and retrieved from +the Weave system. + +Attributes: + name (Optional[str]): A human-readable name for the object. + description (Optional[str]): A description of what the object represents. + ref (Optional[ObjectRef]): A reference to the object in the Weave system. + +Examples: + ```python + # Create a simple object + obj = Object(name="my_object", description="A test object") + + # Create an object from a URI + obj = Object.from_uri("weave:///entity/project/object:digest") + ``` + +#### Methods + +##### `__init__(self, messages: list)` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `format(self, **kwargs: Any) -> list` + +No description available. + +##### `format_message(self, message: dict, **kwargs: Any) -> dict` + +No description available. + +##### `from_obj(obj: weave.trace.vals.WeaveObject) -> typing_extensions.Self` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `from_uri(uri: str, *, objectify: bool = True) -> typing_extensions.Self` + +Create an object instance from a Weave URI. + +Args: + uri (str): The Weave URI pointing to the object. + objectify (bool): Whether to objectify the result. Defaults to True. + +Returns: + Self: An instance of the class created from the URI. + +Raises: + NotImplementedError: If the class doesn't implement the required + methods for deserialization. + +Examples: + ```python + obj = MyObject.from_uri("weave:///entity/project/object:digest") + ``` + +##### `handle_relocatable_object(v: Any, handler: pydantic_core.core_schema.ValidatorFunctionWrapHandler, info: pydantic_core.core_schema.ValidationInfo) -> Any` + +Handle validation of relocatable objects including ObjectRef and WeaveObject. + +This validator handles special cases where the input is an ObjectRef or +WeaveObject that needs to be properly converted to a standard Object instance. +It ensures that references are preserved and that ignored types are handled +correctly during the validation process. + +Args: + v (Any): The value to validate. + handler (ValidatorFunctionWrapHandler): The standard pydantic validation handler. + info (ValidationInfo): Validation context information. + +Returns: + Any: The validated object instance. + +Examples: + This method is called automatically during object creation and validation. + It handles cases like: + ```python + # When an ObjectRef is passed + obj = MyObject(some_object_ref) + + # When a WeaveObject is passed + obj = MyObject(some_weave_object) + ``` + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### Model + +Intended to capture a combination of code and data the operates on an input. +For example it might call an LLM with a prompt to make a prediction or generate +text. + +When you change the attributes or the code that defines your model, these changes +will be logged and the version will be updated. This ensures that you can compare +the predictions across different versions of your model. Use this to iterate on +prompts or to try the latest LLM and compare predictions across different settings + +Examples: +```python +class YourModel(Model): + attribute1: str + attribute2: int + + @weave.op() + def predict(self, input_data: str) -> dict: + # Model logic goes here + prediction = self.attribute1 + ' ' + input_data + return {'pred': prediction} +``` + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `from_uri(uri: str, *, objectify: bool = True) -> typing_extensions.Self` + +Create an object instance from a Weave URI. + +Args: + uri (str): The Weave URI pointing to the object. + objectify (bool): Whether to objectify the result. Defaults to True. + +Returns: + Self: An instance of the class created from the URI. + +Raises: + NotImplementedError: If the class doesn't implement the required + methods for deserialization. + +Examples: + ```python + obj = MyObject.from_uri("weave:///entity/project/object:digest") + ``` + +##### `get_infer_method(self) -> Callable` + +No description available. + +##### `handle_relocatable_object(v: Any, handler: pydantic_core.core_schema.ValidatorFunctionWrapHandler, info: pydantic_core.core_schema.ValidationInfo) -> Any` + +Handle validation of relocatable objects including ObjectRef and WeaveObject. + +This validator handles special cases where the input is an ObjectRef or +WeaveObject that needs to be properly converted to a standard Object instance. +It ensures that references are preserved and that ignored types are handled +correctly during the validation process. + +Args: + v (Any): The value to validate. + handler (ValidatorFunctionWrapHandler): The standard pydantic validation handler. + info (ValidationInfo): Validation context information. + +Returns: + Any: The validated object instance. + +Examples: + This method is called automatically during object creation and validation. + It handles cases like: + ```python + # When an ObjectRef is passed + obj = MyObject(some_object_ref) + + # When a WeaveObject is passed + obj = MyObject(some_weave_object) + ``` + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### Monitor + +Sets up a monitor to score incoming calls automatically. + +Examples: +```python +import weave +from weave.scorers import ValidJSONScorer + +json_scorer = ValidJSONScorer() + +my_monitor = weave.Monitor( + name="my-monitor", + description="This is a test monitor", + sampling_rate=0.5, + op_names=["my_op"], + query={ + "$expr": { + "$gt": [ + { + "$getField": "started_at" + }, + { + "$literal": 1742540400 + } + ] + } + } + }, + scorers=[json_scorer], +) + +my_monitor.activate() +``` + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `activate(self) -> weave.trace.refs.ObjectRef` + +Activates the monitor. + +Returns: + The ref to the monitor. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `deactivate(self) -> weave.trace.refs.ObjectRef` + +Deactivates the monitor. + +Returns: + The ref to the monitor. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_obj(obj: weave.trace.vals.WeaveObject) -> typing_extensions.Self` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `from_uri(uri: str, *, objectify: bool = True) -> typing_extensions.Self` + +Create an object instance from a Weave URI. + +Args: + uri (str): The Weave URI pointing to the object. + objectify (bool): Whether to objectify the result. Defaults to True. + +Returns: + Self: An instance of the class created from the URI. + +Raises: + NotImplementedError: If the class doesn't implement the required + methods for deserialization. + +Examples: + ```python + obj = MyObject.from_uri("weave:///entity/project/object:digest") + ``` + +##### `handle_relocatable_object(v: Any, handler: pydantic_core.core_schema.ValidatorFunctionWrapHandler, info: pydantic_core.core_schema.ValidationInfo) -> Any` + +Handle validation of relocatable objects including ObjectRef and WeaveObject. + +This validator handles special cases where the input is an ObjectRef or +WeaveObject that needs to be properly converted to a standard Object instance. +It ensures that references are preserved and that ignored types are handled +correctly during the validation process. + +Args: + v (Any): The value to validate. + handler (ValidatorFunctionWrapHandler): The standard pydantic validation handler. + info (ValidationInfo): Validation context information. + +Returns: + Any: The validated object instance. + +Examples: + This method is called automatically during object creation and validation. + It handles cases like: + ```python + # When an ObjectRef is passed + obj = MyObject(some_object_ref) + + # When a WeaveObject is passed + obj = MyObject(some_weave_object) + ``` + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### Object + +Base class for Weave objects that can be tracked and versioned. + +This class extends Pydantic's BaseModel to provide Weave-specific functionality +for object tracking, referencing, and serialization. Objects can have names, +descriptions, and references that allow them to be stored and retrieved from +the Weave system. + +Attributes: + name (Optional[str]): A human-readable name for the object. + description (Optional[str]): A description of what the object represents. + ref (Optional[ObjectRef]): A reference to the object in the Weave system. + +Examples: + ```python + # Create a simple object + obj = Object(name="my_object", description="A test object") + + # Create an object from a URI + obj = Object.from_uri("weave:///entity/project/object:digest") + ``` + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `from_uri(uri: str, *, objectify: bool = True) -> typing_extensions.Self` + +Create an object instance from a Weave URI. + +Args: + uri (str): The Weave URI pointing to the object. + objectify (bool): Whether to objectify the result. Defaults to True. + +Returns: + Self: An instance of the class created from the URI. + +Raises: + NotImplementedError: If the class doesn't implement the required + methods for deserialization. + +Examples: + ```python + obj = MyObject.from_uri("weave:///entity/project/object:digest") + ``` + +##### `handle_relocatable_object(v: Any, handler: pydantic_core.core_schema.ValidatorFunctionWrapHandler, info: pydantic_core.core_schema.ValidationInfo) -> Any` + +Handle validation of relocatable objects including ObjectRef and WeaveObject. + +This validator handles special cases where the input is an ObjectRef or +WeaveObject that needs to be properly converted to a standard Object instance. +It ensures that references are preserved and that ignored types are handled +correctly during the validation process. + +Args: + v (Any): The value to validate. + handler (ValidatorFunctionWrapHandler): The standard pydantic validation handler. + info (ValidationInfo): Validation context information. + +Returns: + Any: The validated object instance. + +Examples: + This method is called automatically during object creation and validation. + It handles cases like: + ```python + # When an ObjectRef is passed + obj = MyObject(some_object_ref) + + # When a WeaveObject is passed + obj = MyObject(some_weave_object) + ``` + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### ObjectRef + +ObjectRef(entity: 'str', project: 'str', name: 'str', _digest: 'str | Future[str]', _extra: 'tuple[str | Future[str], ...]' = ()) + +#### Methods + +##### `__init__(self, entity: 'str', project: 'str', name: 'str', _digest: 'str | Future[str]', _extra: 'tuple[str | Future[str], ...]' = ()) -> None` + +No description available. + +##### `as_param_dict(self) -> 'dict'` + +No description available. + +##### `delete(self) -> 'None'` + +No description available. + +##### `get(self, *, objectify: 'bool' = True) -> 'Any'` + +No description available. + +##### `is_descended_from(self, potential_ancestor: 'ObjectRef') -> 'bool'` + +No description available. + +##### `maybe_parse_uri(s: 'str') -> 'AnyRef | None'` + +No description available. + +##### `parse_uri(uri: 'str') -> 'ObjectRef'` + +No description available. + +##### `uri(self) -> 'str'` + +No description available. + +##### `with_attr(self, attr: 'str') -> 'Self'` + +No description available. + +##### `with_extra(self, extra: 'tuple[str | Future[str], ...]') -> 'Self'` + +No description available. + +##### `with_index(self, index: 'int') -> 'Self'` + +No description available. + +##### `with_item(self, item_digest: 'str | Future[str]') -> 'Self'` + +No description available. + +##### `with_key(self, key: 'str') -> 'Self'` + +No description available. + +### P + +A more or less complete user-defined wrapper around list objects. + +#### Methods + +##### `__init__(self, content: Union[str, dict, list, NoneType] = None, *, role: Optional[str] = None, dedent: bool = False, **kwargs: Any) -> None` + +Initialize self. See help(type(self)) for accurate signature. + +##### `append(self, item: Any, role: Optional[str] = None, dedent: bool = False) -> None` + +S.append(value) -- append value to the end of the sequence + +##### `as_dict(self) -> dict` + +No description available. + +##### `as_pydantic_dict(self) -> dict` + +No description available. + +##### `bind(self, *args: Any, **kwargs: Any) -> 'Prompt'` + +No description available. + +##### `bind_rows(self, dataset: Union[list[dict], Any]) -> list` + +No description available. + +##### `clear(self)` + +S.clear() -> None -- remove all items from S + +##### `config_table(self, title: Optional[str] = None) -> weave.trace.display.display.Table` + +No description available. + +##### `configure(self, config: Optional[dict] = None, **kwargs: Any) -> 'Prompt'` + +No description available. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self)` + +No description available. + +##### `count(self, item)` + +S.count(value) -> integer -- return number of occurrences of value + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `dump(self, fp: ) -> None` + +No description available. + +##### `dump_file(self, filepath: Union[str, pathlib.Path]) -> None` + +No description available. + +##### `extend(self, other)` + +S.extend(iterable) -- extend sequence by appending elements from the iterable + +##### `format(self, **kwargs: Any) -> Any` + +No description available. + +##### `from_obj(obj: weave.trace.vals.WeaveObject) -> typing_extensions.Self` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `from_uri(uri: str, *, objectify: bool = True) -> typing_extensions.Self` + +Create an object instance from a Weave URI. + +Args: + uri (str): The Weave URI pointing to the object. + objectify (bool): Whether to objectify the result. Defaults to True. + +Returns: + Self: An instance of the class created from the URI. + +Raises: + NotImplementedError: If the class doesn't implement the required + methods for deserialization. + +Examples: + ```python + obj = MyObject.from_uri("weave:///entity/project/object:digest") + ``` + +##### `handle_relocatable_object(v: Any, handler: pydantic_core.core_schema.ValidatorFunctionWrapHandler, info: pydantic_core.core_schema.ValidationInfo) -> Any` + +Handle validation of relocatable objects including ObjectRef and WeaveObject. + +This validator handles special cases where the input is an ObjectRef or +WeaveObject that needs to be properly converted to a standard Object instance. +It ensures that references are preserved and that ignored types are handled +correctly during the validation process. + +Args: + v (Any): The value to validate. + handler (ValidatorFunctionWrapHandler): The standard pydantic validation handler. + info (ValidationInfo): Validation context information. + +Returns: + Any: The validated object instance. + +Examples: + This method is called automatically during object creation and validation. + It handles cases like: + ```python + # When an ObjectRef is passed + obj = MyObject(some_object_ref) + + # When a WeaveObject is passed + obj = MyObject(some_weave_object) + ``` + +##### `index(self, item, *args)` + +S.index(value, [start, [stop]]) -> integer -- return first index of value. +Raises ValueError if the value is not present. + +Supporting start and stop arguments is optional, but +recommended. + +##### `insert(self, i, item)` + +S.insert(index, value) -- insert value before index + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `load(fp: ) -> typing_extensions.Self` + +No description available. + +##### `load_file(filepath: Union[str, pathlib.Path]) -> typing_extensions.Self` + +No description available. + +##### `messages_table(self, title: Optional[str] = None) -> weave.trace.display.display.Table` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `init_private_attributes(self: 'BaseModel', context: 'Any', /) -> 'None'` + +This function is meant to behave like a BaseModel method to initialise private attributes. + +It takes context as an argument since that's what pydantic-core passes when calling it. + +Args: + self: The BaseModel instance. + context: The context. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `pop(self, i=-1)` + +S.pop([index]) -> item -- remove and return item at index (default last). +Raise IndexError if list is empty or index is out of range. + +##### `print(self) -> str` + +No description available. + +##### `publish(self, name: Optional[str] = None) -> weave.trace.refs.ObjectRef` + +No description available. + +##### `remove(self, item)` + +S.remove(value) -- remove first occurrence of value. +Raise ValueError if the value is not present. + +##### `require(self, param_name: str, **kwargs: Any) -> 'Prompt'` + +No description available. + +##### `reverse(self)` + +S.reverse() -- reverse *IN PLACE* + +##### `run(self) -> Any` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `sort(self, /, *args, **kwds)` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +##### `validate_requirement(self, key: str, value: Any) -> list` + +No description available. + +##### `validate_requirements(self, values: dict) -> list` + +No description available. + +##### `values_table(self, title: Optional[str] = None) -> weave.trace.display.display.Table` + +No description available. + +### Prompt + +Base class for Weave objects that can be tracked and versioned. + +This class extends Pydantic's BaseModel to provide Weave-specific functionality +for object tracking, referencing, and serialization. Objects can have names, +descriptions, and references that allow them to be stored and retrieved from +the Weave system. + +Attributes: + name (Optional[str]): A human-readable name for the object. + description (Optional[str]): A description of what the object represents. + ref (Optional[ObjectRef]): A reference to the object in the Weave system. + +Examples: + ```python + # Create a simple object + obj = Object(name="my_object", description="A test object") + + # Create an object from a URI + obj = Object.from_uri("weave:///entity/project/object:digest") + ``` + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `format(self, **kwargs: Any) -> Any` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `from_uri(uri: str, *, objectify: bool = True) -> typing_extensions.Self` + +Create an object instance from a Weave URI. + +Args: + uri (str): The Weave URI pointing to the object. + objectify (bool): Whether to objectify the result. Defaults to True. + +Returns: + Self: An instance of the class created from the URI. + +Raises: + NotImplementedError: If the class doesn't implement the required + methods for deserialization. + +Examples: + ```python + obj = MyObject.from_uri("weave:///entity/project/object:digest") + ``` + +##### `handle_relocatable_object(v: Any, handler: pydantic_core.core_schema.ValidatorFunctionWrapHandler, info: pydantic_core.core_schema.ValidationInfo) -> Any` + +Handle validation of relocatable objects including ObjectRef and WeaveObject. + +This validator handles special cases where the input is an ObjectRef or +WeaveObject that needs to be properly converted to a standard Object instance. +It ensures that references are preserved and that ignored types are handled +correctly during the validation process. + +Args: + v (Any): The value to validate. + handler (ValidatorFunctionWrapHandler): The standard pydantic validation handler. + info (ValidationInfo): Validation context information. + +Returns: + Any: The validated object instance. + +Examples: + This method is called automatically during object creation and validation. + It handles cases like: + ```python + # When an ObjectRef is passed + obj = MyObject(some_object_ref) + + # When a WeaveObject is passed + obj = MyObject(some_weave_object) + ``` + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### SavedView + +A fluent-style class for working with SavedView objects. + +#### Methods + +##### `__init__(self, view_type: 'str' = 'traces', label: 'str' = 'SavedView') -> 'None'` + +Initialize self. See help(type(self)) for accurate signature. + +##### `add_column(self, path: 'str | ObjectPath', label: 'str | None' = None) -> 'SavedView'` + +No description available. + +##### `add_columns(self, *columns: 'str') -> 'SavedView'` + +Convenience method for adding multiple columns to the grid. + +##### `add_filter(self, field: 'str', operator: 'str', value: 'Any | None' = None) -> 'SavedView'` + +No description available. + +##### `add_sort(self, field: 'str', direction: 'SortDirection') -> 'SavedView'` + +No description available. + +##### `column_index(self, path: 'int | str | ObjectPath') -> 'int'` + +No description available. + +##### `filter_op(self, op_name: 'str | None') -> 'SavedView'` + +No description available. + +##### `get_calls(self, limit: 'int | None' = None, offset: 'int | None' = None, include_costs: 'bool' = False, include_feedback: 'bool' = False, all_columns: 'bool' = False) -> 'CallsIter'` + +Get calls matching this saved view's filters and settings. + +##### `get_known_columns(self, *, num_calls_to_query: 'int | None' = None) -> 'list[str]'` + +Get the set of columns that are known to exist. + +##### `get_table_columns(self) -> 'list[TableColumn]'` + +No description available. + +##### `hide_column(self, col_name: 'str') -> 'SavedView'` + +No description available. + +##### `insert_column(self, idx: 'int', path: 'str | ObjectPath', label: 'str | None' = None) -> 'SavedView'` + +No description available. + +##### `load(ref: 'str') -> 'SavedView'` + +No description available. + +##### `page_size(self, page_size: 'int') -> 'SavedView'` + +No description available. + +##### `pin_column_left(self, col_name: 'str') -> 'SavedView'` + +No description available. + +##### `pin_column_right(self, col_name: 'str') -> 'SavedView'` + +No description available. + +##### `remove_column(self, path: 'int | str | ObjectPath') -> 'SavedView'` + +No description available. + +##### `remove_columns(self, *columns: 'str') -> 'SavedView'` + +Remove columns from the saved view. + +##### `remove_filter(self, index_or_field: 'int | str') -> 'SavedView'` + +No description available. + +##### `remove_filters(self) -> 'SavedView'` + +Remove all filters from the saved view. + +##### `rename(self, label: 'str') -> 'SavedView'` + +No description available. + +##### `rename_column(self, path: 'int | str | ObjectPath', label: 'str') -> 'SavedView'` + +No description available. + +##### `save(self) -> 'SavedView'` + +Publish the saved view to the server. + +##### `set_columns(self, *columns: 'str') -> 'SavedView'` + +Set the columns to be displayed in the grid. + +##### `show_column(self, col_name: 'str') -> 'SavedView'` + +No description available. + +##### `sort_by(self, field: 'str', direction: 'SortDirection') -> 'SavedView'` + +No description available. + +##### `to_grid(self, limit: 'int | None' = None) -> 'Grid'` + +No description available. + +##### `to_rich_table_str(self) -> 'str'` + +No description available. + +##### `ui_url(self) -> 'str | None'` + +URL to show this saved view in the UI. + +Note this is the "result" page with traces etc, not the URL for the view object. + +##### `unpin_column(self, col_name: 'str') -> 'SavedView'` + +No description available. + +### Scorer + +Base class for Weave objects that can be tracked and versioned. + +This class extends Pydantic's BaseModel to provide Weave-specific functionality +for object tracking, referencing, and serialization. Objects can have names, +descriptions, and references that allow them to be stored and retrieved from +the Weave system. + +Attributes: + name (Optional[str]): A human-readable name for the object. + description (Optional[str]): A description of what the object represents. + ref (Optional[ObjectRef]): A reference to the object in the Weave system. + +Examples: + ```python + # Create a simple object + obj = Object(name="my_object", description="A test object") + + # Create an object from a URI + obj = Object.from_uri("weave:///entity/project/object:digest") + ``` + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_obj(obj: weave.trace.vals.WeaveObject) -> typing_extensions.Self` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `from_uri(uri: str, *, objectify: bool = True) -> typing_extensions.Self` + +Create an object instance from a Weave URI. + +Args: + uri (str): The Weave URI pointing to the object. + objectify (bool): Whether to objectify the result. Defaults to True. + +Returns: + Self: An instance of the class created from the URI. + +Raises: + NotImplementedError: If the class doesn't implement the required + methods for deserialization. + +Examples: + ```python + obj = MyObject.from_uri("weave:///entity/project/object:digest") + ``` + +##### `handle_relocatable_object(v: Any, handler: pydantic_core.core_schema.ValidatorFunctionWrapHandler, info: pydantic_core.core_schema.ValidationInfo) -> Any` + +Handle validation of relocatable objects including ObjectRef and WeaveObject. + +This validator handles special cases where the input is an ObjectRef or +WeaveObject that needs to be properly converted to a standard Object instance. +It ensures that references are preserved and that ignored types are handled +correctly during the validation process. + +Args: + v (Any): The value to validate. + handler (ValidatorFunctionWrapHandler): The standard pydantic validation handler. + info (ValidationInfo): Validation context information. + +Returns: + Any: The validated object instance. + +Examples: + This method is called automatically during object creation and validation. + It handles cases like: + ```python + # When an ObjectRef is passed + obj = MyObject(some_object_ref) + + # When a WeaveObject is passed + obj = MyObject(some_weave_object) + ``` + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, _Scorer__context: Any) -> None` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `score(self, *, output: Any, **kwargs: Any) -> Any` + +No description available. + +##### `summarize(self, score_rows: list) -> Optional[dict]` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### StringPrompt + +Base class for Weave objects that can be tracked and versioned. + +This class extends Pydantic's BaseModel to provide Weave-specific functionality +for object tracking, referencing, and serialization. Objects can have names, +descriptions, and references that allow them to be stored and retrieved from +the Weave system. + +Attributes: + name (Optional[str]): A human-readable name for the object. + description (Optional[str]): A description of what the object represents. + ref (Optional[ObjectRef]): A reference to the object in the Weave system. + +Examples: + ```python + # Create a simple object + obj = Object(name="my_object", description="A test object") + + # Create an object from a URI + obj = Object.from_uri("weave:///entity/project/object:digest") + ``` + +#### Methods + +##### `__init__(self, content: str)` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `format(self, **kwargs: Any) -> str` + +No description available. + +##### `from_obj(obj: weave.trace.vals.WeaveObject) -> typing_extensions.Self` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `from_uri(uri: str, *, objectify: bool = True) -> typing_extensions.Self` + +Create an object instance from a Weave URI. + +Args: + uri (str): The Weave URI pointing to the object. + objectify (bool): Whether to objectify the result. Defaults to True. + +Returns: + Self: An instance of the class created from the URI. + +Raises: + NotImplementedError: If the class doesn't implement the required + methods for deserialization. + +Examples: + ```python + obj = MyObject.from_uri("weave:///entity/project/object:digest") + ``` + +##### `handle_relocatable_object(v: Any, handler: pydantic_core.core_schema.ValidatorFunctionWrapHandler, info: pydantic_core.core_schema.ValidationInfo) -> Any` + +Handle validation of relocatable objects including ObjectRef and WeaveObject. + +This validator handles special cases where the input is an ObjectRef or +WeaveObject that needs to be properly converted to a standard Object instance. +It ensures that references are preserved and that ignored types are handled +correctly during the validation process. + +Args: + v (Any): The value to validate. + handler (ValidatorFunctionWrapHandler): The standard pydantic validation handler. + info (ValidationInfo): Validation context information. + +Returns: + Any: The validated object instance. + +Examples: + This method is called automatically during object creation and validation. + It handles cases like: + ```python + # When an ObjectRef is passed + obj = MyObject(some_object_ref) + + # When a WeaveObject is passed + obj = MyObject(some_weave_object) + ``` + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### Table + +No description available. + +#### Methods + +##### `__init__(self, rows: 'list[dict]') -> 'None'` + +Initialize self. See help(type(self)) for accurate signature. + +##### `append(self, row: 'dict') -> 'None'` + +Add a row to the table. + +##### `pop(self, index: 'int') -> 'None'` + +Remove a row at the given index from the table. + +### Thread + +A Thread that runs functions with the context of the caller. + +This is a drop-in replacement for threading.Thread that ensures calls behave +as expected inside the thread. Weave requires certain contextvars to be set +(see call_context.py), but new threads do not automatically copy context from +the parent, which can cause the call context to be lost -- not good! This +class automates contextvar copying so using this thread "just works" as the +user probably expects. + +You can achieve the same effect without this class by instead writing: + +```python +def run_with_context(func, *args, **kwargs): + context = copy_context() + def wrapper(): + context.run(func, *args, **kwargs) + return wrapper + +thread = threading.Thread(target=run_with_context(your_func, *args, **kwargs)) +thread.start() +``` + +#### Methods + +##### `__init__(self, *args: 'Any', **kwargs: 'Any') -> 'None'` + +This constructor should always be called with keyword arguments. Arguments are: + +*group* should be None; reserved for future extension when a ThreadGroup +class is implemented. + +*target* is the callable object to be invoked by the run() +method. Defaults to None, meaning nothing is called. + +*name* is the thread name. By default, a unique name is constructed of +the form "Thread-N" where N is a small decimal number. + +*args* is the argument tuple for the target invocation. Defaults to (). + +*kwargs* is a dictionary of keyword arguments for the target +invocation. Defaults to \{\}. + +If a subclass overrides the constructor, it must make sure to invoke +the base class constructor (Thread.__init__()) before doing anything +else to the thread. + +##### `getName(self)` + +No description available. + +##### `isDaemon(self)` + +No description available. + +##### `is_alive(self)` + +Return whether the thread is alive. + +This method returns True just before the run() method starts until just +after the run() method terminates. See also the module function +enumerate(). + +##### `join(self, timeout=None)` + +Wait until the thread terminates. + +This blocks the calling thread until the thread whose join() method is +called terminates -- either normally or through an unhandled exception +or until the optional timeout occurs. + +When the timeout argument is present and not None, it should be a +floating point number specifying a timeout for the operation in seconds +(or fractions thereof). As join() always returns None, you must call +is_alive() after join() to decide whether a timeout happened -- if the +thread is still alive, the join() call timed out. + +When the timeout argument is not present or None, the operation will +block until the thread terminates. + +A thread can be join()ed many times. + +join() raises a RuntimeError if an attempt is made to join the current +thread as that would cause a deadlock. It is also an error to join() a +thread before it has been started and attempts to do so raises the same +exception. + +##### `run(self) -> 'None'` + +Method representing the thread's activity. + +You may override this method in a subclass. The standard run() method +invokes the callable object passed to the object's constructor as the +target argument, if any, with sequential and keyword arguments taken +from the args and kwargs arguments, respectively. + +##### `setDaemon(self, daemonic)` + +No description available. + +##### `setName(self, name)` + +No description available. + +##### `start(self)` + +Start the thread's activity. + +It must be called at most once per thread object. It arranges for the +object's run() method to be invoked in a separate thread of control. + +This method will raise a RuntimeError if called more than once on the +same thread object. + +### ThreadContext + +Context object providing access to current thread and turn information. + +#### Methods + +##### `__init__(self, thread_id: 'str | None')` + +Initialize ThreadContext with the specified thread_id. + +Args: + thread_id: The thread identifier for this context, or None if disabled. + +### ThreadPoolExecutor + +A ThreadPoolExecutor that runs functions with the context of the caller. + +This is a drop-in replacement for concurrent.futures.ThreadPoolExecutor that +ensures weave calls behave as expected inside the executor. Weave requires +certain contextvars to be set (see call_context.py), but new threads do not +automatically copy context from the parent, which can cause the call context +to be lost -- not good! This class automates contextvar copying so using +this executor "just works" as the user probably expects. + +You can achieve the same effect without this class by instead writing: + +```python +with concurrent.futures.ThreadPoolExecutor() as executor: + contexts = [copy_context() for _ in range(len(vals))] + + def _wrapped_fn(*args): + return contexts.pop().run(fn, *args) + + executor.map(_wrapped_fn, vals) +``` + +#### Methods + +##### `__init__(self, *args: 'Any', **kwargs: 'Any') -> 'None'` + +Initializes a new ThreadPoolExecutor instance. + +Args: + max_workers: The maximum number of threads that can be used to + execute the given calls. + thread_name_prefix: An optional name prefix to give our threads. + initializer: A callable used to initialize worker threads. + initargs: A tuple of arguments to pass to the initializer. + +##### `map(self, fn: 'Callable', *iterables: 'Iterable[Any]', timeout: 'float | None' = None, chunksize: 'int' = 1) -> 'Iterator'` + +Returns an iterator equivalent to map(fn, iter). + +Args: + fn: A callable that will take as many arguments as there are + passed iterables. + timeout: The maximum number of seconds to wait. If None, then there + is no limit on the wait time. + chunksize: The size of the chunks the iterable will be broken into + before being passed to a child process. This argument is only + used by ProcessPoolExecutor; it is ignored by + ThreadPoolExecutor. + +Returns: + An iterator equivalent to: map(func, *iterables) but the calls may + be evaluated out-of-order. + +Raises: + TimeoutError: If the entire result iterator could not be generated + before the given timeout. + Exception: If fn(*args) raises for any values. + +##### `shutdown(self, wait=True, *, cancel_futures=False)` + +Clean-up the resources associated with the Executor. + +It is safe to call this method several times. Otherwise, no other +methods can be called after this one. + +Args: + wait: If True then shutdown will not return until all running + futures have finished executing and the resources used by the + executor have been reclaimed. + cancel_futures: If True then shutdown will cancel all pending + futures. Futures that are completed or running will not be + cancelled. + +##### `submit(self, fn: 'Callable', *args: 'Any', **kwargs: 'Any') -> 'Any'` + +Submits a callable to be executed with the given arguments. + +Schedules the callable to be executed as fn(*args, **kwargs) and returns +a Future instance representing the execution of the callable. + +Returns: + A Future representing the given call. + diff --git a/weave/reference/python-sdk/weave/trace/op.mdx b/weave/reference/python-sdk/weave/trace/op.mdx new file mode 100644 index 0000000000..5730ce6609 --- /dev/null +++ b/weave/reference/python-sdk/weave/trace/op.mdx @@ -0,0 +1,553 @@ +--- +title: weave.trace.op +--- + +# weave.trace.op + +## Functions + +### `TypedDict(typename, fields=None, /, *, total=True, **kwargs)` + +A simple typed namespace. At runtime it is equivalent to a plain dict. + +TypedDict creates a dictionary type that expects all of its +instances to have a certain set of keys, where each key is +associated with a value of a consistent type. This expectation +is not checked at runtime but is only enforced by type checkers. +Usage:: + + class Point2D(TypedDict): + x: int + y: int + label: str + + a: Point2D = \{'x': 1, 'y': 2, 'label': 'good'\} # OK + b: Point2D = \{'z': 3, 'label': 'bad'\} # Fails type check + + assert Point2D(x=1, y=2, label='first') == dict(x=1, y=2, label='first') + +The type info can be accessed via the Point2D.__annotations__ dict, and +the Point2D.__required_keys__ and Point2D.__optional_keys__ frozensets. +TypedDict supports two additional equivalent forms:: + + Point2D = TypedDict('Point2D', x=int, y=int, label=str) + Point2D = TypedDict('Point2D', \{'x': int, 'y': int, 'label': str\}) + +By default, all keys must be present in a TypedDict. It is possible +to override this by specifying totality. +Usage:: + + class point2D(TypedDict, total=False): + x: int + y: int + +This means that a point2D TypedDict can have any of the keys omitted.A type +checker is only expected to support a literal False or True as the value of +the total argument. True is the default, and makes all items defined in the +class body be required. + +The class syntax is only supported in Python 3.6+, while two other +syntax forms work for Python 2.7 and 3.2+ + +### `aiter(obj: 'AsyncIterator[V]') -> 'AsyncIterator[V]'` + +No description available. + +### `anext(obj: 'AsyncIterator[V]', default: 'V | None' = None) -> 'V'` + +No description available. + +### `as_op(fn: 'Callable[P, R]') -> 'Op[P, R]'` + +Given a @weave.op() decorated function, return its Op. + +@weave.op() decorated functions are instances of Op already, so this +function should be a no-op at runtime. But you can use it to satisfy type checkers +if you need to access OpDef attributes in a typesafe way. + +Args: + fn: A weave.op() decorated function. + +Returns: + The Op of the function. + +### `call(op: 'Op', *args: 'Any', __weave: 'WeaveKwargs | None' = None, __should_raise: 'bool' = False, __require_explicit_finish: 'bool' = False, **kwargs: 'Any') -> 'tuple[Any, Call] | Coroutine[Any, Any, tuple[Any, Call]]'` + +Executes the op and returns both the result and a Call representing the execution. + +This function will never raise. Any errors are captured in the Call object. + +This method is automatically bound to any function decorated with `@weave.op`, +allowing for usage like: + +```python +@weave.op +def add(a: int, b: int) -> int: + return a + b + +result, call = add.call(1, 2) +``` + +### `calls(op: 'Op') -> 'CallsIter'` + +Get an iterator over all calls to this op. + +This method is automatically bound to any function decorated with `@weave.op`, +allowing for usage like: + +```python +@weave.op +def add(a: int, b: int) -> int: + return a + b + +calls = add.calls() +for call in calls: + print(call) +``` + +### `cast(typ, val)` + +Cast a value to a type. + +This returns the value unchanged. To the type checker this +signals that the return value has the designated type, but at +runtime we intentionally don't check anything (we want this +to be as fast as possible). + +### `dataclass(cls=None, /, *, init=True, repr=True, eq=True, order=False, unsafe_hash=False, frozen=False)` + +Returns the same class as was passed in, with dunder methods +added based on the fields defined in the class. + +Examines PEP 526 __annotations__ to determine fields. + +If init is true, an __init__() method is added to the class. If +repr is true, a __repr__() method is added. If order is true, rich +comparison dunder methods are added. If unsafe_hash is true, a +__hash__() method function is added. If frozen is true, fields may +not be assigned to after instance creation. + +### `get_captured_code(op: 'Op') -> 'str'` + +Get the captured code of the op. + +This only works when you get an op back from a ref. The pattern is: + +ref = weave.publish(func) +op = ref.get() +captured_code = op.get_captured_code() + +### `get_raise_on_captured_errors() -> bool` + +No description available. + +### `get_tracing_enabled() -> 'bool'` + +No description available. + +### `is_op(obj: 'Any') -> 'TypeIs[Op]'` + +Check if an object is an Op. + +### `is_placeholder_call(call: 'Call') -> 'TypeIs[NoOpCall]'` + +No description available. + +### `is_tracing_setting_disabled() -> 'bool'` + +No description available. + +### `log_once(log_method: 'Callable[[str], None]', message: 'str') -> 'None'` + +Logs a message once, suppressing subsequent messages of the same type. This +is useful for notifying the user about errors without spamming the logs. + +This is mostly useful for cases where the same error message might occur many times. +For example, if an op fails to save, it is likely going to happen every time that op is +called. Or, if we have an error in our patched iterator, then it likely happens every time +we iterate over the result. This allows use to inform the user about the error without +clogging up their logs. + +Args: + log_method: The method to use to log the message. This should accept a string argument. + message: The message to log. + +Example: +```python +log_once(logger.error, "Failed to save op") +``` + +### `maybe_bind_method(func: 'Callable', self: 'Any' = None) -> 'Callable | MethodType'` + +Bind a function to any object (even if it's not a class). + +If self is None, return the function as is. + +### `maybe_unbind_method(oplike: 'Op | MethodType | partial') -> 'Op'` + +Unbind an Op-like method or partial to a plain Op function. + +For: +- methods, remove set `self` param +- partials, remove any preset params + +### `op(func: 'Callable[P, R] | None' = None, *, name: 'str | None' = None, call_display_name: 'str | CallDisplayNameFunc | None' = None, postprocess_inputs: 'PostprocessInputsFunc | None' = None, postprocess_output: 'PostprocessOutputFunc | None' = None, tracing_sample_rate: 'float' = 1.0, enable_code_capture: 'bool' = True, accumulator: 'Callable[[Any | None, Any], Any] | None' = None) -> 'Callable[[Callable[P, R]], Op[P, R]] | Op[P, R]'` + +A decorator to weave op-ify a function or method. Works for both sync and async. +Automatically detects iterator functions and applies appropriate behavior. + +### `overload(func)` + +Decorator for overloaded functions/methods. + +In a stub file, place two or more stub definitions for the same +function in a row, each decorated with @overload. For example: + + @overload + def utf8(value: None) -> None: ... + @overload + def utf8(value: bytes) -> bytes: ... + @overload + def utf8(value: str) -> bytes: ... + +In a non-stub file (i.e. a regular .py file), do the same but +follow it with an implementation. The implementation should *not* +be decorated with @overload. For example: + + @overload + def utf8(value: None) -> None: ... + @overload + def utf8(value: bytes) -> bytes: ... + @overload + def utf8(value: str) -> bytes: ... + def utf8(value): + # implementation goes here + +### `placeholder_call() -> 'Call'` + +No description available. + +### `setup_dunder_weave_dict(d: 'WeaveKwargs | None' = None) -> 'WeaveKwargs'` + +Sets up a __weave dict used to pass WeaveKwargs to ops. + +### `should_skip_tracing_for_op(op: 'Op') -> 'bool'` + +No description available. + +### `tracing_disabled() -> 'Iterator[None]'` + +No description available. + +### `wraps(wrapped, assigned=('__module__', '__name__', '__qualname__', '__doc__', '__annotations__'), updated=('__dict__',))` + +Decorator factory to apply update_wrapper() to a wrapper function + +Returns a decorator that invokes update_wrapper() with the decorated +function as the wrapper argument and the arguments to wraps() as the +remaining arguments. Default arguments are as for update_wrapper(). +This is a convenience function to simplify applying partial() to +update_wrapper(). + +## Classes + +### AsyncGenerator + +No description available. + +#### Methods + +##### `aclose(self)` + +Raise GeneratorExit inside coroutine. + + +##### `asend(self, value)` + +Send a value into the asynchronous generator. +Return next yielded value or raise StopAsyncIteration. + +##### `athrow(self, typ, val=None, tb=None)` + +Raise an exception in the asynchronous generator. +Return next yielded value or raise StopAsyncIteration. + +### AsyncIterator + +No description available. + +### Coroutine + +No description available. + +#### Methods + +##### `close(self)` + +Raise GeneratorExit inside coroutine. + + +##### `send(self, value)` + +Send a value into the coroutine. +Return next yielded value or raise StopIteration. + +##### `throw(self, typ, val=None, tb=None)` + +Raise an exception in the coroutine. +Return next yielded value or raise StopIteration. + +### DisplayNameFuncError + +Inappropriate argument value (of correct type). + +### Generator + +No description available. + +#### Methods + +##### `close(self)` + +Raise GeneratorExit inside generator. + + +##### `send(self, value)` + +Send a value into the generator. +Return next yielded value or raise StopIteration. + +##### `throw(self, typ, val=None, tb=None)` + +Raise an exception in the generator. +Return next yielded value or raise StopIteration. + +### Generic + +Abstract base class for generic types. + +A generic type is typically declared by inheriting from +this class parameterized with one or more type variables. +For example, a generic mapping type might be defined as:: + + class Mapping(Generic[KT, VT]): + def __getitem__(self, key: KT) -> VT: + ... + # Etc. + +This class can then be used as follows:: + + def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT: + try: + return mapping[key] + except KeyError: + return default + +### Iterator + +No description available. + +### Mapping + +No description available. + +#### Methods + +##### `get(self, key, default=None)` + +D.get(k[,d]) -> D[k] if k in D, else d. d defaults to None. + +##### `items(self)` + +D.items() -> a set-like object providing a view on D's items + +##### `keys(self)` + +D.keys() -> a set-like object providing a view on D's keys + +##### `values(self)` + +D.values() -> an object providing a view on D's values + +### MethodType + +method(function, instance) + +Create a bound instance method object. + +### Op + +The interface for Op-ified functions and methods. + +Op was previously a class, and has been converted to a Protocol to allow +functions to pass for Op. This is needed because many popular packages are +using the `inspect` module for control flow, and Op instances don't always +pass those checks. In particular, `inspect.iscoroutinefunction` always +fails for classes, even ones that implement async methods or protocols. + +Some of the attributes are carry-overs from when Op was a class. We should +consider removing the unnecessary ones where possible. +- resolve_fn (I think you can just use the func itself?) +- _set_on_output_handler (does this have to be on the op?) +- _on_output_handler (does this have to be on the op?) + +#### Methods + +##### `_no_init(self, *args, **kwargs)` + +No description available. + +### OpCallError + +Common base class for all non-exit exceptions. + +### ParamSpec + +Parameter specification variable. + +Usage:: + + P = ParamSpec('P') + +Parameter specification variables exist primarily for the benefit of static +type checkers. They are used to forward the parameter types of one +callable to another callable, a pattern commonly found in higher order +functions and decorators. They are only valid when used in ``Concatenate``, +or s the first argument to ``Callable``. In Python 3.10 and higher, +they are also supported in user-defined Generics at runtime. +See class Generic for more information on generic types. An +example for annotating a decorator:: + + T = TypeVar('T') + P = ParamSpec('P') + + def add_logging(f: Callable[P, T]) -> Callable[P, T]: + '''A type-safe decorator to add logging to a function.''' + def inner(*args: P.args, **kwargs: P.kwargs) -> T: + logging.info(f'\{f.__name__\} was called') + return f(*args, **kwargs) + return inner + + @add_logging + def add_two(x: float, y: float) -> float: + '''Add two numbers together.''' + return x + y + +Parameter specification variables defined with covariant=True or +contravariant=True can be used to declare covariant or contravariant +generic types. These keyword arguments are valid, but their actual semantics +are yet to be decided. See PEP 612 for details. + +Parameter specification variables can be introspected. e.g.: + + P.__name__ == 'T' + P.__bound__ == None + P.__covariant__ == False + P.__contravariant__ == False + +Note that only parameter specification variables defined in global scope can +be pickled. + +#### Methods + +##### `__init__(self, name, *, bound=None, covariant=False, contravariant=False, infer_variance=False, default=typing_extensions.NoDefault)` + +Initialize self. See help(type(self)) for accurate signature. + +### ProcessedInputs + +ProcessedInputs(original_args: 'tuple', original_kwargs: 'dict[str, Any]', args: 'tuple', kwargs: 'dict[str, Any]', inputs: 'dict[str, Any]') + +#### Methods + +##### `__init__(self, original_args: 'tuple', original_kwargs: 'dict[str, Any]', args: 'tuple', kwargs: 'dict[str, Any]', inputs: 'dict[str, Any]') -> None` + +No description available. + +### Sentinel + +Sentinel(package: 'str', path: 'str', name: 'str') + +#### Methods + +##### `__init__(self, package: 'str', path: 'str', name: 'str') -> None` + +No description available. + +### TypeVar + +Type variable. + +Usage:: + + T = TypeVar('T') # Can be anything + A = TypeVar('A', str, bytes) # Must be str or bytes + +Type variables exist primarily for the benefit of static type +checkers. They serve as the parameters for generic types as well +as for generic function definitions. See class Generic for more +information on generic types. Generic functions work as follows: + + def repeat(x: T, n: int) -> List[T]: + '''Return a list containing n references to x.''' + return [x]*n + + def longest(x: A, y: A) -> A: + '''Return the longest of two strings.''' + return x if len(x) >= len(y) else y + +The latter example's signature is essentially the overloading +of (str, str) -> str and (bytes, bytes) -> bytes. Also note +that if the arguments are instances of some subclass of str, +the return type is still plain str. + +At runtime, isinstance(x, T) and issubclass(C, T) will raise TypeError. + +Type variables defined with covariant=True or contravariant=True +can be used to declare covariant or contravariant generic types. +See PEP 484 for more details. By default generic types are invariant +in all type variables. + +Type variables can be introspected. e.g.: + + T.__name__ == 'T' + T.__constraints__ == () + T.__covariant__ == False + T.__contravariant__ = False + A.__constraints__ == (str, bytes) + +Note that only type variables defined in global scope can be pickled. + +#### Methods + +##### `__init__(self, name, *constraints, bound=None, covariant=False, contravariant=False)` + +Initialize self. See help(type(self)) for accurate signature. + +### WeaveKwargs + +dict() -> new empty dictionary +dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs +dict(iterable) -> new dictionary initialized as if via: + d = \{\} + for k, v in iterable: + d[k] = v +dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + +### defaultdict + +defaultdict(default_factory=None, /, [...]) --> dict with default factory + +The default factory is called without arguments to produce +a new value when a key is not present, in __getitem__ only. +A defaultdict compares equal to a dict with the same items. +All remaining arguments are treated the same as if they were +passed to the dict constructor, including keyword arguments. + +### partial + +partial(func, *args, **keywords) - new function with partial application +of the given arguments and keywords. + diff --git a/weave/reference/python-sdk/weave/trace/weave_client.mdx b/weave/reference/python-sdk/weave/trace/weave_client.mdx new file mode 100644 index 0000000000..f553b56786 --- /dev/null +++ b/weave/reference/python-sdk/weave/trace/weave_client.mdx @@ -0,0 +1,11749 @@ +--- +title: weave.trace.weave_client +--- + +# weave.trace.weave_client + +## Functions + +### `TypedDict(typename, fields=None, /, *, total=True, **kwargs)` + +A simple typed namespace. At runtime it is equivalent to a plain dict. + +TypedDict creates a dictionary type that expects all of its +instances to have a certain set of keys, where each key is +associated with a value of a consistent type. This expectation +is not checked at runtime but is only enforced by type checkers. +Usage:: + + class Point2D(TypedDict): + x: int + y: int + label: str + + a: Point2D = \{'x': 1, 'y': 2, 'label': 'good'\} # OK + b: Point2D = \{'z': 3, 'label': 'bad'\} # Fails type check + + assert Point2D(x=1, y=2, label='first') == dict(x=1, y=2, label='first') + +The type info can be accessed via the Point2D.__annotations__ dict, and +the Point2D.__required_keys__ and Point2D.__optional_keys__ frozensets. +TypedDict supports two additional equivalent forms:: + + Point2D = TypedDict('Point2D', x=int, y=int, label=str) + Point2D = TypedDict('Point2D', \{'x': int, 'y': int, 'label': str\}) + +By default, all keys must be present in a TypedDict. It is possible +to override this by specifying totality. +Usage:: + + class point2D(TypedDict, total=False): + x: int + y: int + +This means that a point2D TypedDict can have any of the keys omitted.A type +checker is only expected to support a literal False or True as the value of +the total argument. True is the default, and makes all items defined in the +class body be required. + +The class syntax is only supported in Python 3.6+, while two other +syntax forms work for Python 2.7 and 3.2+ + +### `as_op(fn: 'Callable[P, R]') -> 'Op[P, R]'` + +Given a @weave.op() decorated function, return its Op. + +@weave.op() decorated functions are instances of Op already, so this +function should be a no-op at runtime. But you can use it to satisfy type checkers +if you need to access OpDef attributes in a typesafe way. + +Args: + fn: A weave.op() decorated function. + +Returns: + The Op of the function. + +### `cast(typ, val)` + +Cast a value to a type. + +This returns the value unchanged. To the type checker this +signals that the return value has the designated type, but at +runtime we intentionally don't check anything (we want this +to be as fast as possible). + +### `check_endpoint_exists(func: Callable, test_req: Any, cache_key: Optional[str] = None) -> bool` + +Check if a function/endpoint exists and works by calling it with a test request. + +This allows bypassing retry logic by passing the unwrapped function directly, +or testing any callable with consistent caching and error handling. + +Args: + func: The function to test (e.g., server.table_create_from_digests or + server._generic_request_executor.__wrapped__) + test_req: A test request to use for checking the function + cache_key: Optional cache key. If not provided, uses id(func) + +Returns: + True if function exists and works, False otherwise + +### `check_wandb_run_matches(wandb_run_id: 'str | None', weave_entity: 'str', weave_project: 'str') -> 'None'` + +No description available. + +### `client_parallelism() -> Optional[int]` + +No description available. + +### `dataclass_object_record(obj: 'Any') -> 'ObjectRecord'` + +No description available. + +### `deprecated(new_name: 'str') -> 'Callable[[Callable[..., Any]], Callable[..., Any]]'` + +Decorator to mark a function as deprecated and redirect users to `new_name`. + +### `elide_display_name(name: 'str') -> 'str'` + +No description available. + +### `exception_to_json_str(exception: 'BaseException') -> 'str'` + +No description available. + +### `exists_expr(expr: Union[weave.trace_server.interface.query.LiteralOperation, weave.trace_server.interface.query.GetFieldOperator, weave.trace_server.interface.query.ConvertOperation, weave.trace_server.interface.query.AndOperation, weave.trace_server.interface.query.OrOperation, weave.trace_server.interface.query.NotOperation, weave.trace_server.interface.query.EqOperation, weave.trace_server.interface.query.GtOperation, weave.trace_server.interface.query.GteOperation, weave.trace_server.interface.query.InOperation, weave.trace_server.interface.query.ContainsOperation]) -> weave.trace_server.interface.query.NotOperation` + +No description available. + +### `from_json(obj: 'Any', project_id: 'str', server: 'TraceServerInterface') -> 'Any'` + +No description available. + +### `generate_id() -> str` + +Should be used to generate IDs for trace calls. +We use UUIDv7, which has a timestamp prefix, so that the IDs, while random, +are sortable by time. See RFC9562 https://www.rfc-editor.org/rfc/rfc9562. + +Random space is 2^74, which is less than 2^122 (UUIDv4), but still plenty +for our use case. + +### `get_field_expr(field: str) -> weave.trace_server.interface.query.GetFieldOperator` + +No description available. + +### `get_obj_name(val: 'Any') -> 'str'` + +No description available. + +### `get_parallelism_settings() -> 'tuple[int | None, int | None]'` + +No description available. + +### `get_ref(obj: 'Any') -> 'ObjectRef | None'` + +No description available. + +### `get_serializer_for_obj(obj: 'Any') -> 'Serializer | None'` + +No description available. + +### `is_op(obj: 'Any') -> 'TypeIs[Op]'` + +Check if an object is an Op. + +### `is_placeholder_call(call: 'Call') -> 'TypeIs[NoOpCall]'` + +No description available. + +### `is_tracing_setting_disabled() -> 'bool'` + +No description available. + +### `isinstance_namedtuple(obj: 'Any') -> 'bool'` + +No description available. + +### `literal_expr(value: Any) -> weave.trace_server.interface.query.LiteralOperation` + +No description available. + +### `make_client_call(entity: 'str', project: 'str', server_call: 'CallSchema', server: 'TraceServerInterface') -> 'WeaveObject'` + +No description available. + +### `make_trace_obj(val: Any, new_ref: Optional[weave.trace.refs.RefWithExtra], server: weave.trace_server.trace_server_interface.TraceServerInterface, root: Optional[weave.trace.vals.Traceable], parent: Any = None) -> Any` + +No description available. + +### `map_to_refs(obj: 'Any') -> 'Any'` + +No description available. + +### `maybe_objectify(obj: 'WeaveObject') -> 'T_co | WeaveObject'` + +No description available. + +### `maybe_unbind_method(oplike: 'Op | MethodType | partial') -> 'Op'` + +Unbind an Op-like method or partial to a plain Op function. + +For: +- methods, remove set `self` param +- partials, remove any preset params + +### `op(func: 'Callable[P, R] | None' = None, *, name: 'str | None' = None, call_display_name: 'str | CallDisplayNameFunc | None' = None, postprocess_inputs: 'PostprocessInputsFunc | None' = None, postprocess_output: 'PostprocessOutputFunc | None' = None, tracing_sample_rate: 'float' = 1.0, enable_code_capture: 'bool' = True, accumulator: 'Callable[[Any | None, Any], Any] | None' = None) -> 'Callable[[Callable[P, R]], Op[P, R]] | Op[P, R]'` + +A decorator to weave op-ify a function or method. Works for both sync and async. +Automatically detects iterator functions and applies appropriate behavior. + +### `placeholder_call() -> 'Call'` + +No description available. + +### `print_call_link(call: 'Call') -> 'None'` + +No description available. + +### `pydantic_object_record(obj: 'BaseModel') -> 'ObjectRecord'` + +No description available. + +### `redact_sensitive_keys(obj: 'Any') -> 'Any'` + +No description available. + +### `remove_ref(obj: 'Any') -> 'None'` + +No description available. + +### `runnable_feedback_output_selector(name: str) -> str` + +No description available. + +### `runnable_feedback_runnable_ref_selector(name: str) -> str` + +No description available. + +### `safe_current_wb_run_id() -> 'str | None'` + +No description available. + +### `safe_current_wb_run_step() -> 'int | None'` + +No description available. + +### `sanitize_object_name(name: 'str') -> 'str'` + +No description available. + +### `set_ref(obj: 'Any', ref: 'Ref | None') -> 'None'` + +Try to set the ref on "any" object. + +We use increasingly complex methods to try to set the ref +to support different kinds of objects. This will still +fail for python primitives, but those can't be traced anyway. + +### `should_capture_client_info() -> bool` + +No description available. + +### `should_capture_system_info() -> bool` + +No description available. + +### `should_print_call_link() -> bool` + +No description available. + +### `should_redact(key: str) -> bool` + +Return whether a given key should be redacted. + +Args: + key: The key name to check. + +Returns: + True if the key is configured to be redacted (case-insensitive), False otherwise. + +Examples: + >>> from weave.utils import sanitize + >>> sanitize.should_redact("API_KEY") + True + >>> sanitize.should_redact("random_key") + False + +### `should_redact_pii() -> bool` + +No description available. + +### `should_skip_tracing_for_op(op: 'Op') -> 'bool'` + +No description available. + +### `should_use_parallel_table_upload() -> bool` + +Returns whether parallel table upload chunking should be used. + +### `sum_dict_leaves(dicts: list) -> dict` + +Recursively combines multiple dictionaries by summing their leaf values. + +This function takes a list of dictionaries and combines them by: +1. For non-dict values: extending lists or summing numbers +2. For nested dictionaries: recursively combining them + +Args: + dicts: A list of dictionaries to combine + +Returns: + A single dictionary with combined values + +Examples: + >>> # Combining status counts from multiple runs + >>> dicts = [ + ... \{"status_counts": \{"SUCCESS": 5, "FAILED": 1\}\}, + ... \{"status_counts": \{"SUCCESS": 3, "FAILED": 2, "PENDING": 1\}\} + ... ] + >>> sum_dict_leaves(dicts) + \{'status_counts': \{'SUCCESS': 8, 'FAILED': 3, 'PENDING': 1\}\} + + >>> # Combining metrics with nested structure + >>> dicts = [ + ... \{"metrics": \{"accuracy": 0.95, "loss": 0.1, "details": \{"precision": 0.9, "recall": 0.8\}\}\}, + ... \{"metrics": \{"accuracy": 0.97, "loss": 0.08, "details": \{"precision": 0.92, "f1": 0.85\}\}\} + ... ] + >>> sum_dict_leaves(dicts) + \{'metrics': \{'accuracy': 1.92, 'loss': 0.18, 'details': \{'precision': 1.82, 'recall': 0.8, 'f1': 0.85\}\}\} + +### `to_json(obj: 'Any', project_id: 'str', client: 'WeaveClient', use_dictify: 'bool' = False) -> 'Any'` + +No description available. + +### `zip_dicts(base_dict: dict, new_dict: dict) -> dict` + +No description available. + +## Classes + +### AttributesDict + +A dict representing the attributes of a call. + +The ``weave`` key is reserved for internal use and cannot be set directly. +Attributes become immutable once the call is created. Any attempt to modify +the dictionary after call start will raise :class:`TypeError`. Use the +:func:`weave.attributes` context manager or the ``attributes`` parameter of +:meth:`WeaveClient.create_call` to supply metadata before the call begins. + +#### Methods + +##### `__init__(self, **kwargs: Any) -> None` + +Initialize self. See help(type(self)) for accurate signature. + +##### `freeze(self) -> None` + +No description available. + +##### `unwrap(self) -> dict` + +No description available. + +##### `update(self, *args: Any, **kwargs: Any) -> None` + +D.update([E, ]**F) -> None. Update D from dict/iterable E and F. +If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] +If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v +In either case, this is followed by: for k in F: D[k] = F[k] + +### Call + +A Call represents a single operation executed as part of a trace. + +``attributes`` are frozen once the call is created. Use +:func:`weave.attributes` or ``create_call(..., attributes=...)`` to +populate metadata beforehand. The ``summary`` dictionary may be +modified while the call is running; its contents are deep-merged +with computed summary values when :meth:`WeaveClient.finish_call` +is invoked. + +#### Methods + +##### `__init__(self, _op_name: 'str | Future[str]', trace_id: 'str', project_id: 'str', parent_id: 'str | None', inputs: 'dict[str, Any]', id: 'str | None' = None, output: 'Any' = None, exception: 'str | None' = None, summary: 'dict[str, Any] | None' = , _display_name: 'str | Callable[[Call], str] | None' = None, attributes: 'dict[str, Any] | None' = None, started_at: 'datetime.datetime | None' = None, ended_at: 'datetime.datetime | None' = None, deleted_at: 'datetime.datetime | None' = None, thread_id: 'str | None' = None, turn_id: 'str | None' = None, wb_run_id: 'str | None' = None, wb_run_step: 'int | None' = None, wb_run_step_end: 'int | None' = None, _children: 'list[Call]' = , _feedback: 'RefFeedbackQuery | None' = None) -> None` + +No description available. + +##### `apply_scorer(self, scorer: 'Op | Scorer', additional_scorer_kwargs: 'dict[str, Any] | None' = None) -> 'ApplyScorerResult'` + +`apply_scorer` is a method that applies a Scorer to a Call. This is useful +for guarding application logic with a scorer and/or monitoring the quality +of critical ops. Scorers are automatically logged to Weave as Feedback and +can be used in queries & analysis. + +Args: + scorer: The Scorer to apply. + additional_scorer_kwargs: Additional kwargs to pass to the scorer. This is + useful for passing in additional context that is not part of the call + inputs.useful for passing in additional context that is not part of the call + inputs. + +Returns: + The result of the scorer application in the form of an `ApplyScorerResult`. + +```python +class ApplyScorerSuccess: + result: Any + score_call: Call +``` + +Example usage: + +```python +my_scorer = ... # construct a scorer +prediction, prediction_call = my_op.call(input_data) +result, score_call = prediction.apply_scorer(my_scorer) +``` + +##### `children(self, *, page_size: 'int' = 1000) -> 'CallsIter'` + +Get the children of the call. + +Args: + page_size: Tune performance by changing the number of calls fetched at a time. + +Returns: + An iterator of calls. + +##### `delete(self) -> 'bool'` + +Delete the call. + +##### `remove_display_name(self) -> 'None'` + +No description available. + +##### `set_display_name(self, name: 'str | None') -> 'None'` + +Set the display name for the call. + +Args: + name: The display name to set for the call. + +Example: +```python +result, call = my_function.call("World") +call.set_display_name("My Custom Display Name") +``` + +##### `to_dict(self) -> 'CallDict'` + +No description available. + +### CallEndReq + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### CallRef + +CallRef(entity: 'str', project: 'str', id: 'str', _extra: 'tuple[str | Future[str], ...]' = ()) + +#### Methods + +##### `__init__(self, entity: 'str', project: 'str', id: 'str', _extra: 'tuple[str | Future[str], ...]' = ()) -> None` + +No description available. + +##### `as_param_dict(self) -> 'dict'` + +No description available. + +##### `maybe_parse_uri(s: 'str') -> 'AnyRef | None'` + +No description available. + +##### `parse_uri(uri: 'str') -> 'CallRef'` + +No description available. + +##### `uri(self) -> 'str'` + +No description available. + +##### `with_attr(self, attr: 'str') -> 'Self'` + +No description available. + +##### `with_extra(self, extra: 'tuple[str | Future[str], ...]') -> 'Self'` + +No description available. + +##### `with_index(self, index: 'int') -> 'Self'` + +No description available. + +##### `with_item(self, item_digest: 'str | Future[str]') -> 'Self'` + +No description available. + +##### `with_key(self, key: 'str') -> 'Self'` + +No description available. + +### CallStartReq + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### CallUpdateReq + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### CallsDeleteReq + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### CallsFilter + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### CallsQueryReq + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### Chat + +No description available. + +#### Methods + +##### `__init__(self, client: 'WeaveClient')` + +This class exists to mirror openai.resources.chat.chat.Chat +so we can have a drop-in compatible client.chat.completions.create call. + +### ChunkingConfig + +Configuration for table chunking behavior. + +#### Methods + +##### `__init__(self, use_chunking: bool, use_parallel_chunks: bool) -> None` + +No description available. + +### CostCreateInput + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### CostCreateReq + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### CostCreateRes + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### CostPurgeReq + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### CostQueryOutput + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### CostQueryReq + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### EndedCallSchemaForInsert + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `serialize_typed_dicts(self, v: dict) -> dict` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### FeedbackCreateReq + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### FeedbackQuery + +Lazy-loading object for fetching feedback from the server. + +#### Methods + +##### `__init__(self, entity: 'str', project: 'str', query: 'Query', offset: 'int | None' = None, limit: 'int | None' = None, show_refs: 'bool' = False)` + +Initialize self. See help(type(self)) for accurate signature. + +##### `execute(self) -> 'Feedbacks'` + +No description available. + +##### `refresh(self) -> 'Feedbacks'` + +No description available. + +##### `refs(self) -> 'Refs'` + +No description available. + +### FileCreateReq + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### FileCreateRes + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### FlushStatus + +Status information about the current flush operation. + +### Future + +Represents the result of an asynchronous computation. + +#### Methods + +##### `__init__(self)` + +Initializes the future. Should not be called by clients. + +##### `add_done_callback(self, fn)` + +Attaches a callable that will be called when the future finishes. + +Args: + fn: A callable that will be called with this future as its only + argument when the future completes or is cancelled. The callable + will always be called by a thread in the same process in which + it was added. If the future has already completed or been + cancelled then the callable will be called immediately. These + callables are called in the order that they were added. + +##### `cancel(self)` + +Cancel the future if possible. + +Returns True if the future was cancelled, False otherwise. A future +cannot be cancelled if it is running or has already completed. + +##### `cancelled(self)` + +Return True if the future was cancelled. + +##### `done(self)` + +Return True of the future was cancelled or finished executing. + +##### `exception(self, timeout=None)` + +Return the exception raised by the call that the future represents. + +Args: + timeout: The number of seconds to wait for the exception if the + future isn't done. If None, then there is no limit on the wait + time. + +Returns: + The exception raised by the call that the future represents or None + if the call completed without raising. + +Raises: + CancelledError: If the future was cancelled. + TimeoutError: If the future didn't finish executing before the given + timeout. + +##### `result(self, timeout=None)` + +Return the result of the call that the future represents. + +Args: + timeout: The number of seconds to wait for the result if the future + isn't done. If None, then there is no limit on the wait time. + +Returns: + The result of the call that the future represents. + +Raises: + CancelledError: If the future was cancelled. + TimeoutError: If the future didn't finish executing before the given + timeout. + Exception: If the call raised then that exception will be raised. + +##### `running(self)` + +Return True if the future is currently executing. + +##### `set_exception(self, exception)` + +Sets the result of the future as being the given exception. + +Should only be used by Executor implementations and unit tests. + +##### `set_result(self, result)` + +Sets the return value of work associated with the future. + +Should only be used by Executor implementations and unit tests. + +##### `set_running_or_notify_cancel(self)` + +Mark the future as running or process any cancel notifications. + +Should only be used by Executor implementations and unit tests. + +If the future has been cancelled (cancel() was called and returned +True) then any threads waiting on the future completing (though calls +to as_completed() or wait()) are notified and False is returned. + +If the future was not cancelled then it is put in the running state +(future calls to running() will return True) and True is returned. + +This method should be called by Executor implementations before +executing the work associated with this future. If this method returns +False then the work should not be executed. + +Returns: + False if the Future was cancelled, True otherwise. + +Raises: + RuntimeError: if this method was already called or if set_result() + or set_exception() was called. + +### FutureExecutor + +A utility for thread-local threadpool execution and promise-like chaining. + +This class provides a thread-safe way to submit and execute jobs asynchronously +using thread-local ThreadPoolExecutors. It ensures proper shutdown of the executors when the +object is deleted or when the program exits. + +Args: + max_workers (Optional[int]): The maximum number of worker threads to use per executor. + Defaults to None. If set to 0, all tasks will be executed + directly in the current thread. + thread_name_prefix (str): The prefix for thread names. Defaults to "WeaveThreadPool". + +#### Methods + +##### `__init__(self, max_workers: 'int | None' = None, thread_name_prefix: 'str' = 'WeaveThreadPool')` + +Initialize self. See help(type(self)) for accurate signature. + +##### `defer(self, f: 'Callable[..., T]', *args: 'Any', **kwargs: 'Any') -> 'Future[T]'` + +Defer a function to be executed in a thread pool. + +This is useful for long-running or I/O-bound functions where the result is not needed immediately. + +Args: + f (Callable[..., T]): The function to be executed. + *args: Positional arguments to pass to the function. + **kwargs: Keyword arguments to pass to the function. + +Returns: + Future[T]: A Future object representing the eventual result of the function. + +##### `flush(self, timeout: 'float | None' = None) -> 'bool'` + +Block until all currently submitted items are complete or timeout is reached. + +This method allows new submissions while waiting, ensuring that +submitted jobs can enqueue more items if needed to complete. + +Args: + timeout (Optional[float]): Maximum time to wait in seconds. If None, wait indefinitely. + +Returns: + bool: True if all tasks completed + +Raises: + RuntimeError: If called from within a thread context. + TimeoutError: If the timeout is reached. + +##### `then(self, futures: 'list[Future[T]]', g: 'Callable[[list[T]], U]') -> 'Future[U]'` + +Execute a function on the results of a list of futures. + +This is useful when the results of one or more futures are needed for further processing. + +Args: + futures (list[Future[T]]): A list of Future objects. + g (Callable[[list[T]], U]): A function that takes the results of the futures and returns a value of type U. + +Returns: + Future[U]: A new Future object representing the result of applying g to the results of the futures. + +### HTTPError + +An HTTP error occurred. + +#### Methods + +##### `__init__(self, *args, **kwargs)` + +Initialize RequestException with `request` and `response` objects. + +### InferenceModels + +No description available. + +#### Methods + +##### `__init__(self, client: 'WeaveClient')` + +This class exists to mirror openai.resources.models.Models. + +It is not a drop-in replacement because of the terminology conflict +with Weave's "Model". + +##### `list(self) -> Union[weave.chat.types.models.ModelsResponseSuccess, weave.chat.types.models.ModelsResponseError]` + +No description available. + +### ObjCreateReq + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### ObjCreateRes + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### ObjDeleteReq + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### ObjQueryReq + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### ObjReadReq + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### ObjSchema + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### ObjSchemaForInsert + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, _ObjSchemaForInsert__context: Any) -> None` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### ObjectRecord + +No description available. + +#### Methods + +##### `__init__(self, attrs: 'dict[str, Any]') -> 'None'` + +Initialize self. See help(type(self)) for accurate signature. + +##### `map_values(self, fn: 'Callable') -> 'ObjectRecord'` + +No description available. + +##### `unwrap(self) -> 'dict[str, Any]'` + +No description available. + +### ObjectRef + +ObjectRef(entity: 'str', project: 'str', name: 'str', _digest: 'str | Future[str]', _extra: 'tuple[str | Future[str], ...]' = ()) + +#### Methods + +##### `__init__(self, entity: 'str', project: 'str', name: 'str', _digest: 'str | Future[str]', _extra: 'tuple[str | Future[str], ...]' = ()) -> None` + +No description available. + +##### `as_param_dict(self) -> 'dict'` + +No description available. + +##### `delete(self) -> 'None'` + +No description available. + +##### `get(self, *, objectify: 'bool' = True) -> 'Any'` + +No description available. + +##### `is_descended_from(self, potential_ancestor: 'ObjectRef') -> 'bool'` + +No description available. + +##### `maybe_parse_uri(s: 'str') -> 'AnyRef | None'` + +No description available. + +##### `parse_uri(uri: 'str') -> 'ObjectRef'` + +No description available. + +##### `uri(self) -> 'str'` + +No description available. + +##### `with_attr(self, attr: 'str') -> 'Self'` + +No description available. + +##### `with_extra(self, extra: 'tuple[str | Future[str], ...]') -> 'Self'` + +No description available. + +##### `with_index(self, index: 'int') -> 'Self'` + +No description available. + +##### `with_item(self, item_digest: 'str | Future[str]') -> 'Self'` + +No description available. + +##### `with_key(self, key: 'str') -> 'Self'` + +No description available. + +### ObjectVersionFilter + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### Op + +The interface for Op-ified functions and methods. + +Op was previously a class, and has been converted to a Protocol to allow +functions to pass for Op. This is needed because many popular packages are +using the `inspect` module for control flow, and Op instances don't always +pass those checks. In particular, `inspect.iscoroutinefunction` always +fails for classes, even ones that implement async methods or protocols. + +Some of the attributes are carry-overs from when Op was a class. We should +consider removing the unnecessary ones where possible. +- resolve_fn (I think you can just use the func itself?) +- _set_on_output_handler (does this have to be on the op?) +- _on_output_handler (does this have to be on the op?) + +#### Methods + +##### `_no_init(self, *args, **kwargs)` + +No description available. + +### OpRef + +OpRef(entity: 'str', project: 'str', name: 'str', _digest: 'str | Future[str]', _extra: 'tuple[str | Future[str], ...]' = ()) + +#### Methods + +##### `__init__(self, entity: 'str', project: 'str', name: 'str', _digest: 'str | Future[str]', _extra: 'tuple[str | Future[str], ...]' = ()) -> None` + +No description available. + +##### `as_param_dict(self) -> 'dict'` + +No description available. + +##### `delete(self) -> 'None'` + +No description available. + +##### `get(self, *, objectify: 'bool' = True) -> 'Any'` + +No description available. + +##### `is_descended_from(self, potential_ancestor: 'ObjectRef') -> 'bool'` + +No description available. + +##### `maybe_parse_uri(s: 'str') -> 'AnyRef | None'` + +No description available. + +##### `parse_uri(uri: 'str') -> 'OpRef'` + +No description available. + +##### `uri(self) -> 'str'` + +No description available. + +##### `with_attr(self, attr: 'str') -> 'Self'` + +No description available. + +##### `with_extra(self, extra: 'tuple[str | Future[str], ...]') -> 'Self'` + +No description available. + +##### `with_index(self, index: 'int') -> 'Self'` + +No description available. + +##### `with_item(self, item_digest: 'str | Future[str]') -> 'Self'` + +No description available. + +##### `with_key(self, key: 'str') -> 'Self'` + +No description available. + +### PendingJobCounts + +Counts of pending jobs for each type. + +### Query + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### Ref + +Ref() + +#### Methods + +##### `__init__(self) -> None` + +No description available. + +##### `as_param_dict(self) -> 'dict'` + +No description available. + +##### `maybe_parse_uri(s: 'str') -> 'AnyRef | None'` + +No description available. + +##### `parse_uri(uri: 'str') -> 'AnyRef'` + +No description available. + +##### `uri(self) -> 'str'` + +No description available. + +### RefsReadBatchReq + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### Sequence + +All the operations on a read-only sequence. + +Concrete subclasses must override __new__ or __init__, +__getitem__, and __len__. + +#### Methods + +##### `count(self, value)` + +S.count(value) -> integer -- return number of occurrences of value + +##### `index(self, value, start=0, stop=None)` + +S.index(value, [start, [stop]]) -> integer -- return first index of value. +Raises ValueError if the value is not present. + +Supporting start and stop arguments is optional, but +recommended. + +### StartedCallSchemaForInsert + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### Table + +No description available. + +#### Methods + +##### `__init__(self, rows: 'list[dict]') -> 'None'` + +Initialize self. See help(type(self)) for accurate signature. + +##### `append(self, row: 'dict') -> 'None'` + +Add a row to the table. + +##### `pop(self, index: 'int') -> 'None'` + +Remove a row at the given index from the table. + +### TableAppendSpec + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### TableAppendSpecPayload + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### TableChunkManager + +Manages concurrent creation of table chunks with proper error handling. + +#### Methods + +##### `__init__(self, target_chunk_bytes: int = 10485760)` + +Initialize self. See help(type(self)) for accurate signature. + +##### `calculate_request_bytes(self, req: Any) -> int` + +Calculate the estimated size in bytes of a request. + +##### `calculate_row_bytes(self, row: object) -> int` + +Calculate the size in bytes of a single row. + +##### `create_chunks(self, rows: collections.abc.Sequence) -> list` + +Split rows into chunks based on target byte size. + +Args: + rows: List of rows to chunk + +Returns: + List of row chunks + +### TableCreateFromDigestsReq + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### TableCreateReq + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### TableCreateRes + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### TableRef + +TableRef(entity: 'str', project: 'str', _digest: 'str | Future[str]', _row_digests: 'list[str] | Future[list[str]] | None' = None) + +#### Methods + +##### `__init__(self, entity: 'str', project: 'str', _digest: 'str | Future[str]', _row_digests: 'list[str] | Future[list[str]] | None' = None) -> None` + +No description available. + +##### `as_param_dict(self) -> 'dict'` + +No description available. + +##### `maybe_parse_uri(s: 'str') -> 'AnyRef | None'` + +No description available. + +##### `parse_uri(uri: 'str') -> 'TableRef'` + +No description available. + +##### `uri(self) -> 'str'` + +No description available. + +### TableSchemaForInsert + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### TableUpdateReq + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### TraceServerInterface + +Base class for protocol classes. + +Protocol classes are defined as:: + + class Proto(Protocol): + def meth(self) -> int: + ... + +Such classes are primarily used with static type checkers that recognize +structural subtyping (static duck-typing), for example:: + + class C: + def meth(self) -> int: + return 0 + + def func(x: Proto) -> int: + return x.meth() + + func(C()) # Passes static type check + +See PEP 544 for details. Protocol classes decorated with +@typing.runtime_checkable act as simple-minded runtime protocols that check +only the presence of given attributes, ignoring their type signatures. +Protocol classes can be generic, they are defined as:: + + class GenProto(Protocol[T]): + def meth(self) -> T: + ... + +#### Methods + +##### `_no_init(self, *args, **kwargs)` + +No description available. + +##### `actions_execute_batch(self, req: weave.trace_server.trace_server_interface.ActionsExecuteBatchReq) -> weave.trace_server.trace_server_interface.ActionsExecuteBatchRes` + +No description available. + +##### `call_end(self, req: weave.trace_server.trace_server_interface.CallEndReq) -> weave.trace_server.trace_server_interface.CallEndRes` + +No description available. + +##### `call_read(self, req: weave.trace_server.trace_server_interface.CallReadReq) -> weave.trace_server.trace_server_interface.CallReadRes` + +No description available. + +##### `call_start(self, req: weave.trace_server.trace_server_interface.CallStartReq) -> weave.trace_server.trace_server_interface.CallStartRes` + +No description available. + +##### `call_start_batch(self, req: weave.trace_server.trace_server_interface.CallCreateBatchReq) -> weave.trace_server.trace_server_interface.CallCreateBatchRes` + +No description available. + +##### `call_update(self, req: weave.trace_server.trace_server_interface.CallUpdateReq) -> weave.trace_server.trace_server_interface.CallUpdateRes` + +No description available. + +##### `calls_delete(self, req: weave.trace_server.trace_server_interface.CallsDeleteReq) -> weave.trace_server.trace_server_interface.CallsDeleteRes` + +No description available. + +##### `calls_query(self, req: weave.trace_server.trace_server_interface.CallsQueryReq) -> weave.trace_server.trace_server_interface.CallsQueryRes` + +No description available. + +##### `calls_query_stats(self, req: weave.trace_server.trace_server_interface.CallsQueryStatsReq) -> weave.trace_server.trace_server_interface.CallsQueryStatsRes` + +No description available. + +##### `calls_query_stream(self, req: weave.trace_server.trace_server_interface.CallsQueryReq) -> collections.abc.Iterator` + +No description available. + +##### `completions_create(self, req: weave.trace_server.trace_server_interface.CompletionsCreateReq) -> weave.trace_server.trace_server_interface.CompletionsCreateRes` + +No description available. + +##### `completions_create_stream(self, req: weave.trace_server.trace_server_interface.CompletionsCreateReq) -> collections.abc.Iterator` + +No description available. + +##### `cost_create(self, req: weave.trace_server.trace_server_interface.CostCreateReq) -> weave.trace_server.trace_server_interface.CostCreateRes` + +No description available. + +##### `cost_purge(self, req: weave.trace_server.trace_server_interface.CostPurgeReq) -> weave.trace_server.trace_server_interface.CostPurgeRes` + +No description available. + +##### `cost_query(self, req: weave.trace_server.trace_server_interface.CostQueryReq) -> weave.trace_server.trace_server_interface.CostQueryRes` + +No description available. + +##### `ensure_project_exists(self, entity: str, project: str) -> weave.trace_server.trace_server_interface.EnsureProjectExistsRes` + +No description available. + +##### `evaluate_model(self, req: weave.trace_server.trace_server_interface.EvaluateModelReq) -> weave.trace_server.trace_server_interface.EvaluateModelRes` + +No description available. + +##### `evaluation_status(self, req: weave.trace_server.trace_server_interface.EvaluationStatusReq) -> weave.trace_server.trace_server_interface.EvaluationStatusRes` + +No description available. + +##### `feedback_create(self, req: weave.trace_server.trace_server_interface.FeedbackCreateReq) -> weave.trace_server.trace_server_interface.FeedbackCreateRes` + +No description available. + +##### `feedback_create_batch(self, req: weave.trace_server.trace_server_interface.FeedbackCreateBatchReq) -> weave.trace_server.trace_server_interface.FeedbackCreateBatchRes` + +No description available. + +##### `feedback_purge(self, req: weave.trace_server.trace_server_interface.FeedbackPurgeReq) -> weave.trace_server.trace_server_interface.FeedbackPurgeRes` + +No description available. + +##### `feedback_query(self, req: weave.trace_server.trace_server_interface.FeedbackQueryReq) -> weave.trace_server.trace_server_interface.FeedbackQueryRes` + +No description available. + +##### `feedback_replace(self, req: weave.trace_server.trace_server_interface.FeedbackReplaceReq) -> weave.trace_server.trace_server_interface.FeedbackReplaceRes` + +No description available. + +##### `file_content_read(self, req: weave.trace_server.trace_server_interface.FileContentReadReq) -> weave.trace_server.trace_server_interface.FileContentReadRes` + +No description available. + +##### `file_create(self, req: weave.trace_server.trace_server_interface.FileCreateReq) -> weave.trace_server.trace_server_interface.FileCreateRes` + +No description available. + +##### `files_stats(self, req: weave.trace_server.trace_server_interface.FilesStatsReq) -> weave.trace_server.trace_server_interface.FilesStatsRes` + +No description available. + +##### `image_create(self, req: weave.trace_server.trace_server_interface.ImageGenerationCreateReq) -> weave.trace_server.trace_server_interface.ImageGenerationCreateRes` + +No description available. + +##### `obj_create(self, req: weave.trace_server.trace_server_interface.ObjCreateReq) -> weave.trace_server.trace_server_interface.ObjCreateRes` + +No description available. + +##### `obj_delete(self, req: weave.trace_server.trace_server_interface.ObjDeleteReq) -> weave.trace_server.trace_server_interface.ObjDeleteRes` + +No description available. + +##### `obj_read(self, req: weave.trace_server.trace_server_interface.ObjReadReq) -> weave.trace_server.trace_server_interface.ObjReadRes` + +No description available. + +##### `objs_query(self, req: weave.trace_server.trace_server_interface.ObjQueryReq) -> weave.trace_server.trace_server_interface.ObjQueryRes` + +No description available. + +##### `op_create(self, req: weave.trace_server.trace_server_interface.OpCreateReq) -> weave.trace_server.trace_server_interface.OpCreateRes` + +No description available. + +##### `op_read(self, req: weave.trace_server.trace_server_interface.OpReadReq) -> weave.trace_server.trace_server_interface.OpReadRes` + +No description available. + +##### `ops_query(self, req: weave.trace_server.trace_server_interface.OpQueryReq) -> weave.trace_server.trace_server_interface.OpQueryRes` + +No description available. + +##### `otel_export(self, req: weave.trace_server.trace_server_interface.OtelExportReq) -> weave.trace_server.trace_server_interface.OtelExportRes` + +No description available. + +##### `project_stats(self, req: weave.trace_server.trace_server_interface.ProjectStatsReq) -> weave.trace_server.trace_server_interface.ProjectStatsRes` + +No description available. + +##### `refs_read_batch(self, req: weave.trace_server.trace_server_interface.RefsReadBatchReq) -> weave.trace_server.trace_server_interface.RefsReadBatchRes` + +No description available. + +##### `table_create(self, req: weave.trace_server.trace_server_interface.TableCreateReq) -> weave.trace_server.trace_server_interface.TableCreateRes` + +No description available. + +##### `table_create_from_digests(self, req: weave.trace_server.trace_server_interface.TableCreateFromDigestsReq) -> weave.trace_server.trace_server_interface.TableCreateFromDigestsRes` + +No description available. + +##### `table_query(self, req: weave.trace_server.trace_server_interface.TableQueryReq) -> weave.trace_server.trace_server_interface.TableQueryRes` + +No description available. + +##### `table_query_stats(self, req: weave.trace_server.trace_server_interface.TableQueryStatsReq) -> weave.trace_server.trace_server_interface.TableQueryStatsRes` + +No description available. + +##### `table_query_stats_batch(self, req: weave.trace_server.trace_server_interface.TableQueryStatsBatchReq) -> weave.trace_server.trace_server_interface.TableQueryStatsBatchRes` + +No description available. + +##### `table_query_stream(self, req: weave.trace_server.trace_server_interface.TableQueryReq) -> collections.abc.Iterator` + +No description available. + +##### `table_update(self, req: weave.trace_server.trace_server_interface.TableUpdateReq) -> weave.trace_server.trace_server_interface.TableUpdateRes` + +No description available. + +##### `threads_query_stream(self, req: weave.trace_server.trace_server_interface.ThreadsQueryReq) -> collections.abc.Iterator` + +No description available. + +### TraceStatus + +An enumeration. + +### WeaveClient + +No description available. + +#### Methods + +##### `__init__(self, entity: 'str', project: 'str', server: 'TraceServerInterface', ensure_project_exists: 'bool' = True)` + +Initialize self. See help(type(self)) for accurate signature. + +##### `add_cost(self, llm_id: 'str', prompt_token_cost: 'float', completion_token_cost: 'float', effective_date: 'datetime.datetime | None' = None, prompt_token_cost_unit: 'str | None' = 'USD', completion_token_cost_unit: 'str | None' = 'USD', provider_id: 'str | None' = 'default') -> 'CostCreateRes'` + +Add a cost to the current project. + +Examples: + ```python + client.add_cost(llm_id="my_expensive_custom_model", prompt_token_cost=1, completion_token_cost=2) + client.add_cost(llm_id="my_expensive_custom_model", prompt_token_cost=500, completion_token_cost=1000, effective_date=datetime(1998, 10, 3)) + ``` + +Args: + llm_id: The ID of the LLM. eg "gpt-4o-mini-2024-07-18" + prompt_token_cost: The cost per prompt token. eg .0005 + completion_token_cost: The cost per completion token. eg .0015 + effective_date: Defaults to the current date. A datetime.datetime object. + provider_id: The provider of the LLM. Defaults to "default". eg "openai" + prompt_token_cost_unit: The unit of the cost for the prompt tokens. Defaults to "USD". (Currently unused, will be used in the future to specify the currency type for the cost eg "tokens" or "time") + completion_token_cost_unit: The unit of the cost for the completion tokens. Defaults to "USD". (Currently unused, will be used in the future to specify the currency type for the cost eg "tokens" or "time") + +Returns: + A CostCreateRes object. + Which has one field called a list of tuples called ids. + Each tuple contains the llm_id and the id of the created cost object. + +##### `call(self, call_id: 'str', include_costs: 'bool' = False) -> 'WeaveObject'` + +No description available. + +##### `calls(self, filter: 'CallsFilter | None' = None, include_costs: 'bool' = False) -> 'CallsIter'` + +No description available. + +##### `create_call(self, op: 'str | Op', inputs: 'dict[str, Any]', parent: 'Call | None' = None, attributes: 'dict[str, Any] | None' = None, display_name: 'str | Callable[[Call], str] | None' = None, *, use_stack: 'bool' = True, _call_id_override: 'str | None' = None) -> 'Call'` + +Create, log, and push a call onto the runtime stack. + +Args: + op: The operation producing the call, or the name of an anonymous operation. + inputs: The inputs to the operation. + parent: The parent call. If parent is not provided, the current run is used as the parent. + display_name: The display name for the call. Defaults to None. + attributes: The attributes for the call. Defaults to None. + use_stack: Whether to push the call onto the runtime stack. Defaults to True. + +Returns: + The created Call object. + +##### `delete_all_object_versions(self, object_name: 'str') -> 'int'` + +Delete all versions of an object. + +Args: + object_name: The name of the object whose versions should be deleted. + +Returns: + The number of versions deleted. + +##### `delete_all_op_versions(self, op_name: 'str') -> 'int'` + +Delete all versions of an op. + +Args: + op_name: The name of the op whose versions should be deleted. + +Returns: + The number of versions deleted. + +##### `delete_call(self, call: 'Call') -> 'None'` + +No description available. + +##### `delete_calls(self, call_ids: 'list[str]') -> 'None'` + +Delete calls by their IDs. + +Deleting a call will also delete all of its children. + +Args: + call_ids: A list of call IDs to delete. Ex: ["2F0193e107-8fcf-7630-b576-977cc3062e2e"] + +##### `delete_object_version(self, object: 'ObjectRef') -> 'None'` + +No description available. + +##### `delete_object_versions(self, object_name: 'str', digests: 'list[str]') -> 'int'` + +Delete specific versions of an object. + +Args: + object_name: The name of the object whose versions should be deleted. + digests: List of digests to delete. Can include aliases like "latest" or "v0". + +Returns: + The number of versions deleted. + +##### `delete_op_version(self, op: 'OpRef') -> 'None'` + +No description available. + +##### `fail_call(self, call: 'Call', exception: 'BaseException') -> 'None'` + +Fail a call with an exception. This is a convenience method for finish_call. + +##### `feedback(self, query: 'Query | str | None' = None, *, reaction: 'str | None' = None, offset: 'int' = 0, limit: 'int' = 100) -> 'FeedbackQuery'` + +No description available. + +##### `finish(self, use_progress_bar: 'bool' = True, callback: 'Callable[[FlushStatus], None] | None' = None) -> 'None'` + +Flushes all background tasks to ensure they are processed. + +This method blocks until all currently enqueued jobs are processed, +displaying a progress bar to show the status of the pending tasks. +It ensures parallel processing during main thread execution and can +improve performance when user code completes before data has been +uploaded to the server. + +Args: + use_progress_bar: Whether to display a progress bar during flush. + Set to False for environments where a progress bar + would not render well (e.g., CI environments). + callback: Optional callback function that receives status updates. + Overrides use_progress_bar. + +##### `finish_call(self, call: 'Call', output: 'Any' = None, exception: 'BaseException | None' = None, *, op: 'Op | None' = None) -> 'None'` + +Finalize a call and persist its results. + +Any values present in ``call.summary`` are deep-merged with computed +summary statistics (e.g. usage and status counts) before being written +to the database. + +##### `flush(self) -> 'None'` + +Flushes background asynchronous tasks, safe to call multiple times. + +##### `get(self, ref: 'ObjectRef', *, objectify: 'bool' = True) -> 'Any'` + +No description available. + +##### `get_call(self, call_id: 'str', include_costs: 'bool' = False, include_feedback: 'bool' = False, columns: 'list[str] | None' = None) -> 'WeaveObject'` + +Get a single call by its ID. + +Args: + call_id: The ID of the call to get. + include_costs: If true, cost info is included at summary.weave + include_feedback: If true, feedback info is included at summary.weave.feedback + columns: A list of columns to include in the response. If None, + all columns are included. Specifying fewer columns may be more performant. + Some columns are always included: id, project_id, trace_id, op_name, started_at + +Returns: + A call object. + +##### `get_calls(self, *, filter: 'CallsFilterLike | None' = None, limit: 'int | None' = None, offset: 'int | None' = None, sort_by: 'list[SortByLike] | None' = None, query: 'QueryLike | None' = None, include_costs: 'bool' = False, include_feedback: 'bool' = False, columns: 'list[str] | None' = None, expand_columns: 'list[str] | None' = None, return_expanded_column_values: 'bool' = True, scored_by: 'str | list[str] | None' = None, page_size: 'int' = 1000) -> 'CallsIter'` + +Retrieve a list of traced calls (operations) for this project. + +This method provides a powerful and flexible interface for querying trace data. +It supports pagination, filtering, sorting, field projection, and scoring metadata, +and can be used to power custom trace UIs or analysis tools. + +Performance Tip: Specify `columns` and use `filter` or `query` to reduce result size. + +Args: + `filter`: High-level filter for narrowing results by fields like `op_name`, `parent_ids`, etc. + `limit`: Maximum number of calls to return. + `offset`: Number of calls to skip before returning results (used for pagination). + `sort_by`: List of fields to sort the results by (e.g., `started_at desc`). + `query`: A mongo-like expression for advanced filtering. Not all Mongo operators are supported. + `include_costs`: If True, includes token/cost info in `summary.weave`. + `include_feedback`: If True, includes feedback in `summary.weave.feedback`. + `columns`: List of fields to return per call. Reducing this can significantly improve performance. + (Some fields like `id`, `trace_id`, `op_name`, and `started_at` are always included.) + `scored_by`: Filter by one or more scorers (name or ref URI). Multiple scorers are AND-ed. + `page_size`: Number of calls fetched per page. Tune this for performance in large queries. + +Returns: + `CallsIter`: An iterator over `Call` objects. Supports slicing, iteration, and `.to_pandas()`. + +Example: + ```python + calls = client.get_calls( + filter=CallsFilter(op_names=["my_op"]), + columns=["inputs", "output", "summary"], + limit=100, + ) + for call in calls: + print(call.inputs, call.output) + ``` + +##### `get_evaluation(self, uri: 'str') -> 'Evaluation'` + +Retrieve a specific Evaluation object by its URI. + +Evaluation URIs typically follow the format: +`weave:///entity/project/object/Evaluation:version` + +You can also get the evaluation by its "friendly" name: +get_evaluation("Evaluation:v1") + +Args: + uri (str): The unique resource identifier of the evaluation to retrieve. + +Returns: + Evaluation: The Evaluation object corresponding to the provided URI. + +Raises: + TypeError: If the object at the URI is not an Evaluation instance. + ValueError: If the URI is invalid or the object cannot be found. + +Examples: + ```python + client = weave.init("my-project") + evaluation = client.get_evaluation("weave:///entity/project/object/my-eval:v1") + print(evaluation.name) + ``` + +##### `get_evaluations(self) -> 'list[Evaluation]'` + +Retrieve all Evaluation objects from the current project. + +Returns: + list[Evaluation]: A list of all Evaluation objects in the current project. + Empty list if no evaluations are found or if all conversions fail. + +Examples: + ```python + client = weave.init("my-project") + evaluations = client.get_evaluations() + print(f"Found {len(evaluations)} evaluations") + for eval in evaluations: + print(f"Evaluation: {eval.name}") + ``` + +##### `get_feedback(self, query: 'Query | str | None' = None, *, reaction: 'str | None' = None, offset: 'int' = 0, limit: 'int' = 100) -> 'FeedbackQuery'` + +Query project for feedback. + +Examples: + ```python + # Fetch a specific feedback object. + # Note that this still returns a collection, which is expected + # to contain zero or one item(s). + client.get_feedback("1B4082A3-4EDA-4BEB-BFEB-2D16ED59AA07") + + # Find all feedback objects with a specific reaction. + client.get_feedback(reaction="👍", limit=10) + + # Find all feedback objects with a specific feedback type with + # mongo-style query. + from weave.trace_server.interface.query import Query + + query = Query( + **{ + "$expr": { + "$eq": [ + {"$getField": "feedback_type"}, + {"$literal": "wandb.reaction.1"}, + ], + } + } + ) + client.get_feedback(query=query) + ``` + +Args: + query: A mongo-style query expression. For convenience, also accepts a feedback UUID string. + reaction: For convenience, filter by a particular reaction emoji. + offset: The offset to start fetching feedback objects from. + limit: The maximum number of feedback objects to fetch. + +Returns: + A FeedbackQuery object. + +##### `purge_costs(self, ids: 'list[str] | str') -> 'None'` + +Purge costs from the current project. + +Examples: + ```python + client.purge_costs([ids]) + client.purge_costs(ids) + ``` + +Args: + ids: The cost IDs to purge. Can be a single ID or a list of IDs. + +##### `query_costs(self, query: 'Query | str | None' = None, llm_ids: 'list[str] | None' = None, offset: 'int' = 0, limit: 'int' = 100) -> 'list[CostQueryOutput]'` + +Query project for costs. + +Examples: + ```python + # Fetch a specific cost object. + # Note that this still returns a collection, which is expected + # to contain zero or one item(s). + client.query_costs("1B4082A3-4EDA-4BEB-BFEB-2D16ED59AA07") + + # Find all cost objects with a specific reaction. + client.query_costs(llm_ids=["gpt-4o-mini-2024-07-18"], limit=10) + ``` + +Args: + query: A mongo-style query expression. For convenience, also accepts a cost UUID string. + llm_ids: For convenience, filter for a set of llm_ids. + offset: The offset to start fetching cost objects from. + limit: The maximum number of cost objects to fetch. + +Returns: + A CostQuery object. + +##### `save(self, val: 'Any', name: 'str', branch: 'str' = 'latest') -> 'Any'` + +Do not call directly, use weave.publish() instead. + +Args: + val: The object to save. + name: The name to save the object under. + branch: The branch to save the object under. Defaults to "latest". + +Returns: + A deserialized version of the saved object. + +### WeaveClientSendFileCache + +Cache for file create requests and responses with LRU eviction policy. + +#### Methods + +##### `__init__(self, max_size: int = 1000) -> None` + +Initialize the file cache with a maximum size. + +Args: + max_size: Maximum number of items to store in the cache. + If set to 0, cache size is unlimited. + +##### `clear(self) -> None` + +Clear all items from the cache. + +##### `get(self, req: weave.trace_server.trace_server_interface.FileCreateReq) -> Optional[concurrent.futures._base.Future[weave.trace_server.trace_server_interface.FileCreateRes]]` + +Get a cached response for a file create request. + +Returns None if the request is not in the cache. + +##### `put(self, req: weave.trace_server.trace_server_interface.FileCreateReq, res: concurrent.futures._base.Future) -> None` + +Cache a response for a file create request. + +##### `size(self) -> int` + +Return the current number of items in the cache. + +### WeaveObject + +No description available. + +#### Methods + +##### `__init__(self, val: Any, ref: Optional[weave.trace.refs.RefWithExtra], server: weave.trace_server.trace_server_interface.TraceServerInterface, root: Optional[weave.trace.vals.Traceable], parent: Optional[weave.trace.vals.Traceable] = None) -> None` + +Initialize self. See help(type(self)) for accurate signature. + +##### `add_mutation(self, path: tuple, operation: Union[Literal['setitem'], Literal['setattr'], Literal['append']], *args: Any) -> None` + +No description available. + +##### `save(self) -> weave.trace.refs.ObjectRef` + +No description available. + +##### `unwrap(self) -> Any` + +No description available. + +### WeaveTable + +No description available. + +#### Methods + +##### `__init__(self, server: weave.trace_server.trace_server_interface.TraceServerInterface, table_ref: Optional[weave.trace.refs.TableRef] = None, ref: Optional[weave.trace.refs.RefWithExtra] = None, filter: Optional[weave.trace_server.trace_server_interface.TableRowFilter] = None, root: Optional[weave.trace.vals.Traceable] = None, parent: Optional[weave.trace.vals.Traceable] = None) -> None` + +Initialize self. See help(type(self)) for accurate signature. + +##### `add_mutation(self, path: tuple, operation: Union[Literal['setitem'], Literal['setattr'], Literal['append']], *args: Any) -> None` + +No description available. + +##### `append(self, val: dict) -> None` + +No description available. + +##### `pop(self, index: int) -> None` + +No description available. + +##### `save(self) -> weave.trace.refs.ObjectRef` + +No description available. + +##### `set_prefetched_rows(self, prefetched_rows: list) -> None` + +Sets the rows to a local cache of rows that can be used to +avoid a remote call. Should only be used by internal code. + +It is expected that these rows are the exact same rows that would +be returned by a query for this table. Failing to meet this expectation +will cause table operations to behave unexpectedly. + +##### `unwrap(self) -> Any` + +No description available. + +### cached_property + +No description available. + +#### Methods + +##### `__init__(self, func)` + +Initialize self. See help(type(self)) for accurate signature. + diff --git a/weave/reference/python-sdk/weave/trace_server/trace_server_interface.mdx b/weave/reference/python-sdk/weave/trace_server/trace_server_interface.mdx new file mode 100644 index 0000000000..ba11e1404d --- /dev/null +++ b/weave/reference/python-sdk/weave/trace_server/trace_server_interface.mdx @@ -0,0 +1,36060 @@ +--- +title: weave.trace_server.trace_server_interface +--- + +# weave.trace_server.trace_server_interface + +## Functions + +### `Field(default: 'Any' = PydanticUndefined, *, default_factory: 'Callable[[], Any] | Callable[[dict[str, Any]], Any] | None' = PydanticUndefined, alias: 'str | None' = PydanticUndefined, alias_priority: 'int | None' = PydanticUndefined, validation_alias: 'str | AliasPath | AliasChoices | None' = PydanticUndefined, serialization_alias: 'str | None' = PydanticUndefined, title: 'str | None' = PydanticUndefined, field_title_generator: 'Callable[[str, FieldInfo], str] | None' = PydanticUndefined, description: 'str | None' = PydanticUndefined, examples: 'list[Any] | None' = PydanticUndefined, exclude: 'bool | None' = PydanticUndefined, discriminator: 'str | types.Discriminator | None' = PydanticUndefined, deprecated: 'Deprecated | str | bool | None' = PydanticUndefined, json_schema_extra: 'JsonDict | Callable[[JsonDict], None] | None' = PydanticUndefined, frozen: 'bool | None' = PydanticUndefined, validate_default: 'bool | None' = PydanticUndefined, repr: 'bool' = PydanticUndefined, init: 'bool | None' = PydanticUndefined, init_var: 'bool | None' = PydanticUndefined, kw_only: 'bool | None' = PydanticUndefined, pattern: 'str | typing.Pattern[str] | None' = PydanticUndefined, strict: 'bool | None' = PydanticUndefined, coerce_numbers_to_str: 'bool | None' = PydanticUndefined, gt: 'annotated_types.SupportsGt | None' = PydanticUndefined, ge: 'annotated_types.SupportsGe | None' = PydanticUndefined, lt: 'annotated_types.SupportsLt | None' = PydanticUndefined, le: 'annotated_types.SupportsLe | None' = PydanticUndefined, multiple_of: 'float | None' = PydanticUndefined, allow_inf_nan: 'bool | None' = PydanticUndefined, max_digits: 'int | None' = PydanticUndefined, decimal_places: 'int | None' = PydanticUndefined, min_length: 'int | None' = PydanticUndefined, max_length: 'int | None' = PydanticUndefined, union_mode: "Literal['smart', 'left_to_right']" = PydanticUndefined, fail_fast: 'bool | None' = PydanticUndefined, **extra: 'Unpack[_EmptyKwargs]') -> 'Any'` + +!!! abstract "Usage Documentation" + Fields + +Create a field for objects that can be configured. + +Used to provide extra information about a field, either for the model schema or complex validation. Some arguments +apply only to number fields (`int`, `float`, `Decimal`) and some apply only to `str`. + +Note: + - Any `_Unset` objects will be replaced by the corresponding value defined in the `_DefaultValues` dictionary. If a key for the `_Unset` object is not found in the `_DefaultValues` dictionary, it will default to `None` + +Args: + default: Default value if the field is not set. + default_factory: A callable to generate the default value. The callable can either take 0 arguments + (in which case it is called as is) or a single argument containing the already validated data. + alias: The name to use for the attribute when validating or serializing by alias. + This is often used for things like converting between snake and camel case. + alias_priority: Priority of the alias. This affects whether an alias generator is used. + validation_alias: Like `alias`, but only affects validation, not serialization. + serialization_alias: Like `alias`, but only affects serialization, not validation. + title: Human-readable title. + field_title_generator: A callable that takes a field name and returns title for it. + description: Human-readable description. + examples: Example values for this field. + exclude: Whether to exclude the field from the model serialization. + discriminator: Field name or Discriminator for discriminating the type in a tagged union. + deprecated: A deprecation message, an instance of `warnings.deprecated` or the `typing_extensions.deprecated` backport, + or a boolean. If `True`, a default deprecation message will be emitted when accessing the field. + json_schema_extra: A dict or callable to provide extra JSON schema properties. + frozen: Whether the field is frozen. If true, attempts to change the value on an instance will raise an error. + validate_default: If `True`, apply validation to the default value every time you create an instance. + Otherwise, for performance reasons, the default value of the field is trusted and not validated. + repr: A boolean indicating whether to include the field in the `__repr__` output. + init: Whether the field should be included in the constructor of the dataclass. + (Only applies to dataclasses.) + init_var: Whether the field should _only_ be included in the constructor of the dataclass. + (Only applies to dataclasses.) + kw_only: Whether the field should be a keyword-only argument in the constructor of the dataclass. + (Only applies to dataclasses.) + coerce_numbers_to_str: Whether to enable coercion of any `Number` type to `str` (not applicable in `strict` mode). + strict: If `True`, strict validation is applied to the field. + See Strict Mode for details. + gt: Greater than. If set, value must be greater than this. Only applicable to numbers. + ge: Greater than or equal. If set, value must be greater than or equal to this. Only applicable to numbers. + lt: Less than. If set, value must be less than this. Only applicable to numbers. + le: Less than or equal. If set, value must be less than or equal to this. Only applicable to numbers. + multiple_of: Value must be a multiple of this. Only applicable to numbers. + min_length: Minimum length for iterables. + max_length: Maximum length for iterables. + pattern: Pattern for strings (a regular expression). + allow_inf_nan: Allow `inf`, `-inf`, `nan`. Only applicable to float and [`Decimal`][decimal.Decimal] numbers. + max_digits: Maximum number of allow digits for strings. + decimal_places: Maximum number of decimal places allowed for numbers. + union_mode: The strategy to apply when validating a union. Can be `smart` (the default), or `left_to_right`. + See Union Mode for details. + fail_fast: If `True`, validation will stop on the first error. If `False`, all validation errors will be collected. + This option can be applied only to iterable types (list, tuple, set, and frozenset). + extra: (Deprecated) Extra fields that will be included in the JSON schema. + + !!! warning Deprecated + The `extra` kwargs is deprecated. Use `json_schema_extra` instead. + +Returns: + A new [`FieldInfo`][pydantic.fields.FieldInfo]. The return annotation is `Any` so `Field` can be used on + type-annotated fields without causing a type error. + +### `field_serializer(*fields: 'str', mode: "Literal['plain', 'wrap']" = 'plain', return_type: 'Any' = PydanticUndefined, when_used: 'WhenUsed' = 'always', check_fields: 'bool | None' = None) -> 'Callable[[_FieldWrapSerializerT], _FieldWrapSerializerT] | Callable[[_FieldPlainSerializerT], _FieldPlainSerializerT]'` + +Decorator that enables custom field serialization. + +In the below example, a field of type `set` is used to mitigate duplication. A `field_serializer` is used to serialize the data as a sorted list. + +```python +from typing import Set + +from pydantic import BaseModel, field_serializer + +class StudentModel(BaseModel): + name: str = 'Jane' + courses: Set[str] + + @field_serializer('courses', when_used='json') + def serialize_courses_in_order(self, courses: Set[str]): + return sorted(courses) + +student = StudentModel(courses={'Math', 'Chemistry', 'English'}) +print(student.model_dump_json()) +#> {"name":"Jane","courses":["Chemistry","English","Math"]} +``` + +See Custom serializers for more information. + +Four signatures are supported: + +- `(self, value: Any, info: FieldSerializationInfo)` +- `(self, value: Any, nxt: SerializerFunctionWrapHandler, info: FieldSerializationInfo)` +- `(value: Any, info: SerializationInfo)` +- `(value: Any, nxt: SerializerFunctionWrapHandler, info: SerializationInfo)` + +Args: + fields: Which field(s) the method should be called on. + mode: The serialization mode. + + - `plain` means the function will be called instead of the default serialization logic, + - `wrap` means the function will be called with an argument to optionally call the + default serialization logic. + return_type: Optional return type for the function, if omitted it will be inferred from the type annotation. + when_used: Determines the serializer will be used for serialization. + check_fields: Whether to check that the fields actually exist on the model. + +Returns: + The decorator function. + +## Classes + +### ActionsExecuteBatchReq + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### ActionsExecuteBatchRes + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### BaseModel + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### BaseModelStrict + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### CallBatchEndMode + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### CallBatchStartMode + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### CallCreateBatchReq + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### CallCreateBatchRes + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### CallEndReq + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### CallEndRes + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### CallReadReq + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### CallReadRes + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### CallSchema + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `serialize_typed_dicts(self, v: dict) -> dict` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### CallStartReq + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### CallStartRes + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### CallUpdateReq + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### CallUpdateRes + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### CallsDeleteReq + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### CallsDeleteRes + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### CallsFilter + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### CallsQueryReq + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### CallsQueryRes + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### CallsQueryStatsReq + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### CallsQueryStatsRes + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### CompletionsCreateReq + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### CompletionsCreateRequestInputs + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### CompletionsCreateRes + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### ConfigDict + +A TypedDict for configuring Pydantic behaviour. + +### CostCreateInput + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### CostCreateReq + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### CostCreateRes + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### CostPurgeReq + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### CostPurgeRes + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### CostQueryOutput + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### CostQueryReq + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### CostQueryRes + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### EndedCallSchemaForInsert + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `serialize_typed_dicts(self, v: dict) -> dict` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### EnsureProjectExistsRes + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### Enum + +Generic enumeration. + +Derive from this class to define new enumerations. + +### EvaluateModelReq + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### EvaluateModelRes + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### EvaluationStatusComplete + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### EvaluationStatusFailed + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### EvaluationStatusNotFound + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### EvaluationStatusReq + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### EvaluationStatusRes + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### EvaluationStatusRunning + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### ExportTracePartialSuccess + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### ExtraKeysTypedDict + +dict() -> new empty dictionary +dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs +dict(iterable) -> new dictionary initialized as if via: + d = \{\} + for k, v in iterable: + d[k] = v +dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + +### Feedback + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### FeedbackCreateBatchReq + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### FeedbackCreateBatchRes + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### FeedbackCreateReq + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### FeedbackCreateRes + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### FeedbackDict + +dict() -> new empty dictionary +dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs +dict(iterable) -> new dictionary initialized as if via: + d = \{\} + for k, v in iterable: + d[k] = v +dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + +### FeedbackPurgeReq + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### FeedbackPurgeRes + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### FeedbackQueryReq + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### FeedbackQueryRes + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### FeedbackReplaceReq + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### FeedbackReplaceRes + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### FileContentReadReq + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### FileContentReadRes + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### FileCreateReq + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### FileCreateRes + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### FilesStatsReq + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### FilesStatsRes + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### ImageGenerationCreateReq + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### ImageGenerationCreateRes + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### ImageGenerationRequestInputs + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### Iterator + +No description available. + +### LLMCostSchema + +dict() -> new empty dictionary +dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs +dict(iterable) -> new dictionary initialized as if via: + d = \{\} + for k, v in iterable: + d[k] = v +dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + +### LLMUsageSchema + +dict() -> new empty dictionary +dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs +dict(iterable) -> new dictionary initialized as if via: + d = \{\} + for k, v in iterable: + d[k] = v +dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + +### ObjCreateReq + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### ObjCreateRes + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### ObjDeleteReq + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### ObjDeleteRes + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### ObjQueryReq + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### ObjQueryRes + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### ObjReadReq + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### ObjReadRes + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### ObjSchema + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### ObjSchemaForInsert + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, _ObjSchemaForInsert__context: Any) -> None` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### ObjectVersionFilter + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### OpCreateReq + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### OpCreateRes + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### OpQueryReq + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### OpQueryRes + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### OpReadReq + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### OpReadRes + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### OpVersionFilter + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### OtelExportReq + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### OtelExportRes + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### ProjectStatsReq + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### ProjectStatsRes + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### Protocol + +Base class for protocol classes. + +Protocol classes are defined as:: + + class Proto(Protocol): + def meth(self) -> int: + ... + +Such classes are primarily used with static type checkers that recognize +structural subtyping (static duck-typing), for example:: + + class C: + def meth(self) -> int: + return 0 + + def func(x: Proto) -> int: + return x.meth() + + func(C()) # Passes static type check + +See PEP 544 for details. Protocol classes decorated with +@typing.runtime_checkable act as simple-minded runtime protocols that check +only the presence of given attributes, ignoring their type signatures. +Protocol classes can be generic, they are defined as:: + + class GenProto(Protocol[T]): + def meth(self) -> T: + ... + +### Query + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### RefsReadBatchReq + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### RefsReadBatchRes + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### SortBy + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### StartedCallSchemaForInsert + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### SummaryInsertMap + +dict() -> new empty dictionary +dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs +dict(iterable) -> new dictionary initialized as if via: + d = \{\} + for k, v in iterable: + d[k] = v +dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + +### SummaryMap + +dict() -> new empty dictionary +dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs +dict(iterable) -> new dictionary initialized as if via: + d = \{\} + for k, v in iterable: + d[k] = v +dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + +### TableAppendSpec + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### TableAppendSpecPayload + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### TableCreateFromDigestsReq + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### TableCreateFromDigestsRes + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### TableCreateReq + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### TableCreateRes + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### TableInsertSpec + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### TableInsertSpecPayload + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### TablePopSpec + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### TablePopSpecPayload + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### TableQueryReq + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### TableQueryRes + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### TableQueryStatsBatchReq + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### TableQueryStatsBatchRes + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### TableQueryStatsReq + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### TableQueryStatsRes + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### TableRowFilter + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### TableRowSchema + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### TableSchemaForInsert + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### TableStatsRow + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### TableUpdateReq + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### TableUpdateRes + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### ThreadSchema + +!!! abstract "Usage Documentation" + Models + +A base class for creating Pydantic models. + +Attributes: + __class_vars__: The names of the class variables defined on the model. + __private_attributes__: Metadata about the private attributes of the model. + __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. + + __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. + __pydantic_core_schema__: The core schema of the model. + __pydantic_custom_init__: Whether the model has a custom `__init__` function. + __pydantic_decorators__: Metadata containing the decorators defined on the model. + This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. + __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to + __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. + __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. + __pydantic_post_init__: The name of the post-init method for the model, if defined. + __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. + __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. + __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. + + __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. + __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. + + __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] + is set to `'allow'`. + __pydantic_fields_set__: The names of fields explicitly set during instantiation. + __pydantic_private__: Values of private attributes set on the model instance. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### ThreadsQueryFilter + +Base model with strict validation that forbids extra fields. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### ThreadsQueryReq + +Query threads with aggregated statistics based on turn calls only. + +Turn calls are the immediate children of thread contexts (where call.id == turn_id). +This provides meaningful conversation-level statistics rather than including all +nested implementation details. + +#### Methods + +##### `__init__(self, /, **data: 'Any') -> 'None'` + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +`self` is explicitly positional-only to allow `self` as a field name. + +##### `construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +No description available. + +##### `copy(self, *, include: 'AbstractSetIntStr | MappingIntStrAny | None' = None, exclude: 'AbstractSetIntStr | MappingIntStrAny | None' = None, update: 'Dict[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +Returns a copy of the model. + +!!! warning "Deprecated" + This method is now deprecated; use `model_copy` instead. + +If you need `include` or `exclude`, use: + +```python {test="skip" lint="skip"} +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +``` + +Args: + include: Optional set or mapping specifying which fields to include in the copied model. + exclude: Optional set or mapping specifying which fields to exclude in the copied model. + update: Optional dictionary of field-value pairs to override field values in the copied model. + deep: If True, the values of fields that are Pydantic models will be deep-copied. + +Returns: + A copy of the model with included, excluded and updated fields as specified. + +##### `dict(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False) -> 'Dict[str, Any]'` + +No description available. + +##### `from_orm(obj: 'Any') -> 'Self'` + +No description available. + +##### `json(self, *, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, encoder: 'Callable[[Any], Any] | None' = PydanticUndefined, models_as_dict: 'bool' = PydanticUndefined, **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `model_construct(_fields_set: 'set[str] | None' = None, **values: 'Any') -> 'Self'` + +Creates a new instance of the `Model` class with validated data. + +Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note + `model_construct()` generally respects the `model_config.extra` setting on the provided model. + That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` + and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. + Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in + an error if extra values are passed, but they will be ignored. + +Args: + _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the `values` argument will be used. + values: Trusted or pre-validated data dictionary. + +Returns: + A new instance of the `Model` class with validated data. + +##### `model_copy(self, *, update: 'Mapping[str, Any] | None' = None, deep: 'bool' = False) -> 'Self'` + +!!! abstract "Usage Documentation" + `model_copy` + +Returns a copy of the model. + +!!! note + The underlying instance's [`__dict__`][object.__dict__] attribute is copied. This + might have unexpected side effects if you store anything in it, on top of the model + fields (e.g. the value of [cached properties][functools.cached_property]). + +Args: + update: Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + deep: Set to `True` to make a deep copy of the model. + +Returns: + New model instance. + +##### `model_dump(self, *, mode: "Literal['json', 'python'] | str" = 'python', include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'dict[str, Any]'` + +!!! abstract "Usage Documentation" + `model_dump` + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A dictionary representation of the model. + +##### `model_dump_json(self, *, indent: 'int | None' = None, include: 'IncEx | None' = None, exclude: 'IncEx | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: "bool | Literal['none', 'warn', 'error']" = True, fallback: 'Callable[[Any], Any] | None' = None, serialize_as_any: 'bool' = False) -> 'str'` + +!!! abstract "Usage Documentation" + `model_dump_json` + +Generates a JSON representation of the model using Pydantic's `to_json` method. + +Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. + exclude: Field(s) to exclude from the JSON output. + context: Additional context to pass to the serializer. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + +Returns: + A JSON string representation of the model. + +##### `model_json_schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', schema_generator: 'type[GenerateJsonSchema]' = , mode: 'JsonSchemaMode' = 'validation') -> 'dict[str, Any]'` + +Generates a JSON schema for a model class. + +Args: + by_alias: Whether to use attribute aliases or not. + ref_template: The reference template. + schema_generator: To override the logic used to generate the JSON schema, as a subclass of + `GenerateJsonSchema` with your desired modifications + mode: The mode in which to generate the schema. + +Returns: + The JSON schema for the given model class. + +##### `model_parametrized_name(params: 'tuple[type[Any], ...]') -> 'str'` + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +Args: + params: Tuple of types of the class. Given a generic class + `Model` with 2 type variables and a concrete model `Model[str, int]`, + the value `(str, int)` would be passed to `params`. + +Returns: + String representing the new class where `params` are passed to `cls` as type variables. + +Raises: + TypeError: Raised when trying to generate concrete names for non-generic models. + +##### `model_post_init(self, context: 'Any', /) -> 'None'` + +Override this method to perform additional initialization after `__init__` and `model_construct`. +This is useful if you want to do some validation that requires the entire model to be initialized. + +##### `model_rebuild(*, force: 'bool' = False, raise_errors: 'bool' = True, _parent_namespace_depth: 'int' = 2, _types_namespace: 'MappingNamespace | None' = None) -> 'bool | None'` + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +Args: + force: Whether to force the rebuilding of the model schema, defaults to `False`. + raise_errors: Whether to raise errors, defaults to `True`. + _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. + _types_namespace: The types namespace, defaults to `None`. + +Returns: + Returns `None` if the schema is already "complete" and rebuilding was not required. + If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. + +##### `model_validate(obj: 'Any', *, strict: 'bool | None' = None, from_attributes: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate a pydantic model instance. + +Args: + obj: The object to validate. + strict: Whether to enforce types strictly. + from_attributes: Whether to extract data from object attributes. + context: Additional context to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Raises: + ValidationError: If the object could not be validated. + +Returns: + The validated model instance. + +##### `model_validate_json(json_data: 'str | bytes | bytearray', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +!!! abstract "Usage Documentation" + JSON Parsing + +Validate the given JSON data against the Pydantic model. + +Args: + json_data: The JSON data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +Raises: + ValidationError: If `json_data` is not a JSON string or the object could not be validated. + +##### `model_validate_strings(obj: 'Any', *, strict: 'bool | None' = None, context: 'Any | None' = None, by_alias: 'bool | None' = None, by_name: 'bool | None' = None) -> 'Self'` + +Validate the given object with string data against the Pydantic model. + +Args: + obj: The object containing string data to validate. + strict: Whether to enforce types strictly. + context: Extra variables to pass to the validator. + by_alias: Whether to use the field's alias when validating against the provided input data. + by_name: Whether to use the field's name when validating against the provided input data. + +Returns: + The validated Pydantic model. + +##### `parse_file(path: 'str | Path', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `parse_obj(obj: 'Any') -> 'Self'` + +No description available. + +##### `parse_raw(b: 'str | bytes', *, content_type: 'str | None' = None, encoding: 'str' = 'utf8', proto: 'DeprecatedParseProtocol | None' = None, allow_pickle: 'bool' = False) -> 'Self'` + +No description available. + +##### `schema(by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}') -> 'Dict[str, Any]'` + +No description available. + +##### `schema_json(*, by_alias: 'bool' = True, ref_template: 'str' = '#/$defs/{model}', **dumps_kwargs: 'Any') -> 'str'` + +No description available. + +##### `update_forward_refs(**localns: 'Any') -> 'None'` + +No description available. + +##### `validate(value: 'Any') -> 'Self'` + +No description available. + +### TraceServerInterface + +Base class for protocol classes. + +Protocol classes are defined as:: + + class Proto(Protocol): + def meth(self) -> int: + ... + +Such classes are primarily used with static type checkers that recognize +structural subtyping (static duck-typing), for example:: + + class C: + def meth(self) -> int: + return 0 + + def func(x: Proto) -> int: + return x.meth() + + func(C()) # Passes static type check + +See PEP 544 for details. Protocol classes decorated with +@typing.runtime_checkable act as simple-minded runtime protocols that check +only the presence of given attributes, ignoring their type signatures. +Protocol classes can be generic, they are defined as:: + + class GenProto(Protocol[T]): + def meth(self) -> T: + ... + +#### Methods + +##### `_no_init(self, *args, **kwargs)` + +No description available. + +##### `actions_execute_batch(self, req: weave.trace_server.trace_server_interface.ActionsExecuteBatchReq) -> weave.trace_server.trace_server_interface.ActionsExecuteBatchRes` + +No description available. + +##### `call_end(self, req: weave.trace_server.trace_server_interface.CallEndReq) -> weave.trace_server.trace_server_interface.CallEndRes` + +No description available. + +##### `call_read(self, req: weave.trace_server.trace_server_interface.CallReadReq) -> weave.trace_server.trace_server_interface.CallReadRes` + +No description available. + +##### `call_start(self, req: weave.trace_server.trace_server_interface.CallStartReq) -> weave.trace_server.trace_server_interface.CallStartRes` + +No description available. + +##### `call_start_batch(self, req: weave.trace_server.trace_server_interface.CallCreateBatchReq) -> weave.trace_server.trace_server_interface.CallCreateBatchRes` + +No description available. + +##### `call_update(self, req: weave.trace_server.trace_server_interface.CallUpdateReq) -> weave.trace_server.trace_server_interface.CallUpdateRes` + +No description available. + +##### `calls_delete(self, req: weave.trace_server.trace_server_interface.CallsDeleteReq) -> weave.trace_server.trace_server_interface.CallsDeleteRes` + +No description available. + +##### `calls_query(self, req: weave.trace_server.trace_server_interface.CallsQueryReq) -> weave.trace_server.trace_server_interface.CallsQueryRes` + +No description available. + +##### `calls_query_stats(self, req: weave.trace_server.trace_server_interface.CallsQueryStatsReq) -> weave.trace_server.trace_server_interface.CallsQueryStatsRes` + +No description available. + +##### `calls_query_stream(self, req: weave.trace_server.trace_server_interface.CallsQueryReq) -> collections.abc.Iterator` + +No description available. + +##### `completions_create(self, req: weave.trace_server.trace_server_interface.CompletionsCreateReq) -> weave.trace_server.trace_server_interface.CompletionsCreateRes` + +No description available. + +##### `completions_create_stream(self, req: weave.trace_server.trace_server_interface.CompletionsCreateReq) -> collections.abc.Iterator` + +No description available. + +##### `cost_create(self, req: weave.trace_server.trace_server_interface.CostCreateReq) -> weave.trace_server.trace_server_interface.CostCreateRes` + +No description available. + +##### `cost_purge(self, req: weave.trace_server.trace_server_interface.CostPurgeReq) -> weave.trace_server.trace_server_interface.CostPurgeRes` + +No description available. + +##### `cost_query(self, req: weave.trace_server.trace_server_interface.CostQueryReq) -> weave.trace_server.trace_server_interface.CostQueryRes` + +No description available. + +##### `ensure_project_exists(self, entity: str, project: str) -> weave.trace_server.trace_server_interface.EnsureProjectExistsRes` + +No description available. + +##### `evaluate_model(self, req: weave.trace_server.trace_server_interface.EvaluateModelReq) -> weave.trace_server.trace_server_interface.EvaluateModelRes` + +No description available. + +##### `evaluation_status(self, req: weave.trace_server.trace_server_interface.EvaluationStatusReq) -> weave.trace_server.trace_server_interface.EvaluationStatusRes` + +No description available. + +##### `feedback_create(self, req: weave.trace_server.trace_server_interface.FeedbackCreateReq) -> weave.trace_server.trace_server_interface.FeedbackCreateRes` + +No description available. + +##### `feedback_create_batch(self, req: weave.trace_server.trace_server_interface.FeedbackCreateBatchReq) -> weave.trace_server.trace_server_interface.FeedbackCreateBatchRes` + +No description available. + +##### `feedback_purge(self, req: weave.trace_server.trace_server_interface.FeedbackPurgeReq) -> weave.trace_server.trace_server_interface.FeedbackPurgeRes` + +No description available. + +##### `feedback_query(self, req: weave.trace_server.trace_server_interface.FeedbackQueryReq) -> weave.trace_server.trace_server_interface.FeedbackQueryRes` + +No description available. + +##### `feedback_replace(self, req: weave.trace_server.trace_server_interface.FeedbackReplaceReq) -> weave.trace_server.trace_server_interface.FeedbackReplaceRes` + +No description available. + +##### `file_content_read(self, req: weave.trace_server.trace_server_interface.FileContentReadReq) -> weave.trace_server.trace_server_interface.FileContentReadRes` + +No description available. + +##### `file_create(self, req: weave.trace_server.trace_server_interface.FileCreateReq) -> weave.trace_server.trace_server_interface.FileCreateRes` + +No description available. + +##### `files_stats(self, req: weave.trace_server.trace_server_interface.FilesStatsReq) -> weave.trace_server.trace_server_interface.FilesStatsRes` + +No description available. + +##### `image_create(self, req: weave.trace_server.trace_server_interface.ImageGenerationCreateReq) -> weave.trace_server.trace_server_interface.ImageGenerationCreateRes` + +No description available. + +##### `obj_create(self, req: weave.trace_server.trace_server_interface.ObjCreateReq) -> weave.trace_server.trace_server_interface.ObjCreateRes` + +No description available. + +##### `obj_delete(self, req: weave.trace_server.trace_server_interface.ObjDeleteReq) -> weave.trace_server.trace_server_interface.ObjDeleteRes` + +No description available. + +##### `obj_read(self, req: weave.trace_server.trace_server_interface.ObjReadReq) -> weave.trace_server.trace_server_interface.ObjReadRes` + +No description available. + +##### `objs_query(self, req: weave.trace_server.trace_server_interface.ObjQueryReq) -> weave.trace_server.trace_server_interface.ObjQueryRes` + +No description available. + +##### `op_create(self, req: weave.trace_server.trace_server_interface.OpCreateReq) -> weave.trace_server.trace_server_interface.OpCreateRes` + +No description available. + +##### `op_read(self, req: weave.trace_server.trace_server_interface.OpReadReq) -> weave.trace_server.trace_server_interface.OpReadRes` + +No description available. + +##### `ops_query(self, req: weave.trace_server.trace_server_interface.OpQueryReq) -> weave.trace_server.trace_server_interface.OpQueryRes` + +No description available. + +##### `otel_export(self, req: weave.trace_server.trace_server_interface.OtelExportReq) -> weave.trace_server.trace_server_interface.OtelExportRes` + +No description available. + +##### `project_stats(self, req: weave.trace_server.trace_server_interface.ProjectStatsReq) -> weave.trace_server.trace_server_interface.ProjectStatsRes` + +No description available. + +##### `refs_read_batch(self, req: weave.trace_server.trace_server_interface.RefsReadBatchReq) -> weave.trace_server.trace_server_interface.RefsReadBatchRes` + +No description available. + +##### `table_create(self, req: weave.trace_server.trace_server_interface.TableCreateReq) -> weave.trace_server.trace_server_interface.TableCreateRes` + +No description available. + +##### `table_create_from_digests(self, req: weave.trace_server.trace_server_interface.TableCreateFromDigestsReq) -> weave.trace_server.trace_server_interface.TableCreateFromDigestsRes` + +No description available. + +##### `table_query(self, req: weave.trace_server.trace_server_interface.TableQueryReq) -> weave.trace_server.trace_server_interface.TableQueryRes` + +No description available. + +##### `table_query_stats(self, req: weave.trace_server.trace_server_interface.TableQueryStatsReq) -> weave.trace_server.trace_server_interface.TableQueryStatsRes` + +No description available. + +##### `table_query_stats_batch(self, req: weave.trace_server.trace_server_interface.TableQueryStatsBatchReq) -> weave.trace_server.trace_server_interface.TableQueryStatsBatchRes` + +No description available. + +##### `table_query_stream(self, req: weave.trace_server.trace_server_interface.TableQueryReq) -> collections.abc.Iterator` + +No description available. + +##### `table_update(self, req: weave.trace_server.trace_server_interface.TableUpdateReq) -> weave.trace_server.trace_server_interface.TableUpdateRes` + +No description available. + +##### `threads_query_stream(self, req: weave.trace_server.trace_server_interface.ThreadsQueryReq) -> collections.abc.Iterator` + +No description available. + +### TraceStatus + +An enumeration. + +### WeaveSummarySchema + +dict() -> new empty dictionary +dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs +dict(iterable) -> new dictionary initialized as if via: + d = \{\} + for k, v in iterable: + d[k] = v +dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + diff --git a/weave/reference/service-api.mdx b/weave/reference/service-api.mdx index e5da909ac3..a6c86c5c40 100644 --- a/weave/reference/service-api.mdx +++ b/weave/reference/service-api.mdx @@ -22,6 +22,510 @@ curl -H "Authorization: Bearer YOUR_API_KEY" https://trace.wandb.ai/... ### Calls +- **[POST /call/end](https://docs.wandb.ai/weave/reference/service-api/calls/call-end-call-end)** - Call End +- **[POST /call/read](https://docs.wandb.ai/weave/reference/service-api/calls/call-read-call-read)** - Call Read +- **[POST /call/start](https://docs.wandb.ai/weave/reference/service-api/calls/call-start-call-start)** - Call Start +- **[POST /call/update](https://docs.wandb.ai/weave/reference/service-api/calls/call-update-call-update)** - Call Update +- **[POST /call/upsert_batch](https://docs.wandb.ai/weave/reference/service-api/calls/call-start-batch-call-upsert-batch)** - Call Start Batch +- **[POST /calls/delete](https://docs.wandb.ai/weave/reference/service-api/calls/calls-delete-calls-delete)** - Calls Delete +- **[POST /calls/query_stats](https://docs.wandb.ai/weave/reference/service-api/calls/calls-query-stats-calls-query-stats)** - Calls Query Stats +- **[POST /calls/stream_query](https://docs.wandb.ai/weave/reference/service-api/calls/calls-query-stream-calls-stream-query)** - Calls Query Stream + +### Costs + +- **[POST /cost/create](https://docs.wandb.ai/weave/reference/service-api/costs/cost-create-cost-create)** - Cost Create +- **[POST /cost/purge](https://docs.wandb.ai/weave/reference/service-api/costs/cost-purge-cost-purge)** - Cost Purge +- **[POST /cost/query](https://docs.wandb.ai/weave/reference/service-api/costs/cost-query-cost-query)** - Cost Query + +### Feedback + +- **[POST /feedback/create](https://docs.wandb.ai/weave/reference/service-api/feedback/feedback-create-feedback-create)** - Feedback Create +- **[POST /feedback/purge](https://docs.wandb.ai/weave/reference/service-api/feedback/feedback-purge-feedback-purge)** - Feedback Purge +- **[POST /feedback/query](https://docs.wandb.ai/weave/reference/service-api/feedback/feedback-query-feedback-query)** - Feedback Query +- **[POST /feedback/replace](https://docs.wandb.ai/weave/reference/service-api/feedback/feedback-replace-feedback-replace)** - Feedback Replace + +### Files + +- **[POST /file/content](https://docs.wandb.ai/weave/reference/service-api/files/file-content-file-content)** - File Content +- **[POST /file/create](https://docs.wandb.ai/weave/reference/service-api/files/file-create-file-create)** - File Create + +### Objects + +- **[POST /obj/create](https://docs.wandb.ai/weave/reference/service-api/objects/obj-create-obj-create)** - Obj Create +- **[POST /obj/delete](https://docs.wandb.ai/weave/reference/service-api/objects/obj-delete-obj-delete)** - Obj Delete +- **[POST /obj/read](https://docs.wandb.ai/weave/reference/service-api/objects/obj-read-obj-read)** - Obj Read +- **[POST /objs/query](https://docs.wandb.ai/weave/reference/service-api/objects/objs-query-objs-query)** - Objs Query + +### OpenTelemetry + +- **[POST /otel/v1/trace](https://docs.wandb.ai/weave/reference/service-api/opentelemetry/export-trace-otel-v1-trace)** - Export Trace + +### Refs + +- **[POST /refs/read_batch](https://docs.wandb.ai/weave/reference/service-api/refs/refs-read-batch-refs-read-batch)** - Refs Read Batch + +### Service + +- **[GET /health](https://docs.wandb.ai/weave/reference/service-api/service/read-root-health)** - Read Root +- **[GET /server_info](https://docs.wandb.ai/weave/reference/service-api/service/server-info-server-info)** - Server Info + +### Tables + +- **[POST /table/create](https://docs.wandb.ai/weave/reference/service-api/tables/table-create-table-create)** - Table Create +- **[POST /table/query](https://docs.wandb.ai/weave/reference/service-api/tables/table-query-table-query)** - Table Query +- **[POST /table/query_stats](https://docs.wandb.ai/weave/reference/service-api/tables/table-query-stats-table-query-stats)** - Table Query Stats +- **[POST /table/update](https://docs.wandb.ai/weave/reference/service-api/tables/table-update-table-update)** - Table Update + +### Threads + +- **[POST /threads/stream_query](https://docs.wandb.ai/weave/reference/service-api/threads/threads-query-stream-threads-stream-query)** - Threads Query Stream + +### Uncategorized + +- **[POST /table/query_stream](https://docs.wandb.ai/weave/reference/service-api/uncategorized/table-query-stream-table-query-stream)** - Table Query Stream + +### Completions + +- **[POST /completions/create](https://docs.wandb.ai/weave/reference/service-api/completions/completions-create-completions-create)** - Completions Create +- **[POST /completions/create_stream](https://docs.wandb.ai/weave/reference/service-api/completions/completions-create-stream-completions-create-stream)** - Completions Create Stream + +### Ops + +- **[GET /v2/{entity}/{project}/ops](https://docs.wandb.ai/weave/reference/service-api/ops/op-list)** - Op List +- **[POST /v2/{entity}/{project}/ops](https://docs.wandb.ai/weave/reference/service-api/ops/op-create)** - Op Create +- **[DELETE /v2/{entity}/{project}/ops/{object_id}](https://docs.wandb.ai/weave/reference/service-api/ops/op)** - Op Delete +- **[GET /v2/{entity}/{project}/ops/{object_id}/versions/{digest}](https://docs.wandb.ai/weave/reference/service-api/ops/op-read)** - Op Read + +### Datasets + +- **[GET /v2/{entity}/{project}/datasets](https://docs.wandb.ai/weave/reference/service-api/datasets/dataset-list)** - Dataset List +- **[POST /v2/{entity}/{project}/datasets](https://docs.wandb.ai/weave/reference/service-api/datasets/dataset-create)** - Dataset Create +- **[DELETE /v2/{entity}/{project}/datasets/{object_id}](https://docs.wandb.ai/weave/reference/service-api/datasets/dataset)** - Dataset Delete +- **[GET /v2/{entity}/{project}/datasets/{object_id}/versions/{digest}](https://docs.wandb.ai/weave/reference/service-api/datasets/dataset-read)** - Dataset Read + +### Scorers + +- **[GET /v2/{entity}/{project}/scorers](https://docs.wandb.ai/weave/reference/service-api/scorers/scorer-list)** - Scorer List +- **[POST /v2/{entity}/{project}/scorers](https://docs.wandb.ai/weave/reference/service-api/scorers/scorer-create)** - Scorer Create +- **[DELETE /v2/{entity}/{project}/scorers/{object_id}](https://docs.wandb.ai/weave/reference/service-api/scorers/scorer)** - Scorer Delete +- **[GET /v2/{entity}/{project}/scorers/{object_id}/versions/{digest}](https://docs.wandb.ai/weave/reference/service-api/scorers/scorer-read)** - Scorer Read + +### Evaluations + +- **[GET /v2/{entity}/{project}/evaluations](https://docs.wandb.ai/weave/reference/service-api/evaluations/evaluation-list)** - Evaluation List +- **[POST /v2/{entity}/{project}/evaluations](https://docs.wandb.ai/weave/reference/service-api/evaluations/evaluation-create)** - Evaluation Create +- **[DELETE /v2/{entity}/{project}/evaluations/{object_id}](https://docs.wandb.ai/weave/reference/service-api/evaluations/evaluation)** - Evaluation Delete +- **[GET /v2/{entity}/{project}/evaluations/{object_id}/versions/{digest}](https://docs.wandb.ai/weave/reference/service-api/evaluations/evaluation-read)** - Evaluation Read + +### Evaluation Runs + +- **[DELETE /v2/{entity}/{project}/evaluation_runs](https://docs.wandb.ai/weave/reference/service-api/evaluation runs/evaluation-run)** - Evaluation Run Delete +- **[GET /v2/{entity}/{project}/evaluation_runs](https://docs.wandb.ai/weave/reference/service-api/evaluation runs/evaluation-run-list)** - Evaluation Run List +- **[POST /v2/{entity}/{project}/evaluation_runs](https://docs.wandb.ai/weave/reference/service-api/evaluation runs/evaluation-run-create)** - Evaluation Run Create +- **[GET /v2/{entity}/{project}/evaluation_runs/{evaluation_run_id}](https://docs.wandb.ai/weave/reference/service-api/evaluation runs/evaluation-run-read)** - Evaluation Run Read +- **[POST /v2/{entity}/{project}/evaluation_runs/{evaluation_run_id}/finish](https://docs.wandb.ai/weave/reference/service-api/evaluation runs/evaluation-run-finish)** - Evaluation Run Finish + +### Models + +- **[GET /v2/{entity}/{project}/models](https://docs.wandb.ai/weave/reference/service-api/models/model-list)** - Model List +- **[POST /v2/{entity}/{project}/models](https://docs.wandb.ai/weave/reference/service-api/models/model-create)** - Model Create +- **[DELETE /v2/{entity}/{project}/models/{object_id}](https://docs.wandb.ai/weave/reference/service-api/models/model)** - Model Delete +- **[GET /v2/{entity}/{project}/models/{object_id}/versions/{digest}](https://docs.wandb.ai/weave/reference/service-api/models/model-read)** - Model Read + +### Predictions + +- **[DELETE /v2/{entity}/{project}/predictions](https://docs.wandb.ai/weave/reference/service-api/predictions/prediction)** - Prediction Delete +- **[GET /v2/{entity}/{project}/predictions](https://docs.wandb.ai/weave/reference/service-api/predictions/prediction-list)** - Prediction List +- **[POST /v2/{entity}/{project}/predictions](https://docs.wandb.ai/weave/reference/service-api/predictions/prediction-create)** - Prediction Create +- **[GET /v2/{entity}/{project}/predictions/{prediction_id}](https://docs.wandb.ai/weave/reference/service-api/predictions/prediction-read)** - Prediction Read +- **[POST /v2/{entity}/{project}/predictions/{prediction_id}/finish](https://docs.wandb.ai/weave/reference/service-api/predictions/prediction-finish)** - Prediction Finish + +### Scores + +- **[DELETE /v2/{entity}/{project}/scores](https://docs.wandb.ai/weave/reference/service-api/scores/score)** - Score Delete +- **[GET /v2/{entity}/{project}/scores](https://docs.wandb.ai/weave/reference/service-api/scores/score-list)** - Score List +- **[POST /v2/{entity}/{project}/scores](https://docs.wandb.ai/weave/reference/service-api/scores/score-create)** - Score Create +- **[GET /v2/{entity}/{project}/scores/{score_id}](https://docs.wandb.ai/weave/reference/service-api/scores/score-read)** - Score Read +### Calls + +- **[POST /call/end](https://docs.wandb.ai/weave/reference/service-api/calls/call-end-call-end)** - Call End +- **[POST /call/read](https://docs.wandb.ai/weave/reference/service-api/calls/call-read-call-read)** - Call Read +- **[POST /call/start](https://docs.wandb.ai/weave/reference/service-api/calls/call-start-call-start)** - Call Start +- **[POST /call/update](https://docs.wandb.ai/weave/reference/service-api/calls/call-update-call-update)** - Call Update +- **[POST /call/upsert_batch](https://docs.wandb.ai/weave/reference/service-api/calls/call-start-batch-call-upsert-batch)** - Call Start Batch +- **[POST /calls/delete](https://docs.wandb.ai/weave/reference/service-api/calls/calls-delete-calls-delete)** - Calls Delete +- **[POST /calls/query_stats](https://docs.wandb.ai/weave/reference/service-api/calls/calls-query-stats-calls-query-stats)** - Calls Query Stats +- **[POST /calls/stream_query](https://docs.wandb.ai/weave/reference/service-api/calls/calls-query-stream-calls-stream-query)** - Calls Query Stream + +### Costs + +- **[POST /cost/create](https://docs.wandb.ai/weave/reference/service-api/costs/cost-create-cost-create)** - Cost Create +- **[POST /cost/purge](https://docs.wandb.ai/weave/reference/service-api/costs/cost-purge-cost-purge)** - Cost Purge +- **[POST /cost/query](https://docs.wandb.ai/weave/reference/service-api/costs/cost-query-cost-query)** - Cost Query + +### Feedback + +- **[POST /feedback/create](https://docs.wandb.ai/weave/reference/service-api/feedback/feedback-create-feedback-create)** - Feedback Create +- **[POST /feedback/purge](https://docs.wandb.ai/weave/reference/service-api/feedback/feedback-purge-feedback-purge)** - Feedback Purge +- **[POST /feedback/query](https://docs.wandb.ai/weave/reference/service-api/feedback/feedback-query-feedback-query)** - Feedback Query +- **[POST /feedback/replace](https://docs.wandb.ai/weave/reference/service-api/feedback/feedback-replace-feedback-replace)** - Feedback Replace + +### Files + +- **[POST /file/content](https://docs.wandb.ai/weave/reference/service-api/files/file-content-file-content)** - File Content +- **[POST /file/create](https://docs.wandb.ai/weave/reference/service-api/files/file-create-file-create)** - File Create + +### Objects + +- **[POST /obj/create](https://docs.wandb.ai/weave/reference/service-api/objects/obj-create-obj-create)** - Obj Create +- **[POST /obj/delete](https://docs.wandb.ai/weave/reference/service-api/objects/obj-delete-obj-delete)** - Obj Delete +- **[POST /obj/read](https://docs.wandb.ai/weave/reference/service-api/objects/obj-read-obj-read)** - Obj Read +- **[POST /objs/query](https://docs.wandb.ai/weave/reference/service-api/objects/objs-query-objs-query)** - Objs Query + +### OpenTelemetry + +- **[POST /otel/v1/trace](https://docs.wandb.ai/weave/reference/service-api/opentelemetry/export-trace-otel-v1-trace)** - Export Trace + +### Refs + +- **[POST /refs/read_batch](https://docs.wandb.ai/weave/reference/service-api/refs/refs-read-batch-refs-read-batch)** - Refs Read Batch + +### Service + +- **[GET /health](https://docs.wandb.ai/weave/reference/service-api/service/read-root-health)** - Read Root +- **[GET /server_info](https://docs.wandb.ai/weave/reference/service-api/service/server-info-server-info)** - Server Info + +### Tables + +- **[POST /table/create](https://docs.wandb.ai/weave/reference/service-api/tables/table-create-table-create)** - Table Create +- **[POST /table/query](https://docs.wandb.ai/weave/reference/service-api/tables/table-query-table-query)** - Table Query +- **[POST /table/query_stats](https://docs.wandb.ai/weave/reference/service-api/tables/table-query-stats-table-query-stats)** - Table Query Stats +- **[POST /table/update](https://docs.wandb.ai/weave/reference/service-api/tables/table-update-table-update)** - Table Update + +### Threads + +- **[POST /threads/stream_query](https://docs.wandb.ai/weave/reference/service-api/threads/threads-query-stream-threads-stream-query)** - Threads Query Stream + +### Uncategorized + +- **[POST /table/query_stream](https://docs.wandb.ai/weave/reference/service-api/uncategorized/table-query-stream-table-query-stream)** - Table Query Stream + +### Completions + +- **[POST /completions/create](https://docs.wandb.ai/weave/reference/service-api/completions/completions-create-completions-create)** - Completions Create +- **[POST /completions/create_stream](https://docs.wandb.ai/weave/reference/service-api/completions/completions-create-stream-completions-create-stream)** - Completions Create Stream + +### Ops + +- **[GET /v2/{entity}/{project}/ops](https://docs.wandb.ai/weave/reference/service-api/ops/op-list)** - Op List +- **[POST /v2/{entity}/{project}/ops](https://docs.wandb.ai/weave/reference/service-api/ops/op-create)** - Op Create +- **[DELETE /v2/{entity}/{project}/ops/{object_id}](https://docs.wandb.ai/weave/reference/service-api/ops/op)** - Op Delete +- **[GET /v2/{entity}/{project}/ops/{object_id}/versions/{digest}](https://docs.wandb.ai/weave/reference/service-api/ops/op-read)** - Op Read + +### Datasets + +- **[GET /v2/{entity}/{project}/datasets](https://docs.wandb.ai/weave/reference/service-api/datasets/dataset-list)** - Dataset List +- **[POST /v2/{entity}/{project}/datasets](https://docs.wandb.ai/weave/reference/service-api/datasets/dataset-create)** - Dataset Create +- **[DELETE /v2/{entity}/{project}/datasets/{object_id}](https://docs.wandb.ai/weave/reference/service-api/datasets/dataset)** - Dataset Delete +- **[GET /v2/{entity}/{project}/datasets/{object_id}/versions/{digest}](https://docs.wandb.ai/weave/reference/service-api/datasets/dataset-read)** - Dataset Read + +### Scorers + +- **[GET /v2/{entity}/{project}/scorers](https://docs.wandb.ai/weave/reference/service-api/scorers/scorer-list)** - Scorer List +- **[POST /v2/{entity}/{project}/scorers](https://docs.wandb.ai/weave/reference/service-api/scorers/scorer-create)** - Scorer Create +- **[DELETE /v2/{entity}/{project}/scorers/{object_id}](https://docs.wandb.ai/weave/reference/service-api/scorers/scorer)** - Scorer Delete +- **[GET /v2/{entity}/{project}/scorers/{object_id}/versions/{digest}](https://docs.wandb.ai/weave/reference/service-api/scorers/scorer-read)** - Scorer Read + +### Evaluations + +- **[GET /v2/{entity}/{project}/evaluations](https://docs.wandb.ai/weave/reference/service-api/evaluations/evaluation-list)** - Evaluation List +- **[POST /v2/{entity}/{project}/evaluations](https://docs.wandb.ai/weave/reference/service-api/evaluations/evaluation-create)** - Evaluation Create +- **[DELETE /v2/{entity}/{project}/evaluations/{object_id}](https://docs.wandb.ai/weave/reference/service-api/evaluations/evaluation)** - Evaluation Delete +- **[GET /v2/{entity}/{project}/evaluations/{object_id}/versions/{digest}](https://docs.wandb.ai/weave/reference/service-api/evaluations/evaluation-read)** - Evaluation Read + +### Evaluation Runs + +- **[DELETE /v2/{entity}/{project}/evaluation_runs](https://docs.wandb.ai/weave/reference/service-api/evaluation runs/evaluation-run)** - Evaluation Run Delete +- **[GET /v2/{entity}/{project}/evaluation_runs](https://docs.wandb.ai/weave/reference/service-api/evaluation runs/evaluation-run-list)** - Evaluation Run List +- **[POST /v2/{entity}/{project}/evaluation_runs](https://docs.wandb.ai/weave/reference/service-api/evaluation runs/evaluation-run-create)** - Evaluation Run Create +- **[GET /v2/{entity}/{project}/evaluation_runs/{evaluation_run_id}](https://docs.wandb.ai/weave/reference/service-api/evaluation runs/evaluation-run-read)** - Evaluation Run Read +- **[POST /v2/{entity}/{project}/evaluation_runs/{evaluation_run_id}/finish](https://docs.wandb.ai/weave/reference/service-api/evaluation runs/evaluation-run-finish)** - Evaluation Run Finish + +### Models + +- **[GET /v2/{entity}/{project}/models](https://docs.wandb.ai/weave/reference/service-api/models/model-list)** - Model List +- **[POST /v2/{entity}/{project}/models](https://docs.wandb.ai/weave/reference/service-api/models/model-create)** - Model Create +- **[DELETE /v2/{entity}/{project}/models/{object_id}](https://docs.wandb.ai/weave/reference/service-api/models/model)** - Model Delete +- **[GET /v2/{entity}/{project}/models/{object_id}/versions/{digest}](https://docs.wandb.ai/weave/reference/service-api/models/model-read)** - Model Read + +### Predictions + +- **[DELETE /v2/{entity}/{project}/predictions](https://docs.wandb.ai/weave/reference/service-api/predictions/prediction)** - Prediction Delete +- **[GET /v2/{entity}/{project}/predictions](https://docs.wandb.ai/weave/reference/service-api/predictions/prediction-list)** - Prediction List +- **[POST /v2/{entity}/{project}/predictions](https://docs.wandb.ai/weave/reference/service-api/predictions/prediction-create)** - Prediction Create +- **[GET /v2/{entity}/{project}/predictions/{prediction_id}](https://docs.wandb.ai/weave/reference/service-api/predictions/prediction-read)** - Prediction Read +- **[POST /v2/{entity}/{project}/predictions/{prediction_id}/finish](https://docs.wandb.ai/weave/reference/service-api/predictions/prediction-finish)** - Prediction Finish + +### Scores + +- **[DELETE /v2/{entity}/{project}/scores](https://docs.wandb.ai/weave/reference/service-api/scores/score)** - Score Delete +- **[GET /v2/{entity}/{project}/scores](https://docs.wandb.ai/weave/reference/service-api/scores/score-list)** - Score List +- **[POST /v2/{entity}/{project}/scores](https://docs.wandb.ai/weave/reference/service-api/scores/score-create)** - Score Create +- **[GET /v2/{entity}/{project}/scores/{score_id}](https://docs.wandb.ai/weave/reference/service-api/scores/score-read)** - Score Read +### Calls + +- **[POST /call/end](https://docs.wandb.ai/weave/reference/service-api/calls/call-end-call-end)** - Call End +- **[POST /call/read](https://docs.wandb.ai/weave/reference/service-api/calls/call-read-call-read)** - Call Read +- **[POST /call/start](https://docs.wandb.ai/weave/reference/service-api/calls/call-start-call-start)** - Call Start +- **[POST /call/update](https://docs.wandb.ai/weave/reference/service-api/calls/call-update-call-update)** - Call Update +- **[POST /call/upsert_batch](https://docs.wandb.ai/weave/reference/service-api/calls/call-start-batch-call-upsert-batch)** - Call Start Batch +- **[POST /calls/delete](https://docs.wandb.ai/weave/reference/service-api/calls/calls-delete-calls-delete)** - Calls Delete +- **[POST /calls/query_stats](https://docs.wandb.ai/weave/reference/service-api/calls/calls-query-stats-calls-query-stats)** - Calls Query Stats +- **[POST /calls/stream_query](https://docs.wandb.ai/weave/reference/service-api/calls/calls-query-stream-calls-stream-query)** - Calls Query Stream + +### Costs + +- **[POST /cost/create](https://docs.wandb.ai/weave/reference/service-api/costs/cost-create-cost-create)** - Cost Create +- **[POST /cost/purge](https://docs.wandb.ai/weave/reference/service-api/costs/cost-purge-cost-purge)** - Cost Purge +- **[POST /cost/query](https://docs.wandb.ai/weave/reference/service-api/costs/cost-query-cost-query)** - Cost Query + +### Feedback + +- **[POST /feedback/create](https://docs.wandb.ai/weave/reference/service-api/feedback/feedback-create-feedback-create)** - Feedback Create +- **[POST /feedback/purge](https://docs.wandb.ai/weave/reference/service-api/feedback/feedback-purge-feedback-purge)** - Feedback Purge +- **[POST /feedback/query](https://docs.wandb.ai/weave/reference/service-api/feedback/feedback-query-feedback-query)** - Feedback Query +- **[POST /feedback/replace](https://docs.wandb.ai/weave/reference/service-api/feedback/feedback-replace-feedback-replace)** - Feedback Replace + +### Files + +- **[POST /file/content](https://docs.wandb.ai/weave/reference/service-api/files/file-content-file-content)** - File Content +- **[POST /file/create](https://docs.wandb.ai/weave/reference/service-api/files/file-create-file-create)** - File Create + +### Objects + +- **[POST /obj/create](https://docs.wandb.ai/weave/reference/service-api/objects/obj-create-obj-create)** - Obj Create +- **[POST /obj/delete](https://docs.wandb.ai/weave/reference/service-api/objects/obj-delete-obj-delete)** - Obj Delete +- **[POST /obj/read](https://docs.wandb.ai/weave/reference/service-api/objects/obj-read-obj-read)** - Obj Read +- **[POST /objs/query](https://docs.wandb.ai/weave/reference/service-api/objects/objs-query-objs-query)** - Objs Query + +### OpenTelemetry + +- **[POST /otel/v1/trace](https://docs.wandb.ai/weave/reference/service-api/opentelemetry/export-trace-otel-v1-trace)** - Export Trace + +### Refs + +- **[POST /refs/read_batch](https://docs.wandb.ai/weave/reference/service-api/refs/refs-read-batch-refs-read-batch)** - Refs Read Batch + +### Service + +- **[GET /health](https://docs.wandb.ai/weave/reference/service-api/service/read-root-health)** - Read Root +- **[GET /server_info](https://docs.wandb.ai/weave/reference/service-api/service/server-info-server-info)** - Server Info + +### Tables + +- **[POST /table/create](https://docs.wandb.ai/weave/reference/service-api/tables/table-create-table-create)** - Table Create +- **[POST /table/query](https://docs.wandb.ai/weave/reference/service-api/tables/table-query-table-query)** - Table Query +- **[POST /table/query_stats](https://docs.wandb.ai/weave/reference/service-api/tables/table-query-stats-table-query-stats)** - Table Query Stats +- **[POST /table/update](https://docs.wandb.ai/weave/reference/service-api/tables/table-update-table-update)** - Table Update + +### Threads + +- **[POST /threads/stream_query](https://docs.wandb.ai/weave/reference/service-api/threads/threads-query-stream-threads-stream-query)** - Threads Query Stream + +### Uncategorized + +- **[POST /table/query_stream](https://docs.wandb.ai/weave/reference/service-api/uncategorized/table-query-stream-table-query-stream)** - Table Query Stream + +### Completions + +- **[POST /completions/create](https://docs.wandb.ai/weave/reference/service-api/completions/completions-create-completions-create)** - Completions Create +- **[POST /completions/create_stream](https://docs.wandb.ai/weave/reference/service-api/completions/completions-create-stream-completions-create-stream)** - Completions Create Stream + +### Ops + +- **[GET /v2/{entity}/{project}/ops](https://docs.wandb.ai/weave/reference/service-api/ops/op-list)** - Op List +- **[POST /v2/{entity}/{project}/ops](https://docs.wandb.ai/weave/reference/service-api/ops/op-create)** - Op Create +- **[DELETE /v2/{entity}/{project}/ops/{object_id}](https://docs.wandb.ai/weave/reference/service-api/ops/op)** - Op Delete +- **[GET /v2/{entity}/{project}/ops/{object_id}/versions/{digest}](https://docs.wandb.ai/weave/reference/service-api/ops/op-read)** - Op Read + +### Datasets + +- **[GET /v2/{entity}/{project}/datasets](https://docs.wandb.ai/weave/reference/service-api/datasets/dataset-list)** - Dataset List +- **[POST /v2/{entity}/{project}/datasets](https://docs.wandb.ai/weave/reference/service-api/datasets/dataset-create)** - Dataset Create +- **[DELETE /v2/{entity}/{project}/datasets/{object_id}](https://docs.wandb.ai/weave/reference/service-api/datasets/dataset)** - Dataset Delete +- **[GET /v2/{entity}/{project}/datasets/{object_id}/versions/{digest}](https://docs.wandb.ai/weave/reference/service-api/datasets/dataset-read)** - Dataset Read + +### Scorers + +- **[GET /v2/{entity}/{project}/scorers](https://docs.wandb.ai/weave/reference/service-api/scorers/scorer-list)** - Scorer List +- **[POST /v2/{entity}/{project}/scorers](https://docs.wandb.ai/weave/reference/service-api/scorers/scorer-create)** - Scorer Create +- **[DELETE /v2/{entity}/{project}/scorers/{object_id}](https://docs.wandb.ai/weave/reference/service-api/scorers/scorer)** - Scorer Delete +- **[GET /v2/{entity}/{project}/scorers/{object_id}/versions/{digest}](https://docs.wandb.ai/weave/reference/service-api/scorers/scorer-read)** - Scorer Read + +### Evaluations + +- **[GET /v2/{entity}/{project}/evaluations](https://docs.wandb.ai/weave/reference/service-api/evaluations/evaluation-list)** - Evaluation List +- **[POST /v2/{entity}/{project}/evaluations](https://docs.wandb.ai/weave/reference/service-api/evaluations/evaluation-create)** - Evaluation Create +- **[DELETE /v2/{entity}/{project}/evaluations/{object_id}](https://docs.wandb.ai/weave/reference/service-api/evaluations/evaluation)** - Evaluation Delete +- **[GET /v2/{entity}/{project}/evaluations/{object_id}/versions/{digest}](https://docs.wandb.ai/weave/reference/service-api/evaluations/evaluation-read)** - Evaluation Read + +### Evaluation Runs + +- **[DELETE /v2/{entity}/{project}/evaluation_runs](https://docs.wandb.ai/weave/reference/service-api/evaluation runs/evaluation-run)** - Evaluation Run Delete +- **[GET /v2/{entity}/{project}/evaluation_runs](https://docs.wandb.ai/weave/reference/service-api/evaluation runs/evaluation-run-list)** - Evaluation Run List +- **[POST /v2/{entity}/{project}/evaluation_runs](https://docs.wandb.ai/weave/reference/service-api/evaluation runs/evaluation-run-create)** - Evaluation Run Create +- **[GET /v2/{entity}/{project}/evaluation_runs/{evaluation_run_id}](https://docs.wandb.ai/weave/reference/service-api/evaluation runs/evaluation-run-read)** - Evaluation Run Read +- **[POST /v2/{entity}/{project}/evaluation_runs/{evaluation_run_id}/finish](https://docs.wandb.ai/weave/reference/service-api/evaluation runs/evaluation-run-finish)** - Evaluation Run Finish + +### Models + +- **[GET /v2/{entity}/{project}/models](https://docs.wandb.ai/weave/reference/service-api/models/model-list)** - Model List +- **[POST /v2/{entity}/{project}/models](https://docs.wandb.ai/weave/reference/service-api/models/model-create)** - Model Create +- **[DELETE /v2/{entity}/{project}/models/{object_id}](https://docs.wandb.ai/weave/reference/service-api/models/model)** - Model Delete +- **[GET /v2/{entity}/{project}/models/{object_id}/versions/{digest}](https://docs.wandb.ai/weave/reference/service-api/models/model-read)** - Model Read + +### Predictions + +- **[DELETE /v2/{entity}/{project}/predictions](https://docs.wandb.ai/weave/reference/service-api/predictions/prediction)** - Prediction Delete +- **[GET /v2/{entity}/{project}/predictions](https://docs.wandb.ai/weave/reference/service-api/predictions/prediction-list)** - Prediction List +- **[POST /v2/{entity}/{project}/predictions](https://docs.wandb.ai/weave/reference/service-api/predictions/prediction-create)** - Prediction Create +- **[GET /v2/{entity}/{project}/predictions/{prediction_id}](https://docs.wandb.ai/weave/reference/service-api/predictions/prediction-read)** - Prediction Read +- **[POST /v2/{entity}/{project}/predictions/{prediction_id}/finish](https://docs.wandb.ai/weave/reference/service-api/predictions/prediction-finish)** - Prediction Finish + +### Scores + +- **[DELETE /v2/{entity}/{project}/scores](https://docs.wandb.ai/weave/reference/service-api/scores/score)** - Score Delete +- **[GET /v2/{entity}/{project}/scores](https://docs.wandb.ai/weave/reference/service-api/scores/score-list)** - Score List +- **[POST /v2/{entity}/{project}/scores](https://docs.wandb.ai/weave/reference/service-api/scores/score-create)** - Score Create +- **[GET /v2/{entity}/{project}/scores/{score_id}](https://docs.wandb.ai/weave/reference/service-api/scores/score-read)** - Score Read +### Calls + +- **[POST /call/end](https://docs.wandb.ai/weave/reference/service-api/calls/call-end-call-end)** - Call End +- **[POST /call/read](https://docs.wandb.ai/weave/reference/service-api/calls/call-read-call-read)** - Call Read +- **[POST /call/start](https://docs.wandb.ai/weave/reference/service-api/calls/call-start-call-start)** - Call Start +- **[POST /call/update](https://docs.wandb.ai/weave/reference/service-api/calls/call-update-call-update)** - Call Update +- **[POST /call/upsert_batch](https://docs.wandb.ai/weave/reference/service-api/calls/call-start-batch-call-upsert-batch)** - Call Start Batch +- **[POST /calls/delete](https://docs.wandb.ai/weave/reference/service-api/calls/calls-delete-calls-delete)** - Calls Delete +- **[POST /calls/query_stats](https://docs.wandb.ai/weave/reference/service-api/calls/calls-query-stats-calls-query-stats)** - Calls Query Stats +- **[POST /calls/stream_query](https://docs.wandb.ai/weave/reference/service-api/calls/calls-query-stream-calls-stream-query)** - Calls Query Stream + +### Costs + +- **[POST /cost/create](https://docs.wandb.ai/weave/reference/service-api/costs/cost-create-cost-create)** - Cost Create +- **[POST /cost/purge](https://docs.wandb.ai/weave/reference/service-api/costs/cost-purge-cost-purge)** - Cost Purge +- **[POST /cost/query](https://docs.wandb.ai/weave/reference/service-api/costs/cost-query-cost-query)** - Cost Query + +### Feedback + +- **[POST /feedback/create](https://docs.wandb.ai/weave/reference/service-api/feedback/feedback-create-feedback-create)** - Feedback Create +- **[POST /feedback/purge](https://docs.wandb.ai/weave/reference/service-api/feedback/feedback-purge-feedback-purge)** - Feedback Purge +- **[POST /feedback/query](https://docs.wandb.ai/weave/reference/service-api/feedback/feedback-query-feedback-query)** - Feedback Query +- **[POST /feedback/replace](https://docs.wandb.ai/weave/reference/service-api/feedback/feedback-replace-feedback-replace)** - Feedback Replace + +### Files + +- **[POST /file/content](https://docs.wandb.ai/weave/reference/service-api/files/file-content-file-content)** - File Content +- **[POST /file/create](https://docs.wandb.ai/weave/reference/service-api/files/file-create-file-create)** - File Create + +### Objects + +- **[POST /obj/create](https://docs.wandb.ai/weave/reference/service-api/objects/obj-create-obj-create)** - Obj Create +- **[POST /obj/delete](https://docs.wandb.ai/weave/reference/service-api/objects/obj-delete-obj-delete)** - Obj Delete +- **[POST /obj/read](https://docs.wandb.ai/weave/reference/service-api/objects/obj-read-obj-read)** - Obj Read +- **[POST /objs/query](https://docs.wandb.ai/weave/reference/service-api/objects/objs-query-objs-query)** - Objs Query + +### OpenTelemetry + +- **[POST /otel/v1/trace](https://docs.wandb.ai/weave/reference/service-api/opentelemetry/export-trace-otel-v1-trace)** - Export Trace + +### Refs + +- **[POST /refs/read_batch](https://docs.wandb.ai/weave/reference/service-api/refs/refs-read-batch-refs-read-batch)** - Refs Read Batch + +### Service + +- **[GET /health](https://docs.wandb.ai/weave/reference/service-api/service/read-root-health)** - Read Root +- **[GET /server_info](https://docs.wandb.ai/weave/reference/service-api/service/server-info-server-info)** - Server Info + +### Tables + +- **[POST /table/create](https://docs.wandb.ai/weave/reference/service-api/tables/table-create-table-create)** - Table Create +- **[POST /table/query](https://docs.wandb.ai/weave/reference/service-api/tables/table-query-table-query)** - Table Query +- **[POST /table/query_stats](https://docs.wandb.ai/weave/reference/service-api/tables/table-query-stats-table-query-stats)** - Table Query Stats +- **[POST /table/update](https://docs.wandb.ai/weave/reference/service-api/tables/table-update-table-update)** - Table Update + +### Threads + +- **[POST /threads/stream_query](https://docs.wandb.ai/weave/reference/service-api/threads/threads-query-stream-threads-stream-query)** - Threads Query Stream + +### Uncategorized + +- **[POST /table/query_stream](https://docs.wandb.ai/weave/reference/service-api/uncategorized/table-query-stream-table-query-stream)** - Table Query Stream + +### Completions + +- **[POST /completions/create](https://docs.wandb.ai/weave/reference/service-api/completions/completions-create-completions-create)** - Completions Create +- **[POST /completions/create_stream](https://docs.wandb.ai/weave/reference/service-api/completions/completions-create-stream-completions-create-stream)** - Completions Create Stream + +### Ops + +- **[GET /v2/{entity}/{project}/ops](https://docs.wandb.ai/weave/reference/service-api/ops/op-list)** - Op List +- **[POST /v2/{entity}/{project}/ops](https://docs.wandb.ai/weave/reference/service-api/ops/op-create)** - Op Create +- **[DELETE /v2/{entity}/{project}/ops/{object_id}](https://docs.wandb.ai/weave/reference/service-api/ops/op)** - Op Delete +- **[GET /v2/{entity}/{project}/ops/{object_id}/versions/{digest}](https://docs.wandb.ai/weave/reference/service-api/ops/op-read)** - Op Read + +### Datasets + +- **[GET /v2/{entity}/{project}/datasets](https://docs.wandb.ai/weave/reference/service-api/datasets/dataset-list)** - Dataset List +- **[POST /v2/{entity}/{project}/datasets](https://docs.wandb.ai/weave/reference/service-api/datasets/dataset-create)** - Dataset Create +- **[DELETE /v2/{entity}/{project}/datasets/{object_id}](https://docs.wandb.ai/weave/reference/service-api/datasets/dataset)** - Dataset Delete +- **[GET /v2/{entity}/{project}/datasets/{object_id}/versions/{digest}](https://docs.wandb.ai/weave/reference/service-api/datasets/dataset-read)** - Dataset Read + +### Scorers + +- **[GET /v2/{entity}/{project}/scorers](https://docs.wandb.ai/weave/reference/service-api/scorers/scorer-list)** - Scorer List +- **[POST /v2/{entity}/{project}/scorers](https://docs.wandb.ai/weave/reference/service-api/scorers/scorer-create)** - Scorer Create +- **[DELETE /v2/{entity}/{project}/scorers/{object_id}](https://docs.wandb.ai/weave/reference/service-api/scorers/scorer)** - Scorer Delete +- **[GET /v2/{entity}/{project}/scorers/{object_id}/versions/{digest}](https://docs.wandb.ai/weave/reference/service-api/scorers/scorer-read)** - Scorer Read + +### Evaluations + +- **[GET /v2/{entity}/{project}/evaluations](https://docs.wandb.ai/weave/reference/service-api/evaluations/evaluation-list)** - Evaluation List +- **[POST /v2/{entity}/{project}/evaluations](https://docs.wandb.ai/weave/reference/service-api/evaluations/evaluation-create)** - Evaluation Create +- **[DELETE /v2/{entity}/{project}/evaluations/{object_id}](https://docs.wandb.ai/weave/reference/service-api/evaluations/evaluation)** - Evaluation Delete +- **[GET /v2/{entity}/{project}/evaluations/{object_id}/versions/{digest}](https://docs.wandb.ai/weave/reference/service-api/evaluations/evaluation-read)** - Evaluation Read + +### Evaluation Runs + +- **[DELETE /v2/{entity}/{project}/evaluation_runs](https://docs.wandb.ai/weave/reference/service-api/evaluation runs/evaluation-run)** - Evaluation Run Delete +- **[GET /v2/{entity}/{project}/evaluation_runs](https://docs.wandb.ai/weave/reference/service-api/evaluation runs/evaluation-run-list)** - Evaluation Run List +- **[POST /v2/{entity}/{project}/evaluation_runs](https://docs.wandb.ai/weave/reference/service-api/evaluation runs/evaluation-run-create)** - Evaluation Run Create +- **[GET /v2/{entity}/{project}/evaluation_runs/{evaluation_run_id}](https://docs.wandb.ai/weave/reference/service-api/evaluation runs/evaluation-run-read)** - Evaluation Run Read +- **[POST /v2/{entity}/{project}/evaluation_runs/{evaluation_run_id}/finish](https://docs.wandb.ai/weave/reference/service-api/evaluation runs/evaluation-run-finish)** - Evaluation Run Finish + +### Models + +- **[GET /v2/{entity}/{project}/models](https://docs.wandb.ai/weave/reference/service-api/models/model-list)** - Model List +- **[POST /v2/{entity}/{project}/models](https://docs.wandb.ai/weave/reference/service-api/models/model-create)** - Model Create +- **[DELETE /v2/{entity}/{project}/models/{object_id}](https://docs.wandb.ai/weave/reference/service-api/models/model)** - Model Delete +- **[GET /v2/{entity}/{project}/models/{object_id}/versions/{digest}](https://docs.wandb.ai/weave/reference/service-api/models/model-read)** - Model Read + +### Predictions + +- **[DELETE /v2/{entity}/{project}/predictions](https://docs.wandb.ai/weave/reference/service-api/predictions/prediction)** - Prediction Delete +- **[GET /v2/{entity}/{project}/predictions](https://docs.wandb.ai/weave/reference/service-api/predictions/prediction-list)** - Prediction List +- **[POST /v2/{entity}/{project}/predictions](https://docs.wandb.ai/weave/reference/service-api/predictions/prediction-create)** - Prediction Create +- **[GET /v2/{entity}/{project}/predictions/{prediction_id}](https://docs.wandb.ai/weave/reference/service-api/predictions/prediction-read)** - Prediction Read +- **[POST /v2/{entity}/{project}/predictions/{prediction_id}/finish](https://docs.wandb.ai/weave/reference/service-api/predictions/prediction-finish)** - Prediction Finish + +### Scores + +- **[DELETE /v2/{entity}/{project}/scores](https://docs.wandb.ai/weave/reference/service-api/scores/score)** - Score Delete +- **[GET /v2/{entity}/{project}/scores](https://docs.wandb.ai/weave/reference/service-api/scores/score-list)** - Score List +- **[POST /v2/{entity}/{project}/scores](https://docs.wandb.ai/weave/reference/service-api/scores/score-create)** - Score Create +- **[GET /v2/{entity}/{project}/scores/{score_id}](https://docs.wandb.ai/weave/reference/service-api/scores/score-read)** - Score Read +### Calls + - **[POST /call/start](https://docs.wandb.ai/weave/reference/service-api/calls/call-start)** - Call Start - **[POST /call/end](https://docs.wandb.ai/weave/reference/service-api/calls/call-end)** - Call End - **[POST /call/upsert_batch](https://docs.wandb.ai/weave/reference/service-api/calls/call-start-batch)** - Call Start Batch diff --git a/weave/reference/service-api/openapi.json b/weave/reference/service-api/openapi.json index 6929dd4cae..dc287bc6b6 100644 --- a/weave/reference/service-api/openapi.json +++ b/weave/reference/service-api/openapi.json @@ -5,82 +5,60 @@ "version": "0.1.0" }, "paths": { - "/health": { + "/server_info": { "get": { "tags": [ "Service" ], - "summary": "Read Root", - "operationId": "read_root_health_get", + "summary": "Server Info", + "operationId": "server_info_server_info_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { - "schema": {} + "schema": { + "$ref": "#/components/schemas/ServerInfoRes" + } } } - } - } - } - }, - "/version": { - "get": { - "tags": [ - "Service" - ], - "summary": "Read Version", - "operationId": "read_version_version_get", - "responses": { - "200": { - "description": "Successful Response", + }, + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": {} + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } } } } - } + }, + "security": [ + { + "HTTPBasic": [] + } + ] } }, - "/geolocate": { + "/health": { "get": { "tags": [ "Service" ], - "summary": "Get Caller Location", - "description": "Lookup the geographic location of a user based on their IP address.\n\nThis API exists for debugging purposes and may not be available in the future.", - "operationId": "get_caller_location_geolocate_get", - "parameters": [ - { - "name": "ip", - "in": "query", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "IP address to geolocate, defaults to client IP address", - "examples": [ - "1.2.3.4" - ], - "title": "Ip" - }, - "description": "IP address to geolocate, defaults to client IP address" - } - ], + "summary": "Read Root", + "operationId": "read_root_health_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GeolocationRes" + "additionalProperties": { + "type": "string" + }, + "type": "object", + "title": "Response Read Root Health Get" } } } @@ -95,43 +73,39 @@ } } } - } - } - }, - "/server_info": { - "get": { - "tags": [ - "Service" - ], - "summary": "Server Info", - "operationId": "server_info_server_info_get", - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServerInfoRes" - } - } - } + }, + "security": [ + { + "HTTPBasic": [] } - } + ] } }, - "/otel/v1/traces": { + "/otel/v1/trace": { "post": { "tags": [ "OpenTelemetry" ], "summary": "Export Trace", - "operationId": "export_trace_otel_v1_traces_post", + "operationId": "export_trace_otel_v1_trace_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OtelExportReq" + } + } + }, + "required": true + }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { - "schema": {} + "schema": { + "$ref": "#/components/schemas/OtelExportRes" + } } } }, @@ -429,128 +403,6 @@ ] } }, - "/inference/router/openrouter/models": { - "get": { - "tags": [ - "Inference" - ], - "summary": "Inference Router Openrouter Models", - "description": "Returns a list of models that are available to be used with OpenRouter.\n\nThis API is available without authentication.", - "operationId": "inference_router_openrouter_models_inference_router_openrouter_models_get", - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RouterOpenRouterModelsRes" - } - } - } - } - } - } - }, - "/inference/v1{path}": { - "get": { - "tags": [ - "Inference" - ], - "summary": "Inference Get", - "description": "OpenAI-compatible APIs.", - "operationId": "inference_get_inference_v1_path__get", - "security": [ - { - "HTTPBearer": [] - } - ], - "parameters": [ - { - "name": "path", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Path" - } - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - }, - "post": { - "tags": [ - "Inference" - ], - "summary": "Inference Post", - "description": "OpenAI-compatible APIs.", - "operationId": "inference_post_inference_v1_path__post", - "security": [ - { - "HTTPBearer": [] - } - ], - "parameters": [ - { - "name": "path", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Path" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CompletionsCreateRequestInputs" - } - } - } - }, - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, "/calls/query_stats": { "post": { "tags": [ @@ -633,10 +485,15 @@ }, "responses": { "200": { - "description": "Successful Response", + "description": "Stream of data in JSONL format", "content": { - "application/json": { - "schema": {} + "application/jsonl": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CallSchema" + } + } } } }, @@ -929,18 +786,18 @@ ] } }, - "/table/create_from_digests": { + "/table/query": { "post": { "tags": [ "Tables" ], - "summary": "Table Create From Digests", - "operationId": "table_create_from_digests_table_create_from_digests_post", + "summary": "Table Query", + "operationId": "table_query_table_query_post", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TableCreateFromDigestsReq" + "$ref": "#/components/schemas/TableQueryReq" } } }, @@ -952,7 +809,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TableCreateRes" + "$ref": "#/components/schemas/TableQueryRes" } } } @@ -975,30 +832,48 @@ ] } }, - "/table/query": { + "/table/query_stream": { "post": { - "tags": [ - "Tables" + "summary": "Table Query Stream", + "operationId": "table_query_stream_table_query_stream_post", + "security": [ + { + "HTTPBasic": [] + } + ], + "parameters": [ + { + "name": "accept", + "in": "header", + "required": false, + "schema": { + "type": "string", + "default": "application/jsonl", + "title": "Accept" + } + } ], - "summary": "Table Query", - "operationId": "table_query_table_query_post", "requestBody": { + "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TableQueryReq" } } - }, - "required": true + } }, "responses": { "200": { - "description": "Successful Response", + "description": "Stream of data in JSONL format", "content": { - "application/json": { + "application/jsonl": { "schema": { - "$ref": "#/components/schemas/TableQueryRes" + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } } } } @@ -1013,12 +888,7 @@ } } } - }, - "security": [ - { - "HTTPBasic": [] - } - ] + } } }, "/table/query_stats": { @@ -1067,18 +937,18 @@ ] } }, - "/table/query_stats_batch": { + "/refs/read_batch": { "post": { "tags": [ - "Tables" + "Refs" ], - "summary": "Table Query Stats Batch", - "operationId": "table_query_stats_batch_table_query_stats_batch_post", + "summary": "Refs Read Batch", + "operationId": "refs_read_batch_refs_read_batch_post", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TableQueryStatsBatchReq" + "$ref": "#/components/schemas/RefsReadBatchReq" } } }, @@ -1090,7 +960,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TableQueryStatsBatchRes" + "$ref": "#/components/schemas/RefsReadBatchRes" } } } @@ -1113,64 +983,18 @@ ] } }, - "/refs/read_batch": { + "/file/create": { "post": { "tags": [ - "Refs" + "Files" ], - "summary": "Refs Read Batch", - "operationId": "refs_read_batch_refs_read_batch_post", + "summary": "File Create", + "operationId": "file_create_file_create_post", "requestBody": { "content": { - "application/json": { + "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/RefsReadBatchReq" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RefsReadBatchRes" - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - }, - "security": [ - { - "HTTPBasic": [] - } - ] - } - }, - "/file/create": { - "post": { - "tags": [ - "Files" - ], - "summary": "File Create", - "operationId": "file_create_file_create_post", - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/Body_file_create_file_create_post" + "$ref": "#/components/schemas/Body_file_create_file_create_post" } } }, @@ -1224,57 +1048,9 @@ }, "responses": { "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - }, - "security": [ - { - "HTTPBasic": [] - } - ] - } - }, - "/files/query_stats": { - "post": { - "tags": [ - "Files" - ], - "summary": "Files Stats", - "operationId": "files_stats_files_query_stats_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/FilesStatsReq" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Successful Response", + "description": "Binary file content stream", "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/FilesStatsRes" - } - } + "application/octet-stream": {} } }, "422": { @@ -1480,53 +1256,6 @@ ] } }, - "/feedback/batch/create": { - "post": { - "tags": [ - "Feedback" - ], - "summary": "Feedback Create Batch", - "description": "Add multiple feedback items to calls or objects.", - "operationId": "feedback_create_batch_feedback_batch_create_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/FeedbackCreateBatchReq" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/FeedbackCreateBatchRes" - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - }, - "security": [ - { - "HTTPBasic": [] - } - ] - } - }, "/feedback/query": { "post": { "tags": [ @@ -1667,18 +1396,18 @@ ] } }, - "/threads/stream_query": { + "/completions/create": { "post": { "tags": [ - "Threads" + "Completions" ], - "summary": "Threads Query Stream", - "operationId": "threads_query_stream_threads_stream_query_post", + "summary": "Completions Create", + "operationId": "completions_create_completions_create_post", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ThreadsQueryReq" + "$ref": "#/components/schemas/CompletionsCreateReq" } } }, @@ -1689,7 +1418,9 @@ "description": "Successful Response", "content": { "application/json": { - "schema": {} + "schema": { + "$ref": "#/components/schemas/CompletionsCreateRes" + } } } }, @@ -1711,18 +1442,18 @@ ] } }, - "/evaluations/evaluate_model": { + "/completions/create_stream": { "post": { "tags": [ - "Evaluations" + "Completions" ], - "summary": "Evaluate Model", - "operationId": "evaluate_model_evaluations_evaluate_model_post", + "summary": "Completions Create Stream", + "operationId": "completions_create_stream_completions_create_stream_post", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EvaluateModelReq" + "$ref": "#/components/schemas/CompletionsCreateReq" } } }, @@ -1730,11 +1461,15 @@ }, "responses": { "200": { - "description": "Successful Response", + "description": "Stream of data in JSONL format", "content": { - "application/json": { + "application/jsonl": { "schema": { - "$ref": "#/components/schemas/EvaluateModelRes" + "items": { + "additionalProperties": true, + "type": "object" + }, + "type": "array" } } } @@ -1757,18 +1492,18 @@ ] } }, - "/evaluations/status": { + "/threads/stream_query": { "post": { "tags": [ - "Evaluations" + "Threads" ], - "summary": "Evaluation Status", - "operationId": "evaluation_status_evaluations_status_post", + "summary": "Threads Query Stream", + "operationId": "threads_query_stream_threads_stream_query_post", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EvaluationStatusReq" + "$ref": "#/components/schemas/ThreadsQueryReq" } } }, @@ -1776,11 +1511,15 @@ }, "responses": { "200": { - "description": "Successful Response", + "description": "Stream of data in JSONL format", "content": { - "application/json": { + "application/jsonl": { "schema": { - "$ref": "#/components/schemas/EvaluationStatusRes" + "items": { + "additionalProperties": true, + "type": "object" + }, + "type": "array" } } } @@ -1803,22 +1542,48 @@ ] } }, - "/image/create": { + "/v2/{entity}/{project}/ops": { "post": { "tags": [ - "Images" + "Ops" + ], + "summary": "Op Create", + "description": "Create an op object.", + "operationId": "op_create", + "security": [ + { + "HTTPBasic": [] + } + ], + "parameters": [ + { + "name": "entity", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Entity" + } + }, + { + "name": "project", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Project" + } + } ], - "summary": "Image Create", - "operationId": "image_create_image_create_post", "requestBody": { + "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ImageGenerationCreateReq" + "$ref": "#/components/schemas/OpCreateBody" } } - }, - "required": true + } }, "responses": { "200": { @@ -1826,7 +1591,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ImageGenerationCreateRes" + "$ref": "#/components/schemas/OpCreateRes" } } } @@ -1841,59 +1606,2607 @@ } } } - }, + } + }, + "get": { + "tags": [ + "Ops" + ], + "summary": "Op List", + "description": "List op objects.", + "operationId": "op_list", "security": [ { "HTTPBasic": [] } - ] - } - } - }, - "components": { - "schemas": { - "AndOperation": { - "properties": { - "$and": { - "items": { + ], + "parameters": [ + { + "name": "entity", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Entity" + } + }, + { + "name": "project", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Project" + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { "anyOf": [ { - "$ref": "#/components/schemas/LiteralOperation" - }, - { - "$ref": "#/components/schemas/GetFieldOperator" - }, - { - "$ref": "#/components/schemas/ConvertOperation" - }, - { - "$ref": "#/components/schemas/AndOperation" - }, - { - "$ref": "#/components/schemas/OrOperation" - }, - { - "$ref": "#/components/schemas/NotOperation" - }, - { - "$ref": "#/components/schemas/EqOperation" - }, - { - "$ref": "#/components/schemas/GtOperation" + "type": "integer" }, { - "$ref": "#/components/schemas/GteOperation" - }, + "type": "null" + } + ], + "title": "Limit" + } + }, + { + "name": "offset", + "in": "query", + "required": false, + "schema": { + "anyOf": [ { - "$ref": "#/components/schemas/InOperation" + "type": "integer" }, { - "$ref": "#/components/schemas/ContainsOperation" + "type": "null" } - ] - }, - "type": "array", - "title": "$And" + ], + "title": "Offset" + } + } + ], + "responses": { + "200": { + "description": "Stream of data in JSONL format", + "content": { + "application/jsonl": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpReadRes" + } + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v2/{entity}/{project}/ops/{object_id}/versions/{digest}": { + "get": { + "tags": [ + "Ops" + ], + "summary": "Op Read", + "description": "Get an op object.", + "operationId": "op_read", + "security": [ + { + "HTTPBasic": [] + } + ], + "parameters": [ + { + "name": "entity", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Entity" + } + }, + { + "name": "project", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Project" + } + }, + { + "name": "object_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Object Id" + } + }, + { + "name": "digest", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Digest" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpReadRes" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v2/{entity}/{project}/ops/{object_id}": { + "delete": { + "tags": [ + "Ops" + ], + "summary": "Op Delete", + "description": "Delete an op object. If digests are provided, only those versions are deleted. Otherwise, all versions are deleted.", + "operationId": "op_delete", + "security": [ + { + "HTTPBasic": [] + } + ], + "parameters": [ + { + "name": "entity", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Entity" + } + }, + { + "name": "project", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Project" + } + }, + { + "name": "object_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Object Id" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "null" + } + ], + "title": "Digests" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpDeleteRes" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v2/{entity}/{project}/datasets": { + "post": { + "tags": [ + "Datasets" + ], + "summary": "Dataset Create", + "description": "Create a dataset object.", + "operationId": "dataset_create", + "security": [ + { + "HTTPBasic": [] + } + ], + "parameters": [ + { + "name": "entity", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Entity" + } + }, + { + "name": "project", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Project" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DatasetCreateBody" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DatasetCreateRes" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "get": { + "tags": [ + "Datasets" + ], + "summary": "Dataset List", + "description": "List dataset objects.", + "operationId": "dataset_list", + "security": [ + { + "HTTPBasic": [] + } + ], + "parameters": [ + { + "name": "entity", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Entity" + } + }, + { + "name": "project", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Project" + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Limit" + } + }, + { + "name": "offset", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Offset" + } + } + ], + "responses": { + "200": { + "description": "Stream of data in JSONL format", + "content": { + "application/jsonl": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DatasetReadRes" + } + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v2/{entity}/{project}/datasets/{object_id}/versions/{digest}": { + "get": { + "tags": [ + "Datasets" + ], + "summary": "Dataset Read", + "description": "Get a dataset object.", + "operationId": "dataset_read", + "security": [ + { + "HTTPBasic": [] + } + ], + "parameters": [ + { + "name": "entity", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Entity" + } + }, + { + "name": "project", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Project" + } + }, + { + "name": "object_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Object Id" + } + }, + { + "name": "digest", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Digest" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DatasetReadRes" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v2/{entity}/{project}/datasets/{object_id}": { + "delete": { + "tags": [ + "Datasets" + ], + "summary": "Dataset Delete", + "description": "Delete a dataset object.", + "operationId": "dataset_delete", + "security": [ + { + "HTTPBasic": [] + } + ], + "parameters": [ + { + "name": "entity", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Entity" + } + }, + { + "name": "project", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Project" + } + }, + { + "name": "object_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Object Id" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "null" + } + ], + "title": "Digests" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DatasetDeleteRes" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v2/{entity}/{project}/scorers": { + "post": { + "tags": [ + "Scorers" + ], + "summary": "Scorer Create", + "description": "Create a scorer object.", + "operationId": "scorer_create", + "security": [ + { + "HTTPBasic": [] + } + ], + "parameters": [ + { + "name": "entity", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Entity" + } + }, + { + "name": "project", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Project" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ScorerCreateBody" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ScorerCreateRes" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "get": { + "tags": [ + "Scorers" + ], + "summary": "Scorer List", + "description": "List scorer objects.", + "operationId": "scorer_list", + "security": [ + { + "HTTPBasic": [] + } + ], + "parameters": [ + { + "name": "entity", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Entity" + } + }, + { + "name": "project", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Project" + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Limit" + } + }, + { + "name": "offset", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Offset" + } + } + ], + "responses": { + "200": { + "description": "Stream of data in JSONL format", + "content": { + "application/jsonl": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ScorerReadRes" + } + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v2/{entity}/{project}/scorers/{object_id}/versions/{digest}": { + "get": { + "tags": [ + "Scorers" + ], + "summary": "Scorer Read", + "description": "Get a scorer object.", + "operationId": "scorer_read", + "security": [ + { + "HTTPBasic": [] + } + ], + "parameters": [ + { + "name": "entity", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Entity" + } + }, + { + "name": "project", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Project" + } + }, + { + "name": "object_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Object Id" + } + }, + { + "name": "digest", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Digest" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ScorerReadRes" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v2/{entity}/{project}/scorers/{object_id}": { + "delete": { + "tags": [ + "Scorers" + ], + "summary": "Scorer Delete", + "description": "Delete a scorer object.", + "operationId": "scorer_delete", + "security": [ + { + "HTTPBasic": [] + } + ], + "parameters": [ + { + "name": "entity", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Entity" + } + }, + { + "name": "project", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Project" + } + }, + { + "name": "object_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Object Id" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "null" + } + ], + "title": "Digests" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ScorerDeleteRes" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v2/{entity}/{project}/evaluations": { + "post": { + "tags": [ + "Evaluations" + ], + "summary": "Evaluation Create", + "description": "Create an evaluation object.", + "operationId": "evaluation_create", + "security": [ + { + "HTTPBasic": [] + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EvaluationCreateReq" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EvaluationCreateRes" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "get": { + "tags": [ + "Evaluations" + ], + "summary": "Evaluation List", + "description": "List evaluation objects.", + "operationId": "evaluation_list", + "security": [ + { + "HTTPBasic": [] + } + ], + "parameters": [ + { + "name": "entity", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Entity" + } + }, + { + "name": "project", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Project" + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Limit" + } + }, + { + "name": "offset", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Offset" + } + } + ], + "responses": { + "200": { + "description": "Stream of data in JSONL format", + "content": { + "application/jsonl": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EvaluationReadRes" + } + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v2/{entity}/{project}/evaluations/{object_id}/versions/{digest}": { + "get": { + "tags": [ + "Evaluations" + ], + "summary": "Evaluation Read", + "description": "Get an evaluation object.", + "operationId": "evaluation_read", + "security": [ + { + "HTTPBasic": [] + } + ], + "parameters": [ + { + "name": "entity", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Entity" + } + }, + { + "name": "project", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Project" + } + }, + { + "name": "object_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Object Id" + } + }, + { + "name": "digest", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Digest" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EvaluationReadRes" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v2/{entity}/{project}/evaluations/{object_id}": { + "delete": { + "tags": [ + "Evaluations" + ], + "summary": "Evaluation Delete", + "description": "Delete an evaluation object.", + "operationId": "evaluation_delete", + "security": [ + { + "HTTPBasic": [] + } + ], + "parameters": [ + { + "name": "entity", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Entity" + } + }, + { + "name": "project", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Project" + } + }, + { + "name": "object_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Object Id" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "null" + } + ], + "title": "Digests" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EvaluationDeleteRes" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v2/{entity}/{project}/evaluation_runs": { + "post": { + "tags": [ + "Evaluation Runs" + ], + "summary": "Evaluation Run Create", + "description": "Create an evaluation run.", + "operationId": "evaluation_run_create", + "security": [ + { + "HTTPBasic": [] + } + ], + "parameters": [ + { + "name": "entity", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Entity" + } + }, + { + "name": "project", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Project" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EvaluationRunCreateBody" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EvaluationRunCreateRes" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "get": { + "tags": [ + "Evaluation Runs" + ], + "summary": "Evaluation Run List", + "description": "List evaluation runs.", + "operationId": "evaluation_run_list", + "security": [ + { + "HTTPBasic": [] + } + ], + "parameters": [ + { + "name": "entity", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Entity" + } + }, + { + "name": "project", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Project" + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Limit" + } + }, + { + "name": "offset", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Offset" + } + } + ], + "responses": { + "200": { + "description": "Stream of data in JSONL format", + "content": { + "application/jsonl": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EvaluationRunReadRes" + } + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Evaluation Runs" + ], + "summary": "Evaluation Run Delete", + "description": "Delete evaluation runs.", + "operationId": "evaluation_run_delete", + "security": [ + { + "HTTPBasic": [] + } + ], + "parameters": [ + { + "name": "entity", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Entity" + } + }, + { + "name": "project", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Project" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "title": "Evaluation Run Ids" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EvaluationRunDeleteRes" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v2/{entity}/{project}/evaluation_runs/{evaluation_run_id}": { + "get": { + "tags": [ + "Evaluation Runs" + ], + "summary": "Evaluation Run Read", + "description": "Get an evaluation run.", + "operationId": "evaluation_run_read", + "security": [ + { + "HTTPBasic": [] + } + ], + "parameters": [ + { + "name": "entity", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Entity" + } + }, + { + "name": "project", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Project" + } + }, + { + "name": "evaluation_run_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Evaluation Run Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EvaluationRunReadRes" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v2/{entity}/{project}/evaluation_runs/{evaluation_run_id}/finish": { + "post": { + "tags": [ + "Evaluation Runs" + ], + "summary": "Evaluation Run Finish", + "description": "Finish an evaluation run.", + "operationId": "evaluation_run_finish", + "security": [ + { + "HTTPBasic": [] + } + ], + "parameters": [ + { + "name": "entity", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Entity" + } + }, + { + "name": "project", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Project" + } + }, + { + "name": "evaluation_run_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Evaluation Run Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EvaluationRunFinishBody" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EvaluationRunFinishRes" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v2/{entity}/{project}/models": { + "post": { + "tags": [ + "Models" + ], + "summary": "Model Create", + "description": "Create a model object.", + "operationId": "model_create", + "security": [ + { + "HTTPBasic": [] + } + ], + "parameters": [ + { + "name": "entity", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Entity" + } + }, + { + "name": "project", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Project" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ModelCreateBody" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ModelCreateRes" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "get": { + "tags": [ + "Models" + ], + "summary": "Model List", + "description": "List model objects.", + "operationId": "model_list", + "security": [ + { + "HTTPBasic": [] + } + ], + "parameters": [ + { + "name": "entity", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Entity" + } + }, + { + "name": "project", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Project" + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Limit" + } + }, + { + "name": "offset", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Offset" + } + } + ], + "responses": { + "200": { + "description": "Stream of data in JSONL format", + "content": { + "application/jsonl": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ModelReadRes" + } + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v2/{entity}/{project}/models/{object_id}/versions/{digest}": { + "get": { + "tags": [ + "Models" + ], + "summary": "Model Read", + "description": "Get a model object.", + "operationId": "model_read", + "security": [ + { + "HTTPBasic": [] + } + ], + "parameters": [ + { + "name": "entity", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Entity" + } + }, + { + "name": "project", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Project" + } + }, + { + "name": "object_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Object Id" + } + }, + { + "name": "digest", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Digest" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ModelReadRes" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v2/{entity}/{project}/models/{object_id}": { + "delete": { + "tags": [ + "Models" + ], + "summary": "Model Delete", + "description": "Delete a model object. If digests are provided, only those versions are deleted. Otherwise, all versions are deleted.", + "operationId": "model_delete", + "security": [ + { + "HTTPBasic": [] + } + ], + "parameters": [ + { + "name": "entity", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Entity" + } + }, + { + "name": "project", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Project" + } + }, + { + "name": "object_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Object Id" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "null" + } + ], + "title": "Digests" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ModelDeleteRes" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v2/{entity}/{project}/predictions": { + "post": { + "tags": [ + "Predictions" + ], + "summary": "Prediction Create", + "description": "Create a prediction.", + "operationId": "prediction_create", + "security": [ + { + "HTTPBasic": [] + } + ], + "parameters": [ + { + "name": "entity", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Entity" + } + }, + { + "name": "project", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Project" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PredictionCreateBody" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PredictionCreateRes" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "get": { + "tags": [ + "Predictions" + ], + "summary": "Prediction List", + "description": "List predictions.", + "operationId": "prediction_list", + "security": [ + { + "HTTPBasic": [] + } + ], + "parameters": [ + { + "name": "entity", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Entity" + } + }, + { + "name": "project", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Project" + } + }, + { + "name": "evaluation_run_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Evaluation Run Id" + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Limit" + } + }, + { + "name": "offset", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Offset" + } + } + ], + "responses": { + "200": { + "description": "Stream of data in JSONL format", + "content": { + "application/jsonl": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PredictionReadRes" + } + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Predictions" + ], + "summary": "Prediction Delete", + "description": "Delete predictions.", + "operationId": "prediction_delete", + "security": [ + { + "HTTPBasic": [] + } + ], + "parameters": [ + { + "name": "entity", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Entity" + } + }, + { + "name": "project", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Project" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "title": "Prediction Ids" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PredictionDeleteRes" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v2/{entity}/{project}/predictions/{prediction_id}": { + "get": { + "tags": [ + "Predictions" + ], + "summary": "Prediction Read", + "description": "Get a prediction.", + "operationId": "prediction_read", + "security": [ + { + "HTTPBasic": [] + } + ], + "parameters": [ + { + "name": "entity", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Entity" + } + }, + { + "name": "project", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Project" + } + }, + { + "name": "prediction_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Prediction Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PredictionReadRes" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v2/{entity}/{project}/predictions/{prediction_id}/finish": { + "post": { + "tags": [ + "Predictions" + ], + "summary": "Prediction Finish", + "description": "Finish a prediction.", + "operationId": "prediction_finish", + "security": [ + { + "HTTPBasic": [] + } + ], + "parameters": [ + { + "name": "entity", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Entity" + } + }, + { + "name": "project", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Project" + } + }, + { + "name": "prediction_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Prediction Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PredictionFinishRes" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v2/{entity}/{project}/scores": { + "post": { + "tags": [ + "Scores" + ], + "summary": "Score Create", + "description": "Create a score.", + "operationId": "score_create", + "security": [ + { + "HTTPBasic": [] + } + ], + "parameters": [ + { + "name": "entity", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Entity" + } + }, + { + "name": "project", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Project" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ScoreCreateBody" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ScoreCreateRes" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "get": { + "tags": [ + "Scores" + ], + "summary": "Score List", + "description": "List scores.", + "operationId": "score_list", + "security": [ + { + "HTTPBasic": [] + } + ], + "parameters": [ + { + "name": "entity", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Entity" + } + }, + { + "name": "project", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Project" + } + }, + { + "name": "evaluation_run_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Evaluation Run Id" + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Limit" + } + }, + { + "name": "offset", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Offset" + } + } + ], + "responses": { + "200": { + "description": "Stream of data in JSONL format", + "content": { + "application/jsonl": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ScoreReadRes" + } + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Scores" + ], + "summary": "Score Delete", + "description": "Delete scores.", + "operationId": "score_delete", + "security": [ + { + "HTTPBasic": [] + } + ], + "parameters": [ + { + "name": "entity", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Entity" + } + }, + { + "name": "project", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Project" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "title": "Score Ids" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ScoreDeleteRes" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v2/{entity}/{project}/scores/{score_id}": { + "get": { + "tags": [ + "Scores" + ], + "summary": "Score Read", + "description": "Get a score.", + "operationId": "score_read", + "security": [ + { + "HTTPBasic": [] + } + ], + "parameters": [ + { + "name": "entity", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Entity" + } + }, + { + "name": "project", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Project" + } + }, + { + "name": "score_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Score Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ScoreReadRes" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "AndOperation": { + "properties": { + "$and": { + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/LiteralOperation" + }, + { + "$ref": "#/components/schemas/GetFieldOperator" + }, + { + "$ref": "#/components/schemas/ConvertOperation" + }, + { + "$ref": "#/components/schemas/AndOperation" + }, + { + "$ref": "#/components/schemas/OrOperation" + }, + { + "$ref": "#/components/schemas/NotOperation" + }, + { + "$ref": "#/components/schemas/EqOperation" + }, + { + "$ref": "#/components/schemas/GtOperation" + }, + { + "$ref": "#/components/schemas/GteOperation" + }, + { + "$ref": "#/components/schemas/InOperation" + }, + { + "$ref": "#/components/schemas/ContainsOperation" + } + ] + }, + "type": "array", + "title": "$And" } }, "type": "object", @@ -1903,6 +4216,11 @@ "title": "AndOperation", "description": "Logical AND. All conditions must evaluate to true.\n\nExample:\n ```\n {\n \"$and\": [\n {\"$eq\": [{\"$getField\": \"op_name\"}, {\"$literal\": \"predict\"}]},\n {\"$gt\": [{\"$getField\": \"summary.usage.tokens\"}, {\"$literal\": 1000}]}\n ]\n }\n ```" }, + "BaseModel": { + "properties": {}, + "type": "object", + "title": "BaseModel" + }, "Body_file_create_file_create_post": { "properties": { "project_id": { @@ -1973,6 +4291,7 @@ "title": "Batch" } }, + "additionalProperties": false, "type": "object", "required": [ "batch" @@ -2162,10 +4481,12 @@ "title": "Started At" }, "attributes": { + "additionalProperties": true, "type": "object", "title": "Attributes" }, "inputs": { + "additionalProperties": true, "type": "object", "title": "Inputs" }, @@ -2202,6 +4523,7 @@ "title": "Output" }, "summary": { + "additionalProperties": true, "type": "object" }, "wb_user_id": { @@ -2408,8 +4730,17 @@ "title": "CallsDeleteReq" }, "CallsDeleteRes": { - "properties": {}, + "properties": { + "num_deleted": { + "type": "integer", + "title": "Num Deleted", + "description": "The number of calls deleted" + } + }, "type": "object", + "required": [ + "num_deleted" + ], "title": "CallsDeleteRes" }, "CallsFilter": { @@ -2842,6 +5173,49 @@ ], "title": "CallsQueryStatsRes" }, + "CompletionsCreateReq": { + "properties": { + "project_id": { + "type": "string", + "title": "Project Id" + }, + "inputs": { + "$ref": "#/components/schemas/CompletionsCreateRequestInputs" + }, + "wb_user_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Wb User Id", + "description": "Do not set directly. Server will automatically populate this field." + }, + "track_llm_call": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "title": "Track Llm Call", + "description": "Whether to track this LLM call in the trace server", + "default": true + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "project_id", + "inputs" + ], + "title": "CompletionsCreateReq" + }, "CompletionsCreateRequestInputs": { "properties": { "model": { @@ -2986,6 +5360,7 @@ "logit_bias": { "anyOf": [ { + "additionalProperties": true, "type": "object" }, { @@ -3008,6 +5383,7 @@ "response_format": { "anyOf": [ { + "additionalProperties": true, "type": "object" }, {}, @@ -3046,6 +5422,7 @@ "type": "string" }, { + "additionalProperties": true, "type": "object" }, { @@ -3090,6 +5467,7 @@ "extra_headers": { "anyOf": [ { + "additionalProperties": true, "type": "object" }, { @@ -3139,6 +5517,31 @@ ], "title": "CompletionsCreateRequestInputs" }, + "CompletionsCreateRes": { + "properties": { + "response": { + "additionalProperties": true, + "type": "object", + "title": "Response" + }, + "weave_call_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Weave Call Id" + } + }, + "type": "object", + "required": [ + "response" + ], + "title": "CompletionsCreateRes" + }, "ContainsOperation": { "properties": { "$contains": { @@ -3713,18 +6116,144 @@ ], "title": "CostQueryRes" }, - "Datacenter": { + "DatasetCreateBody": { + "properties": { + "name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Name", + "description": "The name of this dataset. Datasets with the same name will be versioned together." + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Description", + "description": "A description of this dataset" + }, + "rows": { + "items": { + "additionalProperties": true, + "type": "object" + }, + "type": "array", + "title": "Rows", + "description": "Dataset rows" + } + }, + "type": "object", + "required": [ + "rows" + ], + "title": "DatasetCreateBody" + }, + "DatasetCreateRes": { + "properties": { + "digest": { + "type": "string", + "title": "Digest", + "description": "The digest of the created dataset" + }, + "object_id": { + "type": "string", + "title": "Object Id", + "description": "The ID of the created dataset" + }, + "version_index": { + "type": "integer", + "title": "Version Index", + "description": "The version index of the created dataset" + } + }, + "type": "object", + "required": [ + "digest", + "object_id", + "version_index" + ], + "title": "DatasetCreateRes" + }, + "DatasetDeleteRes": { + "properties": { + "num_deleted": { + "type": "integer", + "title": "Num Deleted", + "description": "Number of dataset versions deleted" + } + }, + "type": "object", + "required": [ + "num_deleted" + ], + "title": "DatasetDeleteRes" + }, + "DatasetReadRes": { "properties": { - "country_code": { + "object_id": { + "type": "string", + "title": "Object Id", + "description": "The dataset ID" + }, + "digest": { + "type": "string", + "title": "Digest", + "description": "The digest of the dataset object" + }, + "version_index": { + "type": "integer", + "title": "Version Index", + "description": "The version index of the object" + }, + "created_at": { "type": "string", - "title": "Country Code" + "format": "date-time", + "title": "Created At", + "description": "When the object was created" + }, + "name": { + "type": "string", + "title": "Name", + "description": "The name of the dataset" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Description", + "description": "Description of the dataset" + }, + "rows": { + "type": "string", + "title": "Rows", + "description": "Reference to the dataset rows data" } }, "type": "object", "required": [ - "country_code" + "object_id", + "digest", + "version_index", + "created_at", + "name", + "rows" ], - "title": "Datacenter" + "title": "DatasetReadRes" }, "EndedCallSchemaForInsert": { "properties": { @@ -3864,32 +6393,93 @@ ] } ], - "type": "array", - "maxItems": 2, - "minItems": 2, - "title": "$Eq" - } - }, - "type": "object", - "required": [ - "$eq" - ], - "title": "EqOperation", - "description": "Equality check between two operands.\n\nExample:\n ```\n {\n \"$eq\": [{\"$getField\": \"op_name\"}, {\"$literal\": \"predict\"}]\n }\n ```" - }, - "EvaluateModelReq": { - "properties": { - "project_id": { - "type": "string", - "title": "Project Id" + "type": "array", + "maxItems": 2, + "minItems": 2, + "title": "$Eq" + } + }, + "type": "object", + "required": [ + "$eq" + ], + "title": "EqOperation", + "description": "Equality check between two operands.\n\nExample:\n ```\n {\n \"$eq\": [{\"$getField\": \"op_name\"}, {\"$literal\": \"predict\"}]\n }\n ```" + }, + "EvaluationCreateReq": { + "properties": { + "name": { + "type": "string", + "title": "Name", + "description": "The name of this evaluation. Evaluations with the same name will be versioned together." + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Description", + "description": "A description of this evaluation" + }, + "dataset": { + "type": "string", + "title": "Dataset", + "description": "Reference to the dataset (weave:// URI)" + }, + "scorers": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Scorers", + "description": "List of scorer references (weave:// URIs)" + }, + "trials": { + "type": "integer", + "title": "Trials", + "description": "Number of trials to run", + "default": 1 + }, + "evaluation_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Evaluation Name", + "description": "Name for the evaluation run" }, - "evaluation_ref": { - "type": "string", - "title": "Evaluation Ref" + "eval_attributes": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Eval Attributes", + "description": "Optional attributes for the evaluation" }, - "model_ref": { + "project_id": { "type": "string", - "title": "Model Ref" + "title": "Project Id", + "description": "The `entity/project` where this evaluation will be saved" }, "wb_user_id": { "anyOf": [ @@ -3904,63 +6494,155 @@ "description": "Do not set directly. Server will automatically populate this field." } }, - "additionalProperties": false, "type": "object", "required": [ - "project_id", - "evaluation_ref", - "model_ref" + "name", + "dataset", + "project_id" ], - "title": "EvaluateModelReq" + "title": "EvaluationCreateReq" }, - "EvaluateModelRes": { + "EvaluationCreateRes": { "properties": { - "call_id": { + "digest": { "type": "string", - "title": "Call Id" + "title": "Digest", + "description": "The digest of the created evaluation" + }, + "object_id": { + "type": "string", + "title": "Object Id", + "description": "The ID of the created evaluation" + }, + "version_index": { + "type": "integer", + "title": "Version Index", + "description": "The version index of the created evaluation" + }, + "evaluation_ref": { + "type": "string", + "title": "Evaluation Ref", + "description": "Full reference to the created evaluation" } }, "type": "object", "required": [ - "call_id" + "digest", + "object_id", + "version_index", + "evaluation_ref" ], - "title": "EvaluateModelRes" + "title": "EvaluationCreateRes" }, - "EvaluationStatusComplete": { + "EvaluationDeleteRes": { "properties": { - "code": { - "type": "string", - "enum": [ - "complete" - ], - "const": "complete", - "title": "Code", - "default": "complete" - }, - "output": { - "type": "object", - "title": "Output" + "num_deleted": { + "type": "integer", + "title": "Num Deleted", + "description": "Number of evaluation versions deleted" } }, - "additionalProperties": false, "type": "object", "required": [ - "output" + "num_deleted" ], - "title": "EvaluationStatusComplete" + "title": "EvaluationDeleteRes" }, - "EvaluationStatusFailed": { + "EvaluationReadRes": { "properties": { - "code": { + "object_id": { "type": "string", - "enum": [ - "failed" + "title": "Object Id", + "description": "The evaluation ID" + }, + "digest": { + "type": "string", + "title": "Digest", + "description": "The digest of the evaluation" + }, + "version_index": { + "type": "integer", + "title": "Version Index", + "description": "The version index of the evaluation" + }, + "created_at": { + "type": "string", + "format": "date-time", + "title": "Created At", + "description": "When the evaluation was created" + }, + "name": { + "type": "string", + "title": "Name", + "description": "The name of the evaluation" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } ], - "const": "failed", - "title": "Code", - "default": "failed" + "title": "Description", + "description": "A description of the evaluation" + }, + "dataset": { + "type": "string", + "title": "Dataset", + "description": "Dataset reference (weave:// URI)" + }, + "scorers": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Scorers", + "description": "List of scorer references (weave:// URIs)" + }, + "trials": { + "type": "integer", + "title": "Trials", + "description": "Number of trials" + }, + "evaluation_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Evaluation Name", + "description": "Name for the evaluation run" + }, + "evaluate_op": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Evaluate Op", + "description": "Evaluate op reference (weave:// URI)" + }, + "predict_and_score_op": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Predict And Score Op", + "description": "Predict and score op reference (weave:// URI)" }, - "error": { + "summarize_op": { "anyOf": [ { "type": "string" @@ -3969,134 +6651,199 @@ "type": "null" } ], - "title": "Error" + "title": "Summarize Op", + "description": "Summarize op reference (weave:// URI)" } }, - "additionalProperties": false, "type": "object", - "title": "EvaluationStatusFailed" + "required": [ + "object_id", + "digest", + "version_index", + "created_at", + "name", + "dataset", + "scorers", + "trials" + ], + "title": "EvaluationReadRes" }, - "EvaluationStatusNotFound": { + "EvaluationRunCreateBody": { "properties": { - "code": { + "evaluation": { "type": "string", - "enum": [ - "not_found" - ], - "const": "not_found", - "title": "Code", - "default": "not_found" + "title": "Evaluation", + "description": "Reference to the evaluation (weave:// URI)" + }, + "model": { + "type": "string", + "title": "Model", + "description": "Reference to the model (weave:// URI)" } }, - "additionalProperties": false, "type": "object", - "title": "EvaluationStatusNotFound" + "required": [ + "evaluation", + "model" + ], + "title": "EvaluationRunCreateBody" }, - "EvaluationStatusReq": { + "EvaluationRunCreateRes": { "properties": { - "project_id": { - "type": "string", - "title": "Project Id" - }, - "call_id": { + "evaluation_run_id": { "type": "string", - "title": "Call Id" + "title": "Evaluation Run Id", + "description": "The ID of the created evaluation run" } }, - "additionalProperties": false, "type": "object", "required": [ - "project_id", - "call_id" + "evaluation_run_id" ], - "title": "EvaluationStatusReq" + "title": "EvaluationRunCreateRes" }, - "EvaluationStatusRes": { + "EvaluationRunDeleteRes": { "properties": { - "status": { + "num_deleted": { + "type": "integer", + "title": "Num Deleted", + "description": "Number of evaluation runs deleted" + } + }, + "type": "object", + "required": [ + "num_deleted" + ], + "title": "EvaluationRunDeleteRes" + }, + "EvaluationRunFinishBody": { + "properties": { + "summary": { "anyOf": [ { - "$ref": "#/components/schemas/EvaluationStatusNotFound" - }, - { - "$ref": "#/components/schemas/EvaluationStatusRunning" - }, - { - "$ref": "#/components/schemas/EvaluationStatusFailed" + "additionalProperties": true, + "type": "object" }, { - "$ref": "#/components/schemas/EvaluationStatusComplete" + "type": "null" } ], - "title": "Status" + "title": "Summary", + "description": "Optional summary dictionary for the evaluation run" } }, "type": "object", - "required": [ - "status" - ], - "title": "EvaluationStatusRes" + "title": "EvaluationRunFinishBody", + "description": "Request body for finishing an evaluation run via REST API.\n\nThis model excludes project_id and evaluation_run_id since they come from the URL path in RESTful endpoints." }, - "EvaluationStatusRunning": { + "EvaluationRunFinishRes": { "properties": { - "code": { - "type": "string", - "enum": [ - "running" - ], - "const": "running", - "title": "Code", - "default": "running" - }, - "completed_rows": { - "type": "integer", - "title": "Completed Rows" - }, - "total_rows": { - "type": "integer", - "title": "Total Rows" + "success": { + "type": "boolean", + "title": "Success", + "description": "Whether the evaluation run was finished successfully" } }, - "additionalProperties": false, "type": "object", "required": [ - "completed_rows", - "total_rows" + "success" ], - "title": "EvaluationStatusRunning" + "title": "EvaluationRunFinishRes" }, - "FeedbackCreateBatchReq": { + "EvaluationRunReadRes": { "properties": { - "batch": { - "items": { - "$ref": "#/components/schemas/FeedbackCreateReq" - }, - "type": "array", - "title": "Batch" + "evaluation_run_id": { + "type": "string", + "title": "Evaluation Run Id", + "description": "The evaluation run ID" + }, + "evaluation": { + "type": "string", + "title": "Evaluation", + "description": "Reference to the evaluation (weave:// URI)" + }, + "model": { + "type": "string", + "title": "Model", + "description": "Reference to the model (weave:// URI)" + }, + "status": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Status", + "description": "Status of the evaluation run" + }, + "started_at": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ], + "title": "Started At", + "description": "When the evaluation run started" + }, + "finished_at": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ], + "title": "Finished At", + "description": "When the evaluation run finished" + }, + "summary": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Summary", + "description": "Summary data for the evaluation run" } }, - "additionalProperties": false, "type": "object", "required": [ - "batch" + "evaluation_run_id", + "evaluation", + "model" ], - "title": "FeedbackCreateBatchReq" + "title": "EvaluationRunReadRes" }, - "FeedbackCreateBatchRes": { - "properties": { - "res": { - "items": { - "$ref": "#/components/schemas/FeedbackCreateRes" - }, - "type": "array", - "title": "Res" + "ExportTracePartialSuccess": { + "properties": { + "rejected_spans": { + "type": "integer", + "title": "Rejected Spans" + }, + "error_message": { + "type": "string", + "title": "Error Message" } }, "type": "object", "required": [ - "res" + "rejected_spans", + "error_message" ], - "title": "FeedbackCreateBatchRes" + "title": "ExportTracePartialSuccess" }, "FeedbackCreateReq": { "properties": { @@ -4151,6 +6898,7 @@ ] }, "payload": { + "additionalProperties": true, "type": "object", "title": "Payload", "examples": [ @@ -4254,6 +7002,7 @@ "title": "Wb User Id" }, "payload": { + "additionalProperties": true, "type": "object", "title": "Payload" } @@ -4387,6 +7136,7 @@ "properties": { "result": { "items": { + "additionalProperties": true, "type": "object" }, "type": "array", @@ -4452,6 +7202,7 @@ ] }, "payload": { + "additionalProperties": true, "type": "object", "title": "Payload", "examples": [ @@ -4560,6 +7311,7 @@ "title": "Wb User Id" }, "payload": { + "additionalProperties": true, "type": "object", "title": "Payload" } @@ -4605,120 +7357,6 @@ ], "title": "FileCreateRes" }, - "FilesStatsReq": { - "properties": { - "project_id": { - "type": "string", - "title": "Project Id" - } - }, - "additionalProperties": false, - "type": "object", - "required": [ - "project_id" - ], - "title": "FilesStatsReq" - }, - "FilesStatsRes": { - "properties": { - "total_size_bytes": { - "type": "integer", - "title": "Total Size Bytes" - } - }, - "type": "object", - "required": [ - "total_size_bytes" - ], - "title": "FilesStatsRes" - }, - "Geolocation": { - "properties": { - "file_index": { - "type": "integer", - "title": "File Index", - "description": "row in CSV file" - }, - "range_start_int": { - "type": "integer", - "title": "Range Start Int", - "description": "Start of IP range as integer" - }, - "range_end_int": { - "type": "integer", - "title": "Range End Int", - "description": "End of IP range as integer" - }, - "range_start_ip": { - "type": "string", - "title": "Range Start Ip", - "description": "Start of IP range in dotted decimal notation" - }, - "range_end_ip": { - "type": "string", - "title": "Range End Ip", - "description": "End of IP range in dotted decimal notation" - }, - "country_code": { - "type": "string", - "title": "Country Code", - "description": "2-letter country code in ISO 3166-1 Alpha 2 format" - }, - "country_name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Country Name", - "description": "Country name, None if could not be determined" - } - }, - "type": "object", - "required": [ - "file_index", - "range_start_int", - "range_end_int", - "range_start_ip", - "range_end_ip", - "country_code" - ], - "title": "Geolocation" - }, - "GeolocationRes": { - "properties": { - "ip": { - "type": "string", - "title": "Ip", - "description": "Resolved IP address, useful for debugging" - }, - "location": { - "anyOf": [ - { - "$ref": "#/components/schemas/Geolocation" - }, - { - "type": "null" - } - ], - "description": "Information about the location of the IP address, None if could not be determined" - }, - "allowed": { - "type": "boolean", - "title": "Allowed", - "description": "Whether the IP address is allowed to be used for inference.", - "default": false - } - }, - "type": "object", - "required": [ - "ip" - ], - "title": "GeolocationRes" - }, "GetFieldOperator": { "properties": { "$getField": { @@ -4904,42 +7542,250 @@ ] } ], - "type": "array", - "maxItems": 2, - "minItems": 2, - "title": "$Gte" + "type": "array", + "maxItems": 2, + "minItems": 2, + "title": "$Gte" + } + }, + "type": "object", + "required": [ + "$gte" + ], + "title": "GteOperation", + "description": "Greater than or equal comparison.\n\nExample:\n ```\n {\n \"$gte\": [{\"$getField\": \"summary.usage.tokens\"}, {\"$literal\": 100}]\n }\n ```" + }, + "HTTPValidationError": { + "properties": { + "detail": { + "items": { + "$ref": "#/components/schemas/ValidationError" + }, + "type": "array", + "title": "Detail" + } + }, + "type": "object", + "title": "HTTPValidationError" + }, + "InOperation": { + "properties": { + "$in": { + "prefixItems": [ + { + "anyOf": [ + { + "$ref": "#/components/schemas/LiteralOperation" + }, + { + "$ref": "#/components/schemas/GetFieldOperator" + }, + { + "$ref": "#/components/schemas/ConvertOperation" + }, + { + "$ref": "#/components/schemas/AndOperation" + }, + { + "$ref": "#/components/schemas/OrOperation" + }, + { + "$ref": "#/components/schemas/NotOperation" + }, + { + "$ref": "#/components/schemas/EqOperation" + }, + { + "$ref": "#/components/schemas/GtOperation" + }, + { + "$ref": "#/components/schemas/GteOperation" + }, + { + "$ref": "#/components/schemas/InOperation" + }, + { + "$ref": "#/components/schemas/ContainsOperation" + } + ] + }, + { + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/LiteralOperation" + }, + { + "$ref": "#/components/schemas/GetFieldOperator" + }, + { + "$ref": "#/components/schemas/ConvertOperation" + }, + { + "$ref": "#/components/schemas/AndOperation" + }, + { + "$ref": "#/components/schemas/OrOperation" + }, + { + "$ref": "#/components/schemas/NotOperation" + }, + { + "$ref": "#/components/schemas/EqOperation" + }, + { + "$ref": "#/components/schemas/GtOperation" + }, + { + "$ref": "#/components/schemas/GteOperation" + }, + { + "$ref": "#/components/schemas/InOperation" + }, + { + "$ref": "#/components/schemas/ContainsOperation" + } + ] + }, + "type": "array" + } + ], + "type": "array", + "maxItems": 2, + "minItems": 2, + "title": "$In" + } + }, + "type": "object", + "required": [ + "$in" + ], + "title": "InOperation", + "description": "Membership check.\n\nReturns true if the left operand is in the list provided as the second operand.\n\nExample:\n ```\n {\n \"$in\": [\n {\"$getField\": \"op_name\"},\n [{\"$literal\": \"predict\"}, {\"$literal\": \"generate\"}]\n ]\n }\n ```" + }, + "LLMUsageSchema": { + "properties": { + "prompt_tokens": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Prompt Tokens" + }, + "input_tokens": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Input Tokens" + }, + "completion_tokens": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Completion Tokens" + }, + "output_tokens": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Output Tokens" + }, + "requests": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Requests" + }, + "total_tokens": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Total Tokens" } }, + "additionalProperties": true, "type": "object", - "required": [ - "$gte" - ], - "title": "GteOperation", - "description": "Greater than or equal comparison.\n\nExample:\n ```\n {\n \"$gte\": [{\"$getField\": \"summary.usage.tokens\"}, {\"$literal\": 100}]\n }\n ```" + "title": "LLMUsageSchema" }, - "HTTPValidationError": { + "LiteralOperation": { "properties": { - "detail": { - "items": { - "$ref": "#/components/schemas/ValidationError" - }, - "type": "array", - "title": "Detail" + "$literal": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "additionalProperties": { + "$ref": "#/components/schemas/LiteralOperation" + }, + "type": "object" + }, + { + "items": { + "$ref": "#/components/schemas/LiteralOperation" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "$Literal" } }, "type": "object", - "title": "HTTPValidationError" + "required": [ + "$literal" + ], + "title": "LiteralOperation", + "description": "Represents a constant value in the query language.\n\nThis can be any standard JSON-serializable value.\n\nExample:\n ```\n {\"$literal\": \"predict\"}\n ```" }, - "ImageGenerationCreateReq": { + "ModelCreateBody": { "properties": { - "project_id": { + "name": { "type": "string", - "title": "Project Id" - }, - "inputs": { - "$ref": "#/components/schemas/ImageGenerationRequestInputs" + "title": "Name", + "description": "The name of this model. Models with the same name will be versioned together." }, - "wb_user_id": { + "description": { "anyOf": [ { "type": "string" @@ -4948,86 +7794,154 @@ "type": "null" } ], - "title": "Wb User Id", - "description": "Do not set directly. Server will automatically populate this field." + "title": "Description", + "description": "A description of this model" }, - "track_llm_call": { + "source_code": { + "type": "string", + "title": "Source Code", + "description": "Complete source code for the Model class including imports" + }, + "attributes": { "anyOf": [ { - "type": "boolean" + "additionalProperties": true, + "type": "object" }, { "type": "null" } ], - "title": "Track Llm Call", - "description": "Whether to track this image generation call in the trace server", - "default": true + "title": "Attributes", + "description": "Additional attributes to be stored with the model" } }, "type": "object", "required": [ - "project_id", - "inputs" + "name", + "source_code" ], - "title": "ImageGenerationCreateReq" + "title": "ModelCreateBody" }, - "ImageGenerationCreateRes": { + "ModelCreateRes": { "properties": { - "response": { - "type": "object", - "title": "Response" + "digest": { + "type": "string", + "title": "Digest", + "description": "The digest of the created model" }, - "weave_call_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Weave Call Id" + "object_id": { + "type": "string", + "title": "Object Id", + "description": "The ID of the created model" + }, + "version_index": { + "type": "integer", + "title": "Version Index", + "description": "The version index of the created model" + }, + "model_ref": { + "type": "string", + "title": "Model Ref", + "description": "Full reference to the created model" } }, "type": "object", "required": [ - "response" + "digest", + "object_id", + "version_index", + "model_ref" ], - "title": "ImageGenerationCreateRes" + "title": "ModelCreateRes" }, - "ImageGenerationRequestInputs": { + "ModelDeleteRes": { "properties": { - "model": { + "num_deleted": { + "type": "integer", + "title": "Num Deleted", + "description": "Number of model versions deleted" + } + }, + "type": "object", + "required": [ + "num_deleted" + ], + "title": "ModelDeleteRes" + }, + "ModelReadRes": { + "properties": { + "object_id": { "type": "string", - "title": "Model" + "title": "Object Id", + "description": "The model ID" }, - "prompt": { + "digest": { "type": "string", - "title": "Prompt" + "title": "Digest", + "description": "The digest of the model" }, - "n": { + "version_index": { + "type": "integer", + "title": "Version Index", + "description": "The version index of the object" + }, + "created_at": { + "type": "string", + "format": "date-time", + "title": "Created At", + "description": "When the model was created" + }, + "name": { + "type": "string", + "title": "Name", + "description": "The name of the model" + }, + "description": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "title": "N" + "title": "Description", + "description": "Description of the model" + }, + "source_code": { + "type": "string", + "title": "Source Code", + "description": "The source code of the model" + }, + "attributes": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Attributes", + "description": "Additional attributes stored with the model" } }, "type": "object", "required": [ - "model", - "prompt" + "object_id", + "digest", + "version_index", + "created_at", + "name", + "source_code" ], - "title": "ImageGenerationRequestInputs" + "title": "ModelReadRes" }, - "InOperation": { + "NotOperation": { "properties": { - "$in": { + "$not": { "prefixItems": [ { "anyOf": [ @@ -5065,75 +7979,135 @@ "$ref": "#/components/schemas/ContainsOperation" } ] + } + ], + "type": "array", + "maxItems": 1, + "minItems": 1, + "title": "$Not" + } + }, + "type": "object", + "required": [ + "$not" + ], + "title": "NotOperation", + "description": "Logical NOT. Inverts the condition.\n\nExample:\n ```\n {\n \"$not\": [\n {\"$eq\": [{\"$getField\": \"op_name\"}, {\"$literal\": \"debug\"}]}\n ]\n }\n ```" + }, + "ObjCreateReq": { + "properties": { + "obj": { + "$ref": "#/components/schemas/ObjSchemaForInsert" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "obj" + ], + "title": "ObjCreateReq" + }, + "ObjCreateRes": { + "properties": { + "digest": { + "type": "string", + "title": "Digest" + }, + "object_id": { + "anyOf": [ + { + "type": "string" }, { - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/LiteralOperation" - }, - { - "$ref": "#/components/schemas/GetFieldOperator" - }, - { - "$ref": "#/components/schemas/ConvertOperation" - }, - { - "$ref": "#/components/schemas/AndOperation" - }, - { - "$ref": "#/components/schemas/OrOperation" - }, - { - "$ref": "#/components/schemas/NotOperation" - }, - { - "$ref": "#/components/schemas/EqOperation" - }, - { - "$ref": "#/components/schemas/GtOperation" - }, - { - "$ref": "#/components/schemas/GteOperation" - }, - { - "$ref": "#/components/schemas/InOperation" - }, - { - "$ref": "#/components/schemas/ContainsOperation" - } - ] + "type": "null" + } + ], + "title": "Object Id" + } + }, + "type": "object", + "required": [ + "digest" + ], + "title": "ObjCreateRes" + }, + "ObjDeleteReq": { + "properties": { + "project_id": { + "type": "string", + "title": "Project Id" + }, + "object_id": { + "type": "string", + "title": "Object Id" + }, + "digests": { + "anyOf": [ + { + "items": { + "type": "string" }, "type": "array" + }, + { + "type": "null" } ], - "type": "array", - "maxItems": 2, - "minItems": 2, - "title": "$In" + "title": "Digests", + "description": "List of digests to delete. If not provided, all digests for the object will be deleted." } }, + "additionalProperties": false, "type": "object", "required": [ - "$in" + "project_id", + "object_id" ], - "title": "InOperation", - "description": "Membership check.\n\nReturns true if the left operand is in the list provided as the second operand.\n\nExample:\n ```\n {\n \"$in\": [\n {\"$getField\": \"op_name\"},\n [{\"$literal\": \"predict\"}, {\"$literal\": \"generate\"}]\n ]\n }\n ```" + "title": "ObjDeleteReq" }, - "LLMUsageSchema": { + "ObjDeleteRes": { "properties": { - "prompt_tokens": { + "num_deleted": { + "type": "integer", + "title": "Num Deleted" + } + }, + "type": "object", + "required": [ + "num_deleted" + ], + "title": "ObjDeleteRes" + }, + "ObjQueryReq": { + "properties": { + "project_id": { + "type": "string", + "title": "Project Id", + "description": "The ID of the project to query", + "examples": [ + "user/project" + ] + }, + "filter": { "anyOf": [ { - "type": "integer" + "$ref": "#/components/schemas/ObjectVersionFilter" }, { "type": "null" } ], - "title": "Prompt Tokens" + "description": "Filter criteria for the query. See `ObjectVersionFilter`", + "examples": [ + { + "latest_only": true, + "object_ids": [ + "my_favorite_model" + ] + } + ] }, - "input_tokens": { + "limit": { "anyOf": [ { "type": "integer" @@ -5142,9 +8116,13 @@ "type": "null" } ], - "title": "Input Tokens" + "title": "Limit", + "description": "Maximum number of results to return", + "examples": [ + 100 + ] }, - "completion_tokens": { + "offset": { "anyOf": [ { "type": "integer" @@ -5153,169 +8131,241 @@ "type": "null" } ], - "title": "Completion Tokens" + "title": "Offset", + "description": "Number of results to skip before returning", + "examples": [ + 0 + ] }, - "output_tokens": { + "sort_by": { "anyOf": [ { - "type": "integer" + "items": { + "$ref": "#/components/schemas/SortBy" + }, + "type": "array" }, { "type": "null" } ], - "title": "Output Tokens" + "title": "Sort By", + "description": "Sorting criteria for the query results. Currently only supports 'object_id' and 'created_at'.", + "examples": [ + [ + { + "direction": "desc", + "field": "created_at" + } + ] + ] }, - "requests": { + "metadata_only": { "anyOf": [ { - "type": "integer" + "type": "boolean" }, { "type": "null" } ], - "title": "Requests" + "title": "Metadata Only", + "description": "If true, the `val` column is not read from the database and is empty.All other fields are returned.", + "default": false }, - "total_tokens": { + "include_storage_size": { "anyOf": [ { - "type": "integer" + "type": "boolean" }, { "type": "null" } ], - "title": "Total Tokens" + "title": "Include Storage Size", + "description": "If true, the `size_bytes` column is returned.", + "default": false } }, + "additionalProperties": false, "type": "object", - "title": "LLMUsageSchema" + "required": [ + "project_id" + ], + "title": "ObjQueryReq" }, - "LiteralOperation": { + "ObjQueryRes": { "properties": { - "$literal": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "boolean" - }, - { - "additionalProperties": { - "$ref": "#/components/schemas/LiteralOperation" - }, - "type": "object" - }, - { - "items": { - "$ref": "#/components/schemas/LiteralOperation" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "title": "$Literal" + "objs": { + "items": { + "$ref": "#/components/schemas/ObjSchema" + }, + "type": "array", + "title": "Objs" } }, "type": "object", "required": [ - "$literal" + "objs" ], - "title": "LiteralOperation", - "description": "Represents a constant value in the query language.\n\nThis can be any standard JSON-serializable value.\n\nExample:\n ```\n {\"$literal\": \"predict\"}\n ```" + "title": "ObjQueryRes" }, - "NotOperation": { + "ObjReadReq": { "properties": { - "$not": { - "prefixItems": [ + "project_id": { + "type": "string", + "title": "Project Id" + }, + "object_id": { + "type": "string", + "title": "Object Id" + }, + "digest": { + "type": "string", + "title": "Digest" + }, + "metadata_only": { + "anyOf": [ { - "anyOf": [ - { - "$ref": "#/components/schemas/LiteralOperation" - }, - { - "$ref": "#/components/schemas/GetFieldOperator" - }, - { - "$ref": "#/components/schemas/ConvertOperation" - }, - { - "$ref": "#/components/schemas/AndOperation" - }, - { - "$ref": "#/components/schemas/OrOperation" - }, - { - "$ref": "#/components/schemas/NotOperation" - }, - { - "$ref": "#/components/schemas/EqOperation" - }, - { - "$ref": "#/components/schemas/GtOperation" - }, - { - "$ref": "#/components/schemas/GteOperation" - }, - { - "$ref": "#/components/schemas/InOperation" - }, - { - "$ref": "#/components/schemas/ContainsOperation" - } - ] + "type": "boolean" + }, + { + "type": "null" } ], - "type": "array", - "maxItems": 1, - "minItems": 1, - "title": "$Not" + "title": "Metadata Only", + "description": "If true, the `val` column is not read from the database and is empty.All other fields are returned.", + "default": false } }, + "additionalProperties": false, "type": "object", "required": [ - "$not" + "project_id", + "object_id", + "digest" ], - "title": "NotOperation", - "description": "Logical NOT. Inverts the condition.\n\nExample:\n ```\n {\n \"$not\": [\n {\"$eq\": [{\"$getField\": \"op_name\"}, {\"$literal\": \"debug\"}]}\n ]\n }\n ```" + "title": "ObjReadReq" }, - "ObjCreateReq": { + "ObjReadRes": { "properties": { "obj": { - "$ref": "#/components/schemas/ObjSchemaForInsert" + "$ref": "#/components/schemas/ObjSchema" } }, - "additionalProperties": false, "type": "object", "required": [ "obj" ], - "title": "ObjCreateReq" + "title": "ObjReadRes" }, - "ObjCreateRes": { + "ObjSchema": { "properties": { + "project_id": { + "type": "string", + "title": "Project Id" + }, + "object_id": { + "type": "string", + "title": "Object Id" + }, + "created_at": { + "type": "string", + "format": "date-time", + "title": "Created At" + }, + "deleted_at": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ], + "title": "Deleted At" + }, "digest": { "type": "string", "title": "Digest" + }, + "version_index": { + "type": "integer", + "title": "Version Index" + }, + "is_latest": { + "type": "integer", + "title": "Is Latest" + }, + "kind": { + "type": "string", + "title": "Kind" + }, + "base_object_class": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Base Object Class" + }, + "leaf_object_class": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Leaf Object Class" + }, + "val": { + "title": "Val" + }, + "wb_user_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Wb User Id", + "description": "Do not set directly. Server will automatically populate this field." + }, + "size_bytes": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Size Bytes" } }, "type": "object", "required": [ - "digest" + "project_id", + "object_id", + "created_at", + "digest", + "version_index", + "is_latest", + "kind", + "base_object_class", + "val" ], - "title": "ObjCreateRes" + "title": "ObjSchema" }, - "ObjDeleteReq": { + "ObjSchemaForInsert": { "properties": { "project_id": { "type": "string", @@ -5325,268 +8375,368 @@ "type": "string", "title": "Object Id" }, - "digests": { + "val": { + "title": "Val" + }, + "builtin_object_class": { "anyOf": [ { - "items": { - "type": "string" - }, - "type": "array" + "type": "string" }, { "type": "null" } ], - "title": "Digests", - "description": "List of digests to delete. If not provided, all digests for the object will be deleted." + "title": "Builtin Object Class" + }, + "set_base_object_class": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Set Base Object Class", + "deprecated": true + }, + "wb_user_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Wb User Id", + "description": "Do not set directly. Server will automatically populate this field." } }, - "additionalProperties": false, "type": "object", "required": [ "project_id", - "object_id" - ], - "title": "ObjDeleteReq" - }, - "ObjDeleteRes": { - "properties": { - "num_deleted": { - "type": "integer", - "title": "Num Deleted" - } - }, - "type": "object", - "required": [ - "num_deleted" + "object_id", + "val" ], - "title": "ObjDeleteRes" + "title": "ObjSchemaForInsert" }, - "ObjQueryReq": { + "ObjectVersionFilter": { "properties": { - "project_id": { - "type": "string", - "title": "Project Id", - "description": "The ID of the project to query", + "base_object_classes": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Base Object Classes", + "description": "Filter objects by their base classes", "examples": [ - "user/project" + [ + "Model" + ], + [ + "Dataset" + ] ] }, - "filter": { + "exclude_base_object_classes": { "anyOf": [ { - "$ref": "#/components/schemas/ObjectVersionFilter" + "items": { + "type": "string" + }, + "type": "array" }, { "type": "null" } ], - "description": "Filter criteria for the query. See `ObjectVersionFilter`", + "title": "Exclude Base Object Classes", + "description": "Exclude objects by their base classes", "examples": [ + [ + "Model" + ], + [ + "Dataset" + ] + ] + }, + "leaf_object_classes": { + "anyOf": [ { - "latest_only": true, - "object_ids": [ - "my_favorite_model" - ] + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" } + ], + "title": "Leaf Object Classes", + "description": "Filter objects by their leaf classes", + "examples": [ + [ + "Model" + ], + [ + "Dataset" + ], + [ + "LLMStructuredCompletionModel" + ] ] }, - "limit": { + "object_ids": { "anyOf": [ { - "type": "integer" + "items": { + "type": "string" + }, + "type": "array" }, { "type": "null" } ], - "title": "Limit", - "description": "Maximum number of results to return", + "title": "Object Ids", + "description": "Filter objects by their IDs", "examples": [ - 100 + "my_favorite_model", + "my_favorite_dataset" ] }, - "offset": { + "is_op": { "anyOf": [ { - "type": "integer" + "type": "boolean" }, { "type": "null" } ], - "title": "Offset", - "description": "Number of results to skip before returning", + "title": "Is Op", + "description": "Filter objects based on whether they are weave.ops or not. `True` will only return ops, `False` will return non-ops, and `None` will return all objects", "examples": [ - 0 + true, + false, + null ] }, - "sort_by": { + "latest_only": { "anyOf": [ { - "items": { - "$ref": "#/components/schemas/SortBy" - }, - "type": "array" + "type": "boolean" }, { "type": "null" } ], - "title": "Sort By", - "description": "Sorting criteria for the query results. Currently only supports 'object_id' and 'created_at'.", + "title": "Latest Only", + "description": "If True, return only the latest version of each object. `False` and `None` will return all versions", "examples": [ - [ - { - "direction": "desc", - "field": "created_at" - } - ] + true, + false ] - }, - "metadata_only": { + } + }, + "additionalProperties": false, + "type": "object", + "title": "ObjectVersionFilter" + }, + "OpCreateBody": { + "properties": { + "name": { "anyOf": [ { - "type": "boolean" + "type": "string" }, { "type": "null" } ], - "title": "Metadata Only", - "description": "If true, the `val` column is not read from the database and is empty.All other fields are returned.", - "default": false + "title": "Name", + "description": "The name of this op. Ops with the same name will be versioned together." }, - "include_storage_size": { + "source_code": { "anyOf": [ { - "type": "boolean" + "type": "string" }, { "type": "null" } ], - "title": "Include Storage Size", - "description": "If true, the `size_bytes` column is returned.", - "default": false + "title": "Source Code", + "description": "Complete source code for this op, including imports" + } + }, + "type": "object", + "title": "OpCreateBody", + "description": "Request body for creating an Op object via REST API.\n\nThis model excludes project_id since it comes from the URL path in RESTful endpoints." + }, + "OpCreateRes": { + "properties": { + "digest": { + "type": "string", + "title": "Digest", + "description": "The digest of the created op" + }, + "object_id": { + "type": "string", + "title": "Object Id", + "description": "The ID of the created op" + }, + "version_index": { + "type": "integer", + "title": "Version Index", + "description": "The version index of the created op" } }, - "additionalProperties": false, "type": "object", "required": [ - "project_id" + "digest", + "object_id", + "version_index" ], - "title": "ObjQueryReq" + "title": "OpCreateRes", + "description": "Response model for creating an Op object." }, - "ObjQueryRes": { + "OpDeleteRes": { "properties": { - "objs": { - "items": { - "$ref": "#/components/schemas/ObjSchema" - }, - "type": "array", - "title": "Objs" + "num_deleted": { + "type": "integer", + "title": "Num Deleted", + "description": "Number of op versions deleted from this op" } }, "type": "object", "required": [ - "objs" + "num_deleted" ], - "title": "ObjQueryRes" + "title": "OpDeleteRes" }, - "ObjReadReq": { + "OpReadRes": { "properties": { - "project_id": { - "type": "string", - "title": "Project Id" - }, "object_id": { "type": "string", - "title": "Object Id" + "title": "Object Id", + "description": "The op ID" }, "digest": { "type": "string", - "title": "Digest" + "title": "Digest", + "description": "The digest of the op" }, - "metadata_only": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "title": "Metadata Only", - "description": "If true, the `val` column is not read from the database and is empty.All other fields are returned.", - "default": false + "version_index": { + "type": "integer", + "title": "Version Index", + "description": "The version index of this op" + }, + "created_at": { + "type": "string", + "format": "date-time", + "title": "Created At", + "description": "When this op was created" + }, + "code": { + "type": "string", + "title": "Code", + "description": "The actual op source code" } }, - "additionalProperties": false, "type": "object", "required": [ - "project_id", "object_id", - "digest" + "digest", + "version_index", + "created_at", + "code" ], - "title": "ObjReadReq" + "title": "OpReadRes", + "description": "Response model for reading an Op object.\n\nThe code field contains the actual source code of the op." }, - "ObjReadRes": { + "OrOperation": { "properties": { - "obj": { - "$ref": "#/components/schemas/ObjSchema" + "$or": { + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/LiteralOperation" + }, + { + "$ref": "#/components/schemas/GetFieldOperator" + }, + { + "$ref": "#/components/schemas/ConvertOperation" + }, + { + "$ref": "#/components/schemas/AndOperation" + }, + { + "$ref": "#/components/schemas/OrOperation" + }, + { + "$ref": "#/components/schemas/NotOperation" + }, + { + "$ref": "#/components/schemas/EqOperation" + }, + { + "$ref": "#/components/schemas/GtOperation" + }, + { + "$ref": "#/components/schemas/GteOperation" + }, + { + "$ref": "#/components/schemas/InOperation" + }, + { + "$ref": "#/components/schemas/ContainsOperation" + } + ] + }, + "type": "array", + "title": "$Or" } }, "type": "object", "required": [ - "obj" + "$or" ], - "title": "ObjReadRes" + "title": "OrOperation", + "description": "Logical OR. At least one condition must be true.\n\nExample:\n ```\n {\n \"$or\": [\n {\"$eq\": [{\"$getField\": \"op_name\"}, {\"$literal\": \"a\"}]},\n {\"$eq\": [{\"$getField\": \"op_name\"}, {\"$literal\": \"b\"}]}\n ]\n }\n ```" }, - "ObjSchema": { + "OtelExportReq": { "properties": { "project_id": { "type": "string", "title": "Project Id" }, - "object_id": { - "type": "string", - "title": "Object Id" - }, - "created_at": { - "type": "string", - "format": "date-time", - "title": "Created At" + "traces": { + "title": "Traces" }, - "deleted_at": { + "wb_run_id": { "anyOf": [ { - "type": "string", - "format": "date-time" + "type": "string" }, { "type": "null" } ], - "title": "Deleted At" - }, - "digest": { - "type": "string", - "title": "Digest" - }, - "version_index": { - "type": "integer", - "title": "Version Index" - }, - "is_latest": { - "type": "integer", - "title": "Is Latest" - }, - "kind": { - "type": "string", - "title": "Kind" + "title": "Wb Run Id" }, - "base_object_class": { + "wb_user_id": { "anyOf": [ { "type": "string" @@ -5595,85 +8745,138 @@ "type": "null" } ], - "title": "Base Object Class" - }, - "leaf_object_class": { + "title": "Wb User Id", + "description": "Do not set directly. Server will automatically populate this field." + } + }, + "type": "object", + "required": [ + "project_id", + "traces" + ], + "title": "OtelExportReq" + }, + "OtelExportRes": { + "properties": { + "partial_success": { "anyOf": [ { - "type": "string" + "$ref": "#/components/schemas/ExportTracePartialSuccess" }, { "type": "null" } ], - "title": "Leaf Object Class" + "description": "The details of a partially successful export request. When None or rejected_spans is 0, the request was fully accepted." + } + }, + "type": "object", + "title": "OtelExportRes" + }, + "PredictionCreateBody": { + "properties": { + "model": { + "type": "string", + "title": "Model", + "description": "The model reference (weave:// URI)" }, - "val": { - "title": "Val" + "inputs": { + "additionalProperties": true, + "type": "object", + "title": "Inputs", + "description": "The inputs to the prediction" }, - "wb_user_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Wb User Id", - "description": "Do not set directly. Server will automatically populate this field." + "output": { + "title": "Output", + "description": "The output of the prediction" }, - "size_bytes": { + "evaluation_run_id": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "title": "Size Bytes" + "title": "Evaluation Run Id", + "description": "Optional evaluation run ID to link this prediction as a child call" } }, "type": "object", "required": [ - "project_id", - "object_id", - "created_at", - "digest", - "version_index", - "is_latest", - "kind", - "base_object_class", - "val" + "model", + "inputs", + "output" ], - "title": "ObjSchema" + "title": "PredictionCreateBody", + "description": "Request body for creating a Prediction via REST API.\n\nThis model excludes project_id since it comes from the URL path in RESTful endpoints." }, - "ObjSchemaForInsert": { + "PredictionCreateRes": { "properties": { - "project_id": { + "prediction_id": { "type": "string", - "title": "Project Id" + "title": "Prediction Id", + "description": "The prediction ID" + } + }, + "type": "object", + "required": [ + "prediction_id" + ], + "title": "PredictionCreateRes" + }, + "PredictionDeleteRes": { + "properties": { + "num_deleted": { + "type": "integer", + "title": "Num Deleted", + "description": "Number of predictions deleted" + } + }, + "type": "object", + "required": [ + "num_deleted" + ], + "title": "PredictionDeleteRes" + }, + "PredictionFinishRes": { + "properties": { + "success": { + "type": "boolean", + "title": "Success", + "description": "Whether the prediction was finished successfully" + } + }, + "type": "object", + "required": [ + "success" + ], + "title": "PredictionFinishRes" + }, + "PredictionReadRes": { + "properties": { + "prediction_id": { + "type": "string", + "title": "Prediction Id", + "description": "The prediction ID" }, - "object_id": { + "model": { "type": "string", - "title": "Object Id" + "title": "Model", + "description": "The model reference (weave:// URI)" }, - "val": { - "title": "Val" + "inputs": { + "additionalProperties": true, + "type": "object", + "title": "Inputs", + "description": "The inputs to the prediction" }, - "builtin_object_class": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Builtin Object Class" + "output": { + "title": "Output", + "description": "The output of the prediction" }, - "set_base_object_class": { + "evaluation_run_id": { "anyOf": [ { "type": "string" @@ -5682,8 +8885,8 @@ "type": "null" } ], - "title": "Set Base Object Class", - "deprecated": true + "title": "Evaluation Run Id", + "description": "Evaluation run ID if this prediction is linked to one" }, "wb_user_id": { "anyOf": [ @@ -5700,427 +8903,334 @@ }, "type": "object", "required": [ - "project_id", - "object_id", - "val" + "prediction_id", + "model", + "inputs", + "output" ], - "title": "ObjSchemaForInsert" + "title": "PredictionReadRes" }, - "ObjectVersionFilter": { + "Query": { "properties": { - "base_object_classes": { + "$expr": { "anyOf": [ { - "items": { - "type": "string" - }, - "type": "array" + "$ref": "#/components/schemas/AndOperation" }, { - "type": "null" - } - ], - "title": "Base Object Classes", - "description": "Filter objects by their base classes", - "examples": [ - [ - "Model" - ], - [ - "Dataset" - ] - ] - }, - "exclude_base_object_classes": { - "anyOf": [ + "$ref": "#/components/schemas/OrOperation" + }, { - "items": { - "type": "string" - }, - "type": "array" + "$ref": "#/components/schemas/NotOperation" }, { - "type": "null" - } - ], - "title": "Exclude Base Object Classes", - "description": "Exclude objects by their base classes", - "examples": [ - [ - "Model" - ], - [ - "Dataset" - ] - ] - }, - "leaf_object_classes": { - "anyOf": [ + "$ref": "#/components/schemas/EqOperation" + }, { - "items": { - "type": "string" - }, - "type": "array" + "$ref": "#/components/schemas/GtOperation" }, { - "type": "null" + "$ref": "#/components/schemas/GteOperation" + }, + { + "$ref": "#/components/schemas/InOperation" + }, + { + "$ref": "#/components/schemas/ContainsOperation" } ], - "title": "Leaf Object Classes", - "description": "Filter objects by their leaf classes", - "examples": [ - [ - "Model" - ], - [ - "Dataset" - ], - [ - "LLMStructuredCompletionModel" - ] - ] + "title": "$Expr" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "$expr" + ], + "title": "Query" + }, + "RefsReadBatchReq": { + "properties": { + "refs": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Refs" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "refs" + ], + "title": "RefsReadBatchReq" + }, + "RefsReadBatchRes": { + "properties": { + "vals": { + "items": {}, + "type": "array", + "title": "Vals" + } + }, + "type": "object", + "required": [ + "vals" + ], + "title": "RefsReadBatchRes" + }, + "ScoreCreateBody": { + "properties": { + "prediction_id": { + "type": "string", + "title": "Prediction Id", + "description": "The prediction ID" }, - "object_ids": { + "scorer": { + "type": "string", + "title": "Scorer", + "description": "The scorer reference (weave:// URI)" + }, + "value": { + "type": "number", + "title": "Value", + "description": "The value of the score" + }, + "evaluation_run_id": { "anyOf": [ { - "items": { - "type": "string" - }, - "type": "array" + "type": "string" }, { "type": "null" } ], - "title": "Object Ids", - "description": "Filter objects by their IDs", - "examples": [ - "my_favorite_model", - "my_favorite_dataset" - ] + "title": "Evaluation Run Id", + "description": "Optional evaluation run ID to link this score as a child call" + } + }, + "type": "object", + "required": [ + "prediction_id", + "scorer", + "value" + ], + "title": "ScoreCreateBody", + "description": "Request body for creating a Score via REST API.\n\nThis model excludes project_id since it comes from the URL path in RESTful endpoints." + }, + "ScoreCreateRes": { + "properties": { + "score_id": { + "type": "string", + "title": "Score Id", + "description": "The score ID" + } + }, + "type": "object", + "required": [ + "score_id" + ], + "title": "ScoreCreateRes" + }, + "ScoreDeleteRes": { + "properties": { + "num_deleted": { + "type": "integer", + "title": "Num Deleted", + "description": "Number of scores deleted" + } + }, + "type": "object", + "required": [ + "num_deleted" + ], + "title": "ScoreDeleteRes" + }, + "ScoreReadRes": { + "properties": { + "score_id": { + "type": "string", + "title": "Score Id", + "description": "The score ID" }, - "is_op": { + "scorer": { + "type": "string", + "title": "Scorer", + "description": "The scorer reference (weave:// URI)" + }, + "value": { + "type": "number", + "title": "Value", + "description": "The value of the score" + }, + "evaluation_run_id": { "anyOf": [ { - "type": "boolean" + "type": "string" }, { "type": "null" } ], - "title": "Is Op", - "description": "Filter objects based on whether they are weave.ops or not. `True` will only return ops, `False` will return non-ops, and `None` will return all objects", - "examples": [ - true, - false, - null - ] + "title": "Evaluation Run Id", + "description": "Evaluation run ID if this score is linked to one" }, - "latest_only": { + "wb_user_id": { "anyOf": [ { - "type": "boolean" + "type": "string" }, { "type": "null" } ], - "title": "Latest Only", - "description": "If True, return only the latest version of each object. `False` and `None` will return all versions", - "examples": [ - true, - false - ] - } - }, - "additionalProperties": false, - "type": "object", - "title": "ObjectVersionFilter" - }, - "OrOperation": { - "properties": { - "$or": { - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/LiteralOperation" - }, - { - "$ref": "#/components/schemas/GetFieldOperator" - }, - { - "$ref": "#/components/schemas/ConvertOperation" - }, - { - "$ref": "#/components/schemas/AndOperation" - }, - { - "$ref": "#/components/schemas/OrOperation" - }, - { - "$ref": "#/components/schemas/NotOperation" - }, - { - "$ref": "#/components/schemas/EqOperation" - }, - { - "$ref": "#/components/schemas/GtOperation" - }, - { - "$ref": "#/components/schemas/GteOperation" - }, - { - "$ref": "#/components/schemas/InOperation" - }, - { - "$ref": "#/components/schemas/ContainsOperation" - } - ] - }, - "type": "array", - "title": "$Or" + "title": "Wb User Id", + "description": "Do not set directly. Server will automatically populate this field." } }, "type": "object", "required": [ - "$or" + "score_id", + "scorer", + "value" ], - "title": "OrOperation", - "description": "Logical OR. At least one condition must be true.\n\nExample:\n ```\n {\n \"$or\": [\n {\"$eq\": [{\"$getField\": \"op_name\"}, {\"$literal\": \"a\"}]},\n {\"$eq\": [{\"$getField\": \"op_name\"}, {\"$literal\": \"b\"}]}\n ]\n }\n ```" + "title": "ScoreReadRes" }, - "Pricing": { + "ScorerCreateBody": { "properties": { - "prompt": { - "type": "string", - "title": "Prompt" - }, - "completion": { - "type": "string", - "title": "Completion" - }, - "image": { - "type": "string", - "title": "Image" - }, - "request": { - "type": "string", - "title": "Request" - }, - "input_cache_reads": { + "name": { "type": "string", - "title": "Input Cache Reads" + "title": "Name", + "description": "The name of this scorer. Scorers with the same name will be versioned together." }, - "input_cache_writes": { - "type": "string", - "title": "Input Cache Writes" - } - }, - "type": "object", - "required": [ - "prompt", - "completion", - "image", - "request", - "input_cache_reads", - "input_cache_writes" - ], - "title": "Pricing", - "description": "All pricing values are in USD per 1 token.\n\nPricing fields are in string format to avoid floating point precision issues." - }, - "Query": { - "properties": { - "$expr": { + "description": { "anyOf": [ { - "$ref": "#/components/schemas/AndOperation" - }, - { - "$ref": "#/components/schemas/OrOperation" - }, - { - "$ref": "#/components/schemas/NotOperation" - }, - { - "$ref": "#/components/schemas/EqOperation" - }, - { - "$ref": "#/components/schemas/GtOperation" - }, - { - "$ref": "#/components/schemas/GteOperation" - }, - { - "$ref": "#/components/schemas/InOperation" + "type": "string" }, { - "$ref": "#/components/schemas/ContainsOperation" + "type": "null" } ], - "title": "$Expr" + "title": "Description", + "description": "A description of this scorer" + }, + "op_source_code": { + "type": "string", + "title": "Op Source Code", + "description": "Complete source code for the Scorer.score op including imports" } }, - "additionalProperties": false, "type": "object", "required": [ - "$expr" + "name", + "op_source_code" ], - "title": "Query" + "title": "ScorerCreateBody" }, - "RefsReadBatchReq": { + "ScorerCreateRes": { "properties": { - "refs": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Refs" + "digest": { + "type": "string", + "title": "Digest", + "description": "The digest of the created scorer" + }, + "object_id": { + "type": "string", + "title": "Object Id", + "description": "The ID of the created scorer" + }, + "version_index": { + "type": "integer", + "title": "Version Index", + "description": "The version index of the created scorer" + }, + "scorer": { + "type": "string", + "title": "Scorer", + "description": "Full reference to the created scorer" } }, - "additionalProperties": false, "type": "object", "required": [ - "refs" + "digest", + "object_id", + "version_index", + "scorer" ], - "title": "RefsReadBatchReq" + "title": "ScorerCreateRes" }, - "RefsReadBatchRes": { + "ScorerDeleteRes": { "properties": { - "vals": { - "items": {}, - "type": "array", - "title": "Vals" + "num_deleted": { + "type": "integer", + "title": "Num Deleted", + "description": "Number of scorer versions deleted" } }, "type": "object", "required": [ - "vals" + "num_deleted" ], - "title": "RefsReadBatchRes" + "title": "ScorerDeleteRes" }, - "RouterOpenRouterModel": { + "ScorerReadRes": { "properties": { - "id": { + "object_id": { "type": "string", - "title": "Id" + "title": "Object Id", + "description": "The scorer ID" }, - "name": { + "digest": { "type": "string", - "title": "Name" + "title": "Digest", + "description": "The digest of the scorer" }, - "created": { + "version_index": { "type": "integer", - "title": "Created" - }, - "input_modalities": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Input Modalities" - }, - "output_modalities": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Output Modalities" + "title": "Version Index", + "description": "The version index of the object" }, - "quantization": { + "created_at": { "type": "string", - "enum": [ - "int4", - "int8", - "fp4", - "fp6", - "fp8", - "fp16", - "bf16", - "fp32" - ], - "title": "Quantization" - }, - "context_length": { - "type": "integer", - "title": "Context Length" - }, - "max_output_length": { - "type": "integer", - "title": "Max Output Length" - }, - "pricing": { - "$ref": "#/components/schemas/Pricing" + "format": "date-time", + "title": "Created At", + "description": "When the scorer was created" }, - "supported_sampling_parameters": { - "items": { - "type": "string", - "enum": [ - "temperature", - "top_p", - "top_k", - "repetition_penalty", - "frequency_penalty", - "presence_penalty", - "stop", - "seed" - ] - }, - "type": "array", - "title": "Supported Sampling Parameters" + "name": { + "type": "string", + "title": "Name", + "description": "The name of the scorer" }, - "supported_features": { - "items": { - "type": "string", - "enum": [ - "tools", - "json_mode", - "structured_outputs", - "web_search", - "reasoning" - ] - }, - "type": "array", - "title": "Supported Features" + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Description", + "description": "Description of the scorer" }, - "datacenters": { - "items": { - "$ref": "#/components/schemas/Datacenter" - }, - "type": "array", - "title": "Datacenters" + "score_op": { + "type": "string", + "title": "Score Op", + "description": "The Scorer.score op reference" } }, "type": "object", "required": [ - "id", + "object_id", + "digest", + "version_index", + "created_at", "name", - "created", - "input_modalities", - "output_modalities", - "quantization", - "context_length", - "max_output_length", - "pricing", - "supported_sampling_parameters", - "supported_features", - "datacenters" - ], - "title": "RouterOpenRouterModel" - }, - "RouterOpenRouterModelsRes": { - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/RouterOpenRouterModel" - }, - "type": "array", - "title": "Data" - } - }, - "type": "object", - "required": [ - "data" + "score_op" ], - "title": "RouterOpenRouterModelsRes" + "title": "ScorerReadRes" }, "ServerInfoRes": { "properties": { @@ -6240,13 +9350,27 @@ "title": "Started At" }, "attributes": { + "additionalProperties": true, "type": "object", "title": "Attributes" }, "inputs": { + "additionalProperties": true, "type": "object", "title": "Inputs" }, + "otel_dump": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Otel Dump" + }, "wb_user_id": { "anyOf": [ { @@ -6305,6 +9429,9 @@ "additionalProperties": { "type": "integer" }, + "propertyNames": { + "$ref": "#/components/schemas/TraceStatus" + }, "type": "object", "title": "Status Counts" } @@ -6328,6 +9455,7 @@ "TableAppendSpecPayload": { "properties": { "row": { + "additionalProperties": true, "type": "object", "title": "Row" } @@ -6338,28 +9466,6 @@ ], "title": "TableAppendSpecPayload" }, - "TableCreateFromDigestsReq": { - "properties": { - "project_id": { - "type": "string", - "title": "Project Id" - }, - "row_digests": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Row Digests" - } - }, - "additionalProperties": false, - "type": "object", - "required": [ - "project_id", - "row_digests" - ], - "title": "TableCreateFromDigestsReq" - }, "TableCreateReq": { "properties": { "table": { @@ -6413,6 +9519,7 @@ "title": "Index" }, "row": { + "additionalProperties": true, "type": "object", "title": "Row" } @@ -6564,73 +9671,6 @@ ], "title": "TableQueryRes" }, - "TableQueryStatsBatchReq": { - "properties": { - "project_id": { - "type": "string", - "title": "Project Id", - "description": "The ID of the project", - "examples": [ - "my_entity/my_project" - ] - }, - "digests": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "title": "Digests", - "description": "The digests of the tables to query", - "default": [], - "examples": [ - "aonareimsvtl13apimtalpa4435rpmgnaemrpgmarltarstaorsnte134avrims", - "smirva431etnsroatsratlrampgrmeangmpr5344aplatmipa31ltvsmi\u0435\u0440\u0430noa" - ] - }, - "include_storage_size": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "title": "Include Storage Size", - "description": "If true, the `storage_size_bytes` column is returned.", - "default": false - } - }, - "additionalProperties": false, - "type": "object", - "required": [ - "project_id" - ], - "title": "TableQueryStatsBatchReq" - }, - "TableQueryStatsBatchRes": { - "properties": { - "tables": { - "items": { - "$ref": "#/components/schemas/TableStatsRow" - }, - "type": "array", - "title": "Tables" - } - }, - "type": "object", - "required": [ - "tables" - ], - "title": "TableQueryStatsBatchRes" - }, "TableQueryStatsReq": { "properties": { "project_id": { @@ -6732,6 +9772,7 @@ }, "rows": { "items": { + "additionalProperties": true, "type": "object" }, "type": "array", @@ -6745,35 +9786,6 @@ ], "title": "TableSchemaForInsert" }, - "TableStatsRow": { - "properties": { - "count": { - "type": "integer", - "title": "Count" - }, - "digest": { - "type": "string", - "title": "Digest" - }, - "storage_size_bytes": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "title": "Storage Size Bytes" - } - }, - "type": "object", - "required": [ - "count", - "digest" - ], - "title": "TableStatsRow" - }, "TableUpdateReq": { "properties": { "project_id": { @@ -7018,10 +10030,6 @@ "HTTPBasic": { "type": "http", "scheme": "basic" - }, - "HTTPBearer": { - "type": "http", - "scheme": "bearer" } } } diff --git a/weave/reference/typescript-sdk.mdx b/weave/reference/typescript-sdk.mdx index af9d7166bb..2413f7fa71 100644 --- a/weave/reference/typescript-sdk.mdx +++ b/weave/reference/typescript-sdk.mdx @@ -11,38 +11,39 @@ weave ### Classes -- [Dataset](./typescript-sdk/classes/Dataset) -- [Evaluation](./typescript-sdk/classes/Evaluation) -- [EvaluationLogger](./typescript-sdk/classes/EvaluationLogger) -- [MessagesPrompt](./typescript-sdk/classes/MessagesPrompt) -- [ScoreLogger](./typescript-sdk/classes/ScoreLogger) -- [StringPrompt](./typescript-sdk/classes/StringPrompt) -- [WeaveClient](./typescript-sdk/classes/WeaveClient) -- [WeaveObject](./typescript-sdk/classes/WeaveObject) +- [Dataset](./typescript-sdk/classes/dataset) +- [Evaluation](./typescript-sdk/classes/evaluation) +- [EvaluationLogger](./typescript-sdk/classes/evaluationlogger) +- [MessagesPrompt](./typescript-sdk/classes/messagesprompt) +- [ObjectRef](./typescript-sdk/classes/objectref) +- [ScoreLogger](./typescript-sdk/classes/scorelogger) +- [StringPrompt](./typescript-sdk/classes/stringprompt) +- [WeaveClient](./typescript-sdk/classes/weaveclient) +- [WeaveObject](./typescript-sdk/classes/weaveobject) ### Interfaces -- [CallSchema](./typescript-sdk/interfaces/CallSchema) -- [CallsFilter](./typescript-sdk/interfaces/CallsFilter) -- [WeaveAudio](./typescript-sdk/interfaces/WeaveAudio) -- [WeaveImage](./typescript-sdk/interfaces/WeaveImage) +- [CallSchema](./typescript-sdk/interfaces/callschema) +- [CallsFilter](./typescript-sdk/interfaces/callsfilter) +- [WeaveAudio](./typescript-sdk/interfaces/weaveaudio) +- [WeaveImage](./typescript-sdk/interfaces/weaveimage) ### Type Aliases -- [OpDecorator](./typescript-sdk/type-aliases/OpDecorator) -- [Op](./typescript-sdk/type-aliases/Op) +- [OpDecorator](./typescript-sdk/type-aliases/opdecorator) +- [Op](./typescript-sdk/type-aliases/op) ### Functions - [init](./typescript-sdk/functions/init) - [login](./typescript-sdk/functions/login) - [op](./typescript-sdk/functions/op) -- [requireCurrentCallStackEntry](./typescript-sdk/functions/requireCurrentCallStackEntry) -- [requireCurrentChildSummary](./typescript-sdk/functions/requireCurrentChildSummary) -- [weaveAudio](./typescript-sdk/functions/weaveAudio) -- [weaveImage](./typescript-sdk/functions/weaveImage) -- [wrapOpenAI](./typescript-sdk/functions/wrapOpenAI) +- [requirecurrentcallstackentry](./typescript-sdk/functions/requirecurrentcallstackentry) +- [requirecurrentchildsummary](./typescript-sdk/functions/requirecurrentchildsummary) +- [weaveaudio](./typescript-sdk/functions/weaveaudio) +- [weaveimage](./typescript-sdk/functions/weaveimage) +- [wrapopenai](./typescript-sdk/functions/wrapopenai) ## Type Aliases diff --git a/weave/reference/typescript-sdk/classes/EvaluationLogger.mdx b/weave/reference/typescript-sdk/classes/EvaluationLogger.mdx deleted file mode 100644 index 5242b4adad..0000000000 --- a/weave/reference/typescript-sdk/classes/EvaluationLogger.mdx +++ /dev/null @@ -1,110 +0,0 @@ ---- -title: "Class: EvaluationLogger" -description: "TypeScript SDK reference" ---- - -[weave](../) / EvaluationLogger - - - -EvaluationLogger enables incremental logging of predictions and scores. - -Unlike the traditional Evaluation class which requires upfront dataset and batch processing, -EvaluationLogger allows you to log predictions as they happen, with flexible scoring. - -`Example` - -```ts -const ev = new EvaluationLogger({name: 'my-eval', dataset: 'my-dataset'}); - -for (const example of streamingData) { - const output = await myModel.predict(example); - const pred = await ev.logPrediction(example, output); - - if (shouldScore(output)) { - await pred.logScore("accuracy", calculateAccuracy(output)); - } - await pred.finish(); -} - -await ev.logSummary(); -``` - -## Table of contents - -### Constructors - -- [constructor](./EvaluationLogger#constructor) - -### Methods - -- [logPrediction](./EvaluationLogger#logprediction) -- [logSummary](./EvaluationLogger#logsummary) - -## Constructors - -### constructor - -• **new EvaluationLogger**(`options`): [`EvaluationLogger`](./EvaluationLogger) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `options` | `EvaluationLoggerOptions` | - -#### Returns - -[`EvaluationLogger`](./EvaluationLogger) - -#### Defined in - -[evaluationLogger.ts:502](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/evaluationLogger.ts#L502) - -## Methods - -### logPrediction - -▸ **logPrediction**(`inputs`, `output`): `Promise`\<[`ScoreLogger`](./ScoreLogger)\> - -Log a prediction with its input and output. -Creates a predict_and_score call (with child predict call). -Returns a ScoreLogger for adding scores. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `inputs` | `Record`\<`string`, `any`\> | -| `output` | `any` | - -#### Returns - -`Promise`\<[`ScoreLogger`](./ScoreLogger)\> - -#### Defined in - -[evaluationLogger.ts:579](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/evaluationLogger.ts#L579) - -___ - -### logSummary - -▸ **logSummary**(`summary?`): `Promise`\<`void`\> - -Log a summary and finalize the evaluation. -Creates a summarize call and finishes the evaluate call. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `summary?` | `Record`\<`string`, `any`\> | - -#### Returns - -`Promise`\<`void`\> - -#### Defined in - -[evaluationLogger.ts:669](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/evaluationLogger.ts#L669) \ No newline at end of file diff --git a/weave/reference/typescript-sdk/classes/MessagesPrompt.mdx b/weave/reference/typescript-sdk/classes/MessagesPrompt.mdx deleted file mode 100644 index d6f23f76f3..0000000000 --- a/weave/reference/typescript-sdk/classes/MessagesPrompt.mdx +++ /dev/null @@ -1,157 +0,0 @@ ---- -title: "Class: MessagesPrompt" -description: "TypeScript SDK reference" ---- - -[weave](../) / MessagesPrompt - - - -## Hierarchy - -- `Prompt` - - ↳ `MessagesPrompt` - -## Table of contents - -### Constructors - -- [constructor](./MessagesPrompt#constructor) - -### Properties - -- [\_\_savedRef](./MessagesPrompt#__savedref) -- [messages](./MessagesPrompt#messages) - -### Accessors - -- [description](./MessagesPrompt#description) -- [name](./MessagesPrompt#name) - -### Methods - -- [format](./MessagesPrompt#format) -- [saveAttrs](./MessagesPrompt#saveattrs) - -## Constructors - -### constructor - -• **new MessagesPrompt**(`parameters`): [`MessagesPrompt`](./MessagesPrompt) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `parameters` | `MessagesPromptParameters` | - -#### Returns - -[`MessagesPrompt`](./MessagesPrompt) - -#### Overrides - -Prompt.constructor - -#### Defined in - -[prompt.ts:33](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/prompt.ts#L33) - -## Properties - -### \_\_savedRef - -• `Optional` **\_\_savedRef**: `ObjectRef` \| `Promise`\<`ObjectRef`\> - -#### Inherited from - -Prompt.\_\_savedRef - -#### Defined in - -[weaveObject.ts:49](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/weaveObject.ts#L49) - -___ - -### messages - -• **messages**: `Record`\<`string`, `any`\>[] - -#### Defined in - -[prompt.ts:31](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/prompt.ts#L31) - -## Accessors - -### description - -• `get` **description**(): `undefined` \| `string` - -#### Returns - -`undefined` \| `string` - -#### Inherited from - -Prompt.description - -#### Defined in - -[weaveObject.ts:76](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/weaveObject.ts#L76) - -___ - -### name - -• `get` **name**(): `string` - -#### Returns - -`string` - -#### Inherited from - -Prompt.name - -#### Defined in - -[weaveObject.ts:72](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/weaveObject.ts#L72) - -## Methods - -### format - -▸ **format**(`values?`): `Record`\<`string`, `any`\>[] - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `values` | `Record`\<`string`, `any`\> | - -#### Returns - -`Record`\<`string`, `any`\>[] - -#### Defined in - -[prompt.ts:60](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/prompt.ts#L60) - -___ - -### saveAttrs - -▸ **saveAttrs**(): `Object` - -#### Returns - -`Object` - -#### Inherited from - -Prompt.saveAttrs - -#### Defined in - -[weaveObject.ts:53](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/weaveObject.ts#L53) \ No newline at end of file diff --git a/weave/reference/typescript-sdk/classes/StringPrompt.mdx b/weave/reference/typescript-sdk/classes/StringPrompt.mdx deleted file mode 100644 index 748b6d4fe8..0000000000 --- a/weave/reference/typescript-sdk/classes/StringPrompt.mdx +++ /dev/null @@ -1,157 +0,0 @@ ---- -title: "Class: StringPrompt" -description: "TypeScript SDK reference" ---- - -[weave](../) / StringPrompt - - - -## Hierarchy - -- `Prompt` - - ↳ `StringPrompt` - -## Table of contents - -### Constructors - -- [constructor](./StringPrompt#constructor) - -### Properties - -- [\_\_savedRef](./StringPrompt#__savedref) -- [content](./StringPrompt#content) - -### Accessors - -- [description](./StringPrompt#description) -- [name](./StringPrompt#name) - -### Methods - -- [format](./StringPrompt#format) -- [saveAttrs](./StringPrompt#saveattrs) - -## Constructors - -### constructor - -• **new StringPrompt**(`parameters`): [`StringPrompt`](./StringPrompt) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `parameters` | `StringPromptParameters` | - -#### Returns - -[`StringPrompt`](./StringPrompt) - -#### Overrides - -Prompt.constructor - -#### Defined in - -[prompt.ts:16](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/prompt.ts#L16) - -## Properties - -### \_\_savedRef - -• `Optional` **\_\_savedRef**: `ObjectRef` \| `Promise`\<`ObjectRef`\> - -#### Inherited from - -Prompt.\_\_savedRef - -#### Defined in - -[weaveObject.ts:49](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/weaveObject.ts#L49) - -___ - -### content - -• **content**: `string` - -#### Defined in - -[prompt.ts:14](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/prompt.ts#L14) - -## Accessors - -### description - -• `get` **description**(): `undefined` \| `string` - -#### Returns - -`undefined` \| `string` - -#### Inherited from - -Prompt.description - -#### Defined in - -[weaveObject.ts:76](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/weaveObject.ts#L76) - -___ - -### name - -• `get` **name**(): `string` - -#### Returns - -`string` - -#### Inherited from - -Prompt.name - -#### Defined in - -[weaveObject.ts:72](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/weaveObject.ts#L72) - -## Methods - -### format - -▸ **format**(`values?`): `string` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `values` | `Record`\<`string`, `any`\> | - -#### Returns - -`string` - -#### Defined in - -[prompt.ts:21](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/prompt.ts#L21) - -___ - -### saveAttrs - -▸ **saveAttrs**(): `Object` - -#### Returns - -`Object` - -#### Inherited from - -Prompt.saveAttrs - -#### Defined in - -[weaveObject.ts:53](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/weaveObject.ts#L53) \ No newline at end of file diff --git a/weave/reference/typescript-sdk/classes/WeaveObject.mdx b/weave/reference/typescript-sdk/classes/WeaveObject.mdx deleted file mode 100644 index 25c084e292..0000000000 --- a/weave/reference/typescript-sdk/classes/WeaveObject.mdx +++ /dev/null @@ -1,107 +0,0 @@ ---- -title: "Class: WeaveObject" -description: "TypeScript SDK reference" ---- - -[weave](../) / WeaveObject - - - -## Hierarchy - -- `WeaveObject` - - ↳ [`Dataset`](./Dataset) - - ↳ [`Evaluation`](./Evaluation) - -## Table of contents - -### Constructors - -- [constructor](./WeaveObject#constructor) - -### Properties - -- [\_\_savedRef](./WeaveObject#__savedref) - -### Accessors - -- [description](./WeaveObject#description) -- [name](./WeaveObject#name) - -### Methods - -- [saveAttrs](./WeaveObject#saveattrs) - -## Constructors - -### constructor - -• **new WeaveObject**(`_baseParameters`): [`WeaveObject`](./WeaveObject) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `_baseParameters` | `WeaveObjectParameters` | - -#### Returns - -[`WeaveObject`](./WeaveObject) - -#### Defined in - -[weaveObject.ts:51](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/weaveObject.ts#L51) - -## Properties - -### \_\_savedRef - -• `Optional` **\_\_savedRef**: `ObjectRef` \| `Promise`\<`ObjectRef`\> - -#### Defined in - -[weaveObject.ts:49](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/weaveObject.ts#L49) - -## Accessors - -### description - -• `get` **description**(): `undefined` \| `string` - -#### Returns - -`undefined` \| `string` - -#### Defined in - -[weaveObject.ts:76](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/weaveObject.ts#L76) - -___ - -### name - -• `get` **name**(): `string` - -#### Returns - -`string` - -#### Defined in - -[weaveObject.ts:72](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/weaveObject.ts#L72) - -## Methods - -### saveAttrs - -▸ **saveAttrs**(): `Object` - -#### Returns - -`Object` - -#### Defined in - -[weaveObject.ts:53](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/weaveObject.ts#L53) \ No newline at end of file diff --git a/weave/reference/typescript-sdk/classes/Dataset.mdx b/weave/reference/typescript-sdk/classes/dataset.mdx similarity index 51% rename from weave/reference/typescript-sdk/classes/Dataset.mdx rename to weave/reference/typescript-sdk/classes/dataset.mdx index 7cf8c9d04a..b754b0487c 100644 --- a/weave/reference/typescript-sdk/classes/Dataset.mdx +++ b/weave/reference/typescript-sdk/classes/dataset.mdx @@ -14,7 +14,7 @@ Dataset object with easy saving and automatic versioning ```ts // Create a dataset const dataset = new Dataset({ - name: 'grammar-dataset', + id: 'grammar-dataset', rows: [ { id: '0', sentence: "He no likes ice cream.", correction: "He doesn't like ice cream." }, { id: '1', sentence: "She goed to the store.", correction: "She went to the store." }, @@ -37,7 +37,7 @@ const ref = await dataset.save() ## Hierarchy -- [`WeaveObject`](./WeaveObject) +- [`WeaveObject`](./weaveobject) ↳ `Dataset` @@ -45,31 +45,31 @@ const ref = await dataset.save() ### Constructors -- [constructor](./Dataset#constructor) +- [constructor](./dataset#constructor) ### Properties -- [\_\_savedRef](./Dataset#__savedref) -- [rows](./Dataset#rows) +- [\_\_savedRef](./dataset#__savedref) +- [rows](./dataset#rows) ### Accessors -- [description](./Dataset#description) -- [length](./Dataset#length) -- [name](./Dataset#name) +- [description](./dataset#description) +- [length](./dataset#length) +- [name](./dataset#name) ### Methods -- [[asyncIterator]](./Dataset#[asynciterator]) -- [getRow](./Dataset#getrow) -- [save](./Dataset#save) -- [saveAttrs](./Dataset#saveattrs) +- [[asyncIterator]](./dataset#[asynciterator]) +- [getRow](./dataset#getrow) +- [save](./dataset#save) +- [saveAttrs](./dataset#saveattrs) ## Constructors ### constructor -• **new Dataset**\<`R`\>(`parameters`): [`Dataset`](./Dataset)\<`R`\> +• **new Dataset**\<`R`\>(`parameters`): [`Dataset`](./dataset)\<`R`\> #### Type parameters @@ -85,29 +85,29 @@ const ref = await dataset.save() #### Returns -[`Dataset`](./Dataset)\<`R`\> +[`Dataset`](./dataset)\<`R`\> #### Overrides -[WeaveObject](./WeaveObject).[constructor](./WeaveObject#constructor) +[WeaveObject](./weaveobject).[constructor](./weaveobject#constructor) #### Defined in -[dataset.ts:51](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/dataset.ts#L51) +[dataset.ts:51](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/dataset.ts#L51) ## Properties ### \_\_savedRef -• `Optional` **\_\_savedRef**: `ObjectRef` \| `Promise`\<`ObjectRef`\> +• `Optional` **\_\_savedRef**: [`ObjectRef`](./objectref) \| `Promise`\<[`ObjectRef`](./objectref)\> #### Inherited from -[WeaveObject](./WeaveObject).[__savedRef](./WeaveObject#__savedref) +[WeaveObject](./weaveobject).[__savedRef](./weaveobject#__savedref) #### Defined in -[weaveObject.ts:49](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/weaveObject.ts#L49) +[weaveObject.ts:49](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/weaveObject.ts#L49) ___ @@ -117,7 +117,7 @@ ___ #### Defined in -[dataset.ts:49](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/dataset.ts#L49) +[dataset.ts:49](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/dataset.ts#L49) ## Accessors @@ -135,7 +135,7 @@ WeaveObject.description #### Defined in -[weaveObject.ts:76](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/weaveObject.ts#L76) +[weaveObject.ts:76](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/weaveObject.ts#L76) ___ @@ -149,7 +149,7 @@ ___ #### Defined in -[dataset.ts:64](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/dataset.ts#L64) +[dataset.ts:64](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/dataset.ts#L64) ___ @@ -167,7 +167,7 @@ WeaveObject.name #### Defined in -[weaveObject.ts:72](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/weaveObject.ts#L72) +[weaveObject.ts:72](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/weaveObject.ts#L72) ## Methods @@ -181,7 +181,7 @@ WeaveObject.name #### Defined in -[dataset.ts:68](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/dataset.ts#L68) +[dataset.ts:68](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/dataset.ts#L68) ___ @@ -201,21 +201,21 @@ ___ #### Defined in -[dataset.ts:74](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/dataset.ts#L74) +[dataset.ts:74](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/dataset.ts#L74) ___ ### save -▸ **save**(): `Promise`\<`ObjectRef`\> +▸ **save**(): `Promise`\<[`ObjectRef`](./objectref)\> #### Returns -`Promise`\<`ObjectRef`\> +`Promise`\<[`ObjectRef`](./objectref)\> #### Defined in -[dataset.ts:60](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/dataset.ts#L60) +[dataset.ts:60](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/dataset.ts#L60) ___ @@ -229,8 +229,8 @@ ___ #### Inherited from -[WeaveObject](./WeaveObject).[saveAttrs](./WeaveObject#saveattrs) +[WeaveObject](./weaveobject).[saveAttrs](./weaveobject#saveattrs) #### Defined in -[weaveObject.ts:53](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/weaveObject.ts#L53) \ No newline at end of file +[weaveObject.ts:53](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/weaveObject.ts#L53) \ No newline at end of file diff --git a/weave/reference/typescript-sdk/classes/Evaluation.mdx b/weave/reference/typescript-sdk/classes/evaluation.mdx similarity index 70% rename from weave/reference/typescript-sdk/classes/Evaluation.mdx rename to weave/reference/typescript-sdk/classes/evaluation.mdx index a61b755c71..f8ebfdfd98 100644 --- a/weave/reference/typescript-sdk/classes/Evaluation.mdx +++ b/weave/reference/typescript-sdk/classes/evaluation.mdx @@ -57,7 +57,7 @@ const results = await evaluation.evaluate({ model }); ## Hierarchy -- [`WeaveObject`](./WeaveObject) +- [`WeaveObject`](./weaveobject) ↳ `Evaluation` @@ -65,28 +65,28 @@ const results = await evaluation.evaluate({ model }); ### Constructors -- [constructor](./Evaluation#constructor) +- [constructor](./evaluation#constructor) ### Properties -- [\_\_savedRef](./Evaluation#__savedref) +- [\_\_savedRef](./evaluation#__savedref) ### Accessors -- [description](./Evaluation#description) -- [name](./Evaluation#name) +- [description](./evaluation#description) +- [name](./evaluation#name) ### Methods -- [evaluate](./Evaluation#evaluate) -- [predictAndScore](./Evaluation#predictandscore) -- [saveAttrs](./Evaluation#saveattrs) +- [evaluate](./evaluation#evaluate) +- [predictAndScore](./evaluation#predictandscore) +- [saveAttrs](./evaluation#saveattrs) ## Constructors ### constructor -• **new Evaluation**\<`R`, `E`, `M`\>(`parameters`): [`Evaluation`](./Evaluation)\<`R`, `E`, `M`\> +• **new Evaluation**\<`R`, `E`, `M`\>(`parameters`): [`Evaluation`](./evaluation)\<`R`, `E`, `M`\> #### Type parameters @@ -104,29 +104,29 @@ const results = await evaluation.evaluate({ model }); #### Returns -[`Evaluation`](./Evaluation)\<`R`, `E`, `M`\> +[`Evaluation`](./evaluation)\<`R`, `E`, `M`\> #### Overrides -[WeaveObject](./WeaveObject).[constructor](./WeaveObject#constructor) +[WeaveObject](./weaveobject).[constructor](./weaveobject#constructor) #### Defined in -[evaluation.ts:148](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/evaluation.ts#L148) +[evaluation.ts:148](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/evaluation.ts#L148) ## Properties ### \_\_savedRef -• `Optional` **\_\_savedRef**: `ObjectRef` \| `Promise`\<`ObjectRef`\> +• `Optional` **\_\_savedRef**: [`ObjectRef`](./objectref) \| `Promise`\<[`ObjectRef`](./objectref)\> #### Inherited from -[WeaveObject](./WeaveObject).[__savedRef](./WeaveObject#__savedref) +[WeaveObject](./weaveobject).[__savedRef](./weaveobject#__savedref) #### Defined in -[weaveObject.ts:49](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/weaveObject.ts#L49) +[weaveObject.ts:49](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/weaveObject.ts#L49) ## Accessors @@ -144,7 +144,7 @@ WeaveObject.description #### Defined in -[weaveObject.ts:76](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/weaveObject.ts#L76) +[weaveObject.ts:76](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/weaveObject.ts#L76) ___ @@ -162,7 +162,7 @@ WeaveObject.name #### Defined in -[weaveObject.ts:72](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/weaveObject.ts#L72) +[weaveObject.ts:72](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/weaveObject.ts#L72) ## Methods @@ -185,7 +185,7 @@ WeaveObject.name #### Defined in -[evaluation.ts:163](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/evaluation.ts#L163) +[evaluation.ts:163](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/evaluation.ts#L163) ___ @@ -208,7 +208,7 @@ ___ #### Defined in -[evaluation.ts:231](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/evaluation.ts#L231) +[evaluation.ts:231](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/evaluation.ts#L231) ___ @@ -222,8 +222,8 @@ ___ #### Inherited from -[WeaveObject](./WeaveObject).[saveAttrs](./WeaveObject#saveattrs) +[WeaveObject](./weaveobject).[saveAttrs](./weaveobject#saveattrs) #### Defined in -[weaveObject.ts:53](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/weaveObject.ts#L53) \ No newline at end of file +[weaveObject.ts:53](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/weaveObject.ts#L53) \ No newline at end of file diff --git a/weave/reference/typescript-sdk/classes/evaluationlogger.mdx b/weave/reference/typescript-sdk/classes/evaluationlogger.mdx new file mode 100644 index 0000000000..2a2b94e30e --- /dev/null +++ b/weave/reference/typescript-sdk/classes/evaluationlogger.mdx @@ -0,0 +1,163 @@ +--- +title: "Class: EvaluationLogger" +description: "TypeScript SDK reference" +--- + +[weave](../) / EvaluationLogger + + + +EvaluationLogger enables incremental logging of predictions and scores. + +Unlike the traditional Evaluation class which requires upfront dataset and batch processing, +EvaluationLogger allows you to log predictions as they happen, with flexible scoring. + +`Example` + +```ts +const ev = new EvaluationLogger({name: 'my-eval', dataset: 'my-dataset'}); + +for (const example of streamingData) { + const output = await myModel.predict(example); + const pred = ev.logPrediction(example, output); + + if (shouldScore(output)) { + pred.logScore("accuracy", calculateAccuracy(output)); + } + pred.finish(); +} + +await ev.logSummary(); +``` + +## Table of contents + +### Constructors + +- [constructor](./evaluationlogger#constructor) + +### Methods + +- [logPrediction](./evaluationlogger#logprediction) +- [logPredictionAsync](./evaluationlogger#logpredictionasync) +- [logSummary](./evaluationlogger#logsummary) + +## Constructors + +### constructor + +• **new EvaluationLogger**(`options`): [`EvaluationLogger`](./evaluationlogger) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `options` | `EvaluationLoggerOptions` | + +#### Returns + +[`EvaluationLogger`](./evaluationlogger) + +#### Defined in + +[evaluationLogger.ts:554](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/evaluationLogger.ts#L554) + +## Methods + +### logPrediction + +▸ **logPrediction**(`inputs`, `output`): [`ScoreLogger`](./scorelogger) + +Log a prediction with its input and output (synchronous version). +Creates a predict_and_score call (with child predict call). +Returns a ScoreLogger immediately for adding scores. + +This method returns the ScoreLogger synchronously. Operations on the +ScoreLogger (logScore, finish) will be queued and executed when initialization completes. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `inputs` | `Record`\<`string`, `any`\> | +| `output` | `any` | + +#### Returns + +[`ScoreLogger`](./scorelogger) + +`Example` + +```ts +// Fire-and-forget style +const scoreLogger = evalLogger.logPrediction({input: 'test'}, 'output'); +scoreLogger.logScore('accuracy', 0.95); +scoreLogger.finish(); +await evalLogger.logSummary(); // Waits for everything +``` + +#### Defined in + +[evaluationLogger.ts:641](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/evaluationLogger.ts#L641) + +___ + +### logPredictionAsync + +▸ **logPredictionAsync**(`inputs`, `output`): `Promise`\<[`ScoreLogger`](./scorelogger)\> + +Log a prediction with its input and output (async version). +Like logPrediction() but returns a Promise that resolves when +the prediction call is fully initialized. + +Use this if you need to await the initialization before proceeding. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `inputs` | `Record`\<`string`, `any`\> | +| `output` | `any` | + +#### Returns + +`Promise`\<[`ScoreLogger`](./scorelogger)\> + +`Example` + +```ts +// Awaitable style +const scoreLogger = await evalLogger.logPredictionAsync({input: 'test'}, 'output'); +await scoreLogger.logScore('accuracy', 0.95); +await scoreLogger.finish(); +``` + +#### Defined in + +[evaluationLogger.ts:666](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/evaluationLogger.ts#L666) + +___ + +### logSummary + +▸ **logSummary**(`summary?`): `Promise`\<`void`\> + +Log a summary and finalize the evaluation. +Creates a summarize call and finishes the evaluate call. + +This method can be called without await (fire-and-forget), but internally +it will wait for all pending operations to complete. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `summary?` | `Record`\<`string`, `any`\> | + +#### Returns + +`Promise`\<`void`\> + +#### Defined in + +[evaluationLogger.ts:767](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/evaluationLogger.ts#L767) \ No newline at end of file diff --git a/weave/reference/typescript-sdk/classes/messagesprompt.mdx b/weave/reference/typescript-sdk/classes/messagesprompt.mdx new file mode 100644 index 0000000000..f0caa627f7 --- /dev/null +++ b/weave/reference/typescript-sdk/classes/messagesprompt.mdx @@ -0,0 +1,157 @@ +--- +title: "Class: MessagesPrompt" +description: "TypeScript SDK reference" +--- + +[weave](../) / MessagesPrompt + + + +## Hierarchy + +- `Prompt` + + ↳ `MessagesPrompt` + +## Table of contents + +### Constructors + +- [constructor](./messagesprompt#constructor) + +### Properties + +- [\_\_savedRef](./messagesprompt#__savedref) +- [messages](./messagesprompt#messages) + +### Accessors + +- [description](./messagesprompt#description) +- [name](./messagesprompt#name) + +### Methods + +- [format](./messagesprompt#format) +- [saveAttrs](./messagesprompt#saveattrs) + +## Constructors + +### constructor + +• **new MessagesPrompt**(`parameters`): [`MessagesPrompt`](./messagesprompt) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `parameters` | `MessagesPromptParameters` | + +#### Returns + +[`MessagesPrompt`](./messagesprompt) + +#### Overrides + +Prompt.constructor + +#### Defined in + +[prompt.ts:33](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/prompt.ts#L33) + +## Properties + +### \_\_savedRef + +• `Optional` **\_\_savedRef**: [`ObjectRef`](./objectref) \| `Promise`\<[`ObjectRef`](./objectref)\> + +#### Inherited from + +Prompt.\_\_savedRef + +#### Defined in + +[weaveObject.ts:49](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/weaveObject.ts#L49) + +___ + +### messages + +• **messages**: `Record`\<`string`, `any`\>[] + +#### Defined in + +[prompt.ts:31](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/prompt.ts#L31) + +## Accessors + +### description + +• `get` **description**(): `undefined` \| `string` + +#### Returns + +`undefined` \| `string` + +#### Inherited from + +Prompt.description + +#### Defined in + +[weaveObject.ts:76](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/weaveObject.ts#L76) + +___ + +### name + +• `get` **name**(): `string` + +#### Returns + +`string` + +#### Inherited from + +Prompt.name + +#### Defined in + +[weaveObject.ts:72](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/weaveObject.ts#L72) + +## Methods + +### format + +▸ **format**(`values?`): `Record`\<`string`, `any`\>[] + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `values` | `Record`\<`string`, `any`\> | + +#### Returns + +`Record`\<`string`, `any`\>[] + +#### Defined in + +[prompt.ts:60](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/prompt.ts#L60) + +___ + +### saveAttrs + +▸ **saveAttrs**(): `Object` + +#### Returns + +`Object` + +#### Inherited from + +Prompt.saveAttrs + +#### Defined in + +[weaveObject.ts:53](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/weaveObject.ts#L53) \ No newline at end of file diff --git a/weave/reference/typescript-sdk/classes/objectref.mdx b/weave/reference/typescript-sdk/classes/objectref.mdx new file mode 100644 index 0000000000..f6d1d03a99 --- /dev/null +++ b/weave/reference/typescript-sdk/classes/objectref.mdx @@ -0,0 +1,134 @@ +--- +title: "Class: ObjectRef" +description: "TypeScript SDK reference" +--- + +[weave](../) / ObjectRef + + + +Represents a reference to a saved Weave object. + +Generally, end users will not need to interact with this class directly. + +An ObjectRef contains the project ID, object ID, and digest that uniquely identify +a saved object in Weave's storage system. + +`Example` + +```ts +const ref = new ObjectRef('my-project', 'abc123', 'def456'); +const uri = ref.uri(); // weave:///my-project/object/abc123:def456 +``` + +## Table of contents + +### Constructors + +- [constructor](./objectref#constructor) + +### Properties + +- [digest](./objectref#digest) +- [objectId](./objectref#objectid) +- [projectId](./objectref#projectid) + +### Methods + +- [get](./objectref#get) +- [ui\_url](./objectref#ui_url) +- [uri](./objectref#uri) + +## Constructors + +### constructor + +• **new ObjectRef**(`projectId`, `objectId`, `digest`): [`ObjectRef`](./objectref) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `projectId` | `string` | +| `objectId` | `string` | +| `digest` | `string` | + +#### Returns + +[`ObjectRef`](./objectref) + +#### Defined in + +[weaveObject.ts:25](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/weaveObject.ts#L25) + +## Properties + +### digest + +• **digest**: `string` + +#### Defined in + +[weaveObject.ts:28](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/weaveObject.ts#L28) + +___ + +### objectId + +• **objectId**: `string` + +#### Defined in + +[weaveObject.ts:27](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/weaveObject.ts#L27) + +___ + +### projectId + +• **projectId**: `string` + +#### Defined in + +[weaveObject.ts:26](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/weaveObject.ts#L26) + +## Methods + +### get + +▸ **get**(): `Promise`\<`any`\> + +#### Returns + +`Promise`\<`any`\> + +#### Defined in + +[weaveObject.ts:42](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/weaveObject.ts#L42) + +___ + +### ui\_url + +▸ **ui_url**(): `string` + +#### Returns + +`string` + +#### Defined in + +[weaveObject.ts:37](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/weaveObject.ts#L37) + +___ + +### uri + +▸ **uri**(): `string` + +#### Returns + +`string` + +#### Defined in + +[weaveObject.ts:33](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/weaveObject.ts#L33) \ No newline at end of file diff --git a/weave/reference/typescript-sdk/classes/ScoreLogger.mdx b/weave/reference/typescript-sdk/classes/scorelogger.mdx similarity index 53% rename from weave/reference/typescript-sdk/classes/ScoreLogger.mdx rename to weave/reference/typescript-sdk/classes/scorelogger.mdx index 4e99b4d0e1..2acd31fe6f 100644 --- a/weave/reference/typescript-sdk/classes/ScoreLogger.mdx +++ b/weave/reference/typescript-sdk/classes/scorelogger.mdx @@ -23,33 +23,53 @@ await pred.finish(); // Finalizes the prediction ### Constructors -- [constructor](./ScoreLogger#constructor) +- [constructor](./scorelogger#constructor) + +### Accessors + +- [isFinishCalled](./scorelogger#isfinishcalled) ### Methods -- [finish](./ScoreLogger#finish) -- [logScore](./ScoreLogger#logscore) +- [finish](./scorelogger#finish) +- [logScore](./scorelogger#logscore) ## Constructors ### constructor -• **new ScoreLogger**(`predMeta`, `evalLogger`): [`ScoreLogger`](./ScoreLogger) +• **new ScoreLogger**(`evalLogger`): [`ScoreLogger`](./scorelogger) #### Parameters | Name | Type | | :------ | :------ | -| `predMeta` | `PredictAndScoreCallMetadata` | -| `evalLogger` | [`EvaluationLogger`](./EvaluationLogger) | +| `evalLogger` | [`EvaluationLogger`](./evaluationlogger) | + +#### Returns + +[`ScoreLogger`](./scorelogger) + +#### Defined in + +[evaluationLogger.ts:319](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/evaluationLogger.ts#L319) + +## Accessors + +### isFinishCalled + +• `get` **isFinishCalled**(): `boolean` + +Check if finish() has been called. +Used by EvaluationLogger to detect unfinished predictions. #### Returns -[`ScoreLogger`](./ScoreLogger) +`boolean` #### Defined in -[evaluationLogger.ts:317](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/evaluationLogger.ts#L317) +[evaluationLogger.ts:349](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/evaluationLogger.ts#L349) ## Methods @@ -67,7 +87,7 @@ Updates incremental aggregates and frees memory. #### Defined in -[evaluationLogger.ts:410](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/evaluationLogger.ts#L410) +[evaluationLogger.ts:451](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/evaluationLogger.ts#L451) ___ @@ -91,4 +111,4 @@ Creates a scorer call as a child of predict_and_score. #### Defined in -[evaluationLogger.ts:332](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/evaluationLogger.ts#L332) \ No newline at end of file +[evaluationLogger.ts:360](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/evaluationLogger.ts#L360) \ No newline at end of file diff --git a/weave/reference/typescript-sdk/classes/stringprompt.mdx b/weave/reference/typescript-sdk/classes/stringprompt.mdx new file mode 100644 index 0000000000..d5aa35cd8a --- /dev/null +++ b/weave/reference/typescript-sdk/classes/stringprompt.mdx @@ -0,0 +1,157 @@ +--- +title: "Class: StringPrompt" +description: "TypeScript SDK reference" +--- + +[weave](../) / StringPrompt + + + +## Hierarchy + +- `Prompt` + + ↳ `StringPrompt` + +## Table of contents + +### Constructors + +- [constructor](./stringprompt#constructor) + +### Properties + +- [\_\_savedRef](./stringprompt#__savedref) +- [content](./stringprompt#content) + +### Accessors + +- [description](./stringprompt#description) +- [name](./stringprompt#name) + +### Methods + +- [format](./stringprompt#format) +- [saveAttrs](./stringprompt#saveattrs) + +## Constructors + +### constructor + +• **new StringPrompt**(`parameters`): [`StringPrompt`](./stringprompt) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `parameters` | `StringPromptParameters` | + +#### Returns + +[`StringPrompt`](./stringprompt) + +#### Overrides + +Prompt.constructor + +#### Defined in + +[prompt.ts:16](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/prompt.ts#L16) + +## Properties + +### \_\_savedRef + +• `Optional` **\_\_savedRef**: [`ObjectRef`](./objectref) \| `Promise`\<[`ObjectRef`](./objectref)\> + +#### Inherited from + +Prompt.\_\_savedRef + +#### Defined in + +[weaveObject.ts:49](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/weaveObject.ts#L49) + +___ + +### content + +• **content**: `string` + +#### Defined in + +[prompt.ts:14](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/prompt.ts#L14) + +## Accessors + +### description + +• `get` **description**(): `undefined` \| `string` + +#### Returns + +`undefined` \| `string` + +#### Inherited from + +Prompt.description + +#### Defined in + +[weaveObject.ts:76](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/weaveObject.ts#L76) + +___ + +### name + +• `get` **name**(): `string` + +#### Returns + +`string` + +#### Inherited from + +Prompt.name + +#### Defined in + +[weaveObject.ts:72](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/weaveObject.ts#L72) + +## Methods + +### format + +▸ **format**(`values?`): `string` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `values` | `Record`\<`string`, `any`\> | + +#### Returns + +`string` + +#### Defined in + +[prompt.ts:21](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/prompt.ts#L21) + +___ + +### saveAttrs + +▸ **saveAttrs**(): `Object` + +#### Returns + +`Object` + +#### Inherited from + +Prompt.saveAttrs + +#### Defined in + +[weaveObject.ts:53](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/weaveObject.ts#L53) \ No newline at end of file diff --git a/weave/reference/typescript-sdk/classes/WeaveClient.mdx b/weave/reference/typescript-sdk/classes/weaveclient.mdx similarity index 59% rename from weave/reference/typescript-sdk/classes/WeaveClient.mdx rename to weave/reference/typescript-sdk/classes/weaveclient.mdx index c8f406ad1b..811f8fda0f 100644 --- a/weave/reference/typescript-sdk/classes/WeaveClient.mdx +++ b/weave/reference/typescript-sdk/classes/weaveclient.mdx @@ -11,37 +11,37 @@ description: "TypeScript SDK reference" ### Constructors -- [constructor](./WeaveClient#constructor) +- [constructor](./weaveclient#constructor) ### Properties -- [projectId](./WeaveClient#projectid) -- [settings](./WeaveClient#settings) -- [traceServerApi](./WeaveClient#traceserverapi) +- [projectId](./weaveclient#projectid) +- [settings](./weaveclient#settings) +- [traceServerApi](./weaveclient#traceserverapi) ### Methods -- [addScore](./WeaveClient#addscore) -- [createCall](./WeaveClient#createcall) -- [finishCall](./WeaveClient#finishcall) -- [finishCallWithException](./WeaveClient#finishcallwithexception) -- [get](./WeaveClient#get) -- [getCall](./WeaveClient#getcall) -- [getCallStack](./WeaveClient#getcallstack) -- [getCalls](./WeaveClient#getcalls) -- [getCallsIterator](./WeaveClient#getcallsiterator) -- [publish](./WeaveClient#publish) -- [pushNewCall](./WeaveClient#pushnewcall) -- [runWithCallStack](./WeaveClient#runwithcallstack) -- [saveOp](./WeaveClient#saveop) -- [updateCall](./WeaveClient#updatecall) -- [waitForBatchProcessing](./WeaveClient#waitforbatchprocessing) +- [addScore](./weaveclient#addscore) +- [createCall](./weaveclient#createcall) +- [finishCall](./weaveclient#finishcall) +- [finishCallWithException](./weaveclient#finishcallwithexception) +- [get](./weaveclient#get) +- [getCall](./weaveclient#getcall) +- [getCallStack](./weaveclient#getcallstack) +- [getCalls](./weaveclient#getcalls) +- [getCallsIterator](./weaveclient#getcallsiterator) +- [publish](./weaveclient#publish) +- [pushNewCall](./weaveclient#pushnewcall) +- [runWithCallStack](./weaveclient#runwithcallstack) +- [saveOp](./weaveclient#saveop) +- [updateCall](./weaveclient#updatecall) +- [waitForBatchProcessing](./weaveclient#waitforbatchprocessing) ## Constructors ### constructor -• **new WeaveClient**(`traceServerApi`, `wandbServerApi`, `projectId`, `settings?`): [`WeaveClient`](./WeaveClient) +• **new WeaveClient**(`traceServerApi`, `wandbServerApi`, `projectId`, `settings?`): [`WeaveClient`](./weaveclient) #### Parameters @@ -54,11 +54,11 @@ description: "TypeScript SDK reference" #### Returns -[`WeaveClient`](./WeaveClient) +[`WeaveClient`](./weaveclient) #### Defined in -[weaveClient.ts:92](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/weaveClient.ts#L92) +[weaveClient.ts:92](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/weaveClient.ts#L92) ## Properties @@ -68,7 +68,7 @@ description: "TypeScript SDK reference" #### Defined in -[weaveClient.ts:95](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/weaveClient.ts#L95) +[weaveClient.ts:95](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/weaveClient.ts#L95) ___ @@ -78,7 +78,7 @@ ___ #### Defined in -[weaveClient.ts:96](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/weaveClient.ts#L96) +[weaveClient.ts:96](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/weaveClient.ts#L96) ___ @@ -88,7 +88,7 @@ ___ #### Defined in -[weaveClient.ts:93](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/weaveClient.ts#L93) +[weaveClient.ts:93](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/weaveClient.ts#L93) ## Methods @@ -114,7 +114,7 @@ Used in imperative evaluation to attach scorer results to predict calls. #### Defined in -[weaveClient.ts:841](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/weaveClient.ts#L841) +[weaveClient.ts:847](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/weaveClient.ts#L847) ___ @@ -143,7 +143,7 @@ ___ #### Defined in -[weaveClient.ts:701](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/weaveClient.ts#L701) +[weaveClient.ts:707](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/weaveClient.ts#L707) ___ @@ -169,7 +169,7 @@ ___ #### Defined in -[weaveClient.ts:748](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/weaveClient.ts#L748) +[weaveClient.ts:754](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/weaveClient.ts#L754) ___ @@ -194,7 +194,7 @@ ___ #### Defined in -[weaveClient.ts:788](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/weaveClient.ts#L788) +[weaveClient.ts:794](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/weaveClient.ts#L794) ___ @@ -206,7 +206,7 @@ ___ | Name | Type | | :------ | :------ | -| `ref` | `ObjectRef` | +| `ref` | [`ObjectRef`](./objectref) | #### Returns @@ -214,7 +214,7 @@ ___ #### Defined in -[weaveClient.ts:281](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/weaveClient.ts#L281) +[weaveClient.ts:281](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/weaveClient.ts#L281) ___ @@ -235,7 +235,7 @@ ___ #### Defined in -[weaveClient.ts:212](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/weaveClient.ts#L212) +[weaveClient.ts:212](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/weaveClient.ts#L212) ___ @@ -249,7 +249,7 @@ ___ #### Defined in -[weaveClient.ts:629](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/weaveClient.ts#L629) +[weaveClient.ts:635](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/weaveClient.ts#L635) ___ @@ -261,7 +261,7 @@ ___ | Name | Type | Default value | | :------ | :------ | :------ | -| `filter` | [`CallsFilter`](../interfaces/CallsFilter) | `{}` | +| `filter` | [`CallsFilter`](../interfaces/callsfilter) | `{}` | | `includeCosts` | `boolean` | `false` | | `limit` | `number` | `1000` | @@ -271,35 +271,35 @@ ___ #### Defined in -[weaveClient.ts:222](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/weaveClient.ts#L222) +[weaveClient.ts:222](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/weaveClient.ts#L222) ___ ### getCallsIterator -▸ **getCallsIterator**(`filter?`, `includeCosts?`, `limit?`): `AsyncIterableIterator`\<[`CallSchema`](../interfaces/CallSchema)\> +▸ **getCallsIterator**(`filter?`, `includeCosts?`, `limit?`): `AsyncIterableIterator`\<[`CallSchema`](../interfaces/callschema)\> #### Parameters | Name | Type | Default value | | :------ | :------ | :------ | -| `filter` | [`CallsFilter`](../interfaces/CallsFilter) | `{}` | +| `filter` | [`CallsFilter`](../interfaces/callsfilter) | `{}` | | `includeCosts` | `boolean` | `false` | | `limit` | `number` | `1000` | #### Returns -`AsyncIterableIterator`\<[`CallSchema`](../interfaces/CallSchema)\> +`AsyncIterableIterator`\<[`CallSchema`](../interfaces/callschema)\> #### Defined in -[weaveClient.ts:236](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/weaveClient.ts#L236) +[weaveClient.ts:236](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/weaveClient.ts#L236) ___ ### publish -▸ **publish**(`obj`, `objId?`): `Promise`\<`ObjectRef`\> +▸ **publish**(`obj`, `objId?`): `Promise`\<[`ObjectRef`](./objectref)\> #### Parameters @@ -310,11 +310,11 @@ ___ #### Returns -`Promise`\<`ObjectRef`\> +`Promise`\<[`ObjectRef`](./objectref)\> #### Defined in -[weaveClient.ts:200](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/weaveClient.ts#L200) +[weaveClient.ts:200](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/weaveClient.ts#L200) ___ @@ -334,7 +334,7 @@ ___ #### Defined in -[weaveClient.ts:633](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/weaveClient.ts#L633) +[weaveClient.ts:639](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/weaveClient.ts#L639) ___ @@ -361,7 +361,7 @@ ___ #### Defined in -[weaveClient.ts:637](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/weaveClient.ts#L637) +[weaveClient.ts:643](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/weaveClient.ts#L643) ___ @@ -382,7 +382,7 @@ ___ #### Defined in -[weaveClient.ts:667](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/weaveClient.ts#L667) +[weaveClient.ts:673](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/weaveClient.ts#L673) ___ @@ -403,7 +403,7 @@ ___ #### Defined in -[weaveClient.ts:824](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/weaveClient.ts#L824) +[weaveClient.ts:830](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/weaveClient.ts#L830) ___ @@ -417,4 +417,4 @@ ___ #### Defined in -[weaveClient.ts:113](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/weaveClient.ts#L113) \ No newline at end of file +[weaveClient.ts:113](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/weaveClient.ts#L113) \ No newline at end of file diff --git a/weave/reference/typescript-sdk/classes/weaveobject.mdx b/weave/reference/typescript-sdk/classes/weaveobject.mdx new file mode 100644 index 0000000000..53015b3adc --- /dev/null +++ b/weave/reference/typescript-sdk/classes/weaveobject.mdx @@ -0,0 +1,107 @@ +--- +title: "Class: WeaveObject" +description: "TypeScript SDK reference" +--- + +[weave](../) / WeaveObject + + + +## Hierarchy + +- `WeaveObject` + + ↳ [`Dataset`](./dataset) + + ↳ [`Evaluation`](./evaluation) + +## Table of contents + +### Constructors + +- [constructor](./weaveobject#constructor) + +### Properties + +- [\_\_savedRef](./weaveobject#__savedref) + +### Accessors + +- [description](./weaveobject#description) +- [name](./weaveobject#name) + +### Methods + +- [saveAttrs](./weaveobject#saveattrs) + +## Constructors + +### constructor + +• **new WeaveObject**(`_baseParameters`): [`WeaveObject`](./weaveobject) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `_baseParameters` | `WeaveObjectParameters` | + +#### Returns + +[`WeaveObject`](./weaveobject) + +#### Defined in + +[weaveObject.ts:51](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/weaveObject.ts#L51) + +## Properties + +### \_\_savedRef + +• `Optional` **\_\_savedRef**: [`ObjectRef`](./objectref) \| `Promise`\<[`ObjectRef`](./objectref)\> + +#### Defined in + +[weaveObject.ts:49](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/weaveObject.ts#L49) + +## Accessors + +### description + +• `get` **description**(): `undefined` \| `string` + +#### Returns + +`undefined` \| `string` + +#### Defined in + +[weaveObject.ts:76](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/weaveObject.ts#L76) + +___ + +### name + +• `get` **name**(): `string` + +#### Returns + +`string` + +#### Defined in + +[weaveObject.ts:72](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/weaveObject.ts#L72) + +## Methods + +### saveAttrs + +▸ **saveAttrs**(): `Object` + +#### Returns + +`Object` + +#### Defined in + +[weaveObject.ts:53](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/weaveObject.ts#L53) \ No newline at end of file diff --git a/weave/reference/typescript-sdk/functions/init.mdx b/weave/reference/typescript-sdk/functions/init.mdx index 2735c22872..d4551d5ce6 100644 --- a/weave/reference/typescript-sdk/functions/init.mdx +++ b/weave/reference/typescript-sdk/functions/init.mdx @@ -5,7 +5,7 @@ description: "TypeScript SDK reference" # init -▸ **init**(`project`, `settings?`): `Promise`\<[`WeaveClient`](../classes/WeaveClient)\> +▸ **init**(`project`, `settings?`): `Promise`\<[`WeaveClient`](../classes/weaveclient)\> Initialize the Weave client, which is required for weave tracing to work. @@ -18,7 +18,7 @@ Initialize the Weave client, which is required for weave tracing to work. #### Returns -`Promise`\<[`WeaveClient`](../classes/WeaveClient)\> +`Promise`\<[`WeaveClient`](../classes/weaveclient)\> A promise that resolves to the initialized Weave client. @@ -28,6 +28,6 @@ If the initialization fails #### Defined in -[clientApi.ts:83](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/clientApi.ts#L83) +[clientApi.ts:83](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/clientApi.ts#L83) ___ diff --git a/weave/reference/typescript-sdk/functions/login.mdx b/weave/reference/typescript-sdk/functions/login.mdx index b242ec6660..850afc46ba 100644 --- a/weave/reference/typescript-sdk/functions/login.mdx +++ b/weave/reference/typescript-sdk/functions/login.mdx @@ -28,6 +28,6 @@ If the API key is not specified or if the connection to the weave trace server c #### Defined in -[clientApi.ts:23](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/clientApi.ts#L23) +[clientApi.ts:23](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/clientApi.ts#L23) ___ diff --git a/weave/reference/typescript-sdk/functions/op.mdx b/weave/reference/typescript-sdk/functions/op.mdx index f9636af713..366f40f01c 100644 --- a/weave/reference/typescript-sdk/functions/op.mdx +++ b/weave/reference/typescript-sdk/functions/op.mdx @@ -5,7 +5,7 @@ description: "TypeScript SDK reference" # op -▸ **op**\<`T`\>(`fn`, `options?`): [`Op`](index#op)\<`T`\> +▸ **op**\<`T`\>(`fn`, `options?`): [`Op`](../type-aliases/op)\<`T`\> #### Type parameters @@ -22,13 +22,13 @@ description: "TypeScript SDK reference" #### Returns -[`Op`](index#op)\<`T`\> +[`Op`](../type-aliases/op)\<`T`\> #### Defined in -[op.ts:369](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/op.ts#L369) +[op.ts:369](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/op.ts#L369) -▸ **op**\<`T`\>(`thisArg`, `fn`, `options?`): [`Op`](index#op)\<`T`\> +▸ **op**\<`T`\>(`thisArg`, `fn`, `options?`): [`Op`](../type-aliases/op)\<`T`\> #### Type parameters @@ -46,11 +46,11 @@ description: "TypeScript SDK reference" #### Returns -[`Op`](index#op)\<`T`\> +[`Op`](../type-aliases/op)\<`T`\> #### Defined in -[op.ts:374](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/op.ts#L374) +[op.ts:374](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/op.ts#L374) ▸ **op**(`target`, `propertyKey`, `descriptor`): `TypedPropertyDescriptor`\<`any`\> @@ -68,9 +68,9 @@ description: "TypeScript SDK reference" #### Defined in -[op.ts:380](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/op.ts#L380) +[op.ts:380](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/op.ts#L380) -▸ **op**\<`T`\>(`value`, `context`): [`Op`](index#op)\<`T`\> +▸ **op**\<`T`\>(`value`, `context`): [`Op`](../type-aliases/op)\<`T`\> #### Type parameters @@ -87,11 +87,11 @@ description: "TypeScript SDK reference" #### Returns -[`Op`](index#op)\<`T`\> +[`Op`](../type-aliases/op)\<`T`\> #### Defined in -[op.ts:386](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/op.ts#L386) +[op.ts:386](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/op.ts#L386) ▸ **op**(`options`): `MethodDecorator` @@ -107,6 +107,6 @@ description: "TypeScript SDK reference" #### Defined in -[op.ts:391](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/op.ts#L391) +[op.ts:391](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/op.ts#L391) ___ diff --git a/weave/reference/typescript-sdk/functions/requireCurrentCallStackEntry.mdx b/weave/reference/typescript-sdk/functions/requirecurrentcallstackentry.mdx similarity index 64% rename from weave/reference/typescript-sdk/functions/requireCurrentCallStackEntry.mdx rename to weave/reference/typescript-sdk/functions/requirecurrentcallstackentry.mdx index de5d1739e3..9fc49ddc98 100644 --- a/weave/reference/typescript-sdk/functions/requireCurrentCallStackEntry.mdx +++ b/weave/reference/typescript-sdk/functions/requirecurrentcallstackentry.mdx @@ -13,6 +13,6 @@ description: "TypeScript SDK reference" #### Defined in -[clientApi.ts:145](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/clientApi.ts#L145) +[clientApi.ts:145](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/clientApi.ts#L145) ___ diff --git a/weave/reference/typescript-sdk/functions/requireCurrentChildSummary.mdx b/weave/reference/typescript-sdk/functions/requirecurrentchildsummary.mdx similarity index 62% rename from weave/reference/typescript-sdk/functions/requireCurrentChildSummary.mdx rename to weave/reference/typescript-sdk/functions/requirecurrentchildsummary.mdx index 7fd8728335..406b7c6250 100644 --- a/weave/reference/typescript-sdk/functions/requireCurrentChildSummary.mdx +++ b/weave/reference/typescript-sdk/functions/requirecurrentchildsummary.mdx @@ -13,6 +13,6 @@ description: "TypeScript SDK reference" #### Defined in -[clientApi.ts:157](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/clientApi.ts#L157) +[clientApi.ts:157](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/clientApi.ts#L157) ___ diff --git a/weave/reference/typescript-sdk/functions/weaveAudio.mdx b/weave/reference/typescript-sdk/functions/weaveaudio.mdx similarity index 70% rename from weave/reference/typescript-sdk/functions/weaveAudio.mdx rename to weave/reference/typescript-sdk/functions/weaveaudio.mdx index 1aa7bac082..a877174ea4 100644 --- a/weave/reference/typescript-sdk/functions/weaveAudio.mdx +++ b/weave/reference/typescript-sdk/functions/weaveaudio.mdx @@ -5,7 +5,7 @@ description: "TypeScript SDK reference" # weaveAudio -▸ **weaveAudio**(`options`): [`WeaveAudio`](../interfaces/WeaveAudio) +▸ **weaveAudio**(`options`): [`WeaveAudio`](../interfaces/weaveaudio) Create a new WeaveAudio object @@ -17,7 +17,7 @@ Create a new WeaveAudio object #### Returns -[`WeaveAudio`](../interfaces/WeaveAudio) +[`WeaveAudio`](../interfaces/weaveaudio) `Example` @@ -28,6 +28,6 @@ const weaveAudio = weaveAudio({ data: audioBuffer }); #### Defined in -[media.ts:62](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/media.ts#L62) +[media.ts:62](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/media.ts#L62) ___ diff --git a/weave/reference/typescript-sdk/functions/weaveImage.mdx b/weave/reference/typescript-sdk/functions/weaveimage.mdx similarity index 70% rename from weave/reference/typescript-sdk/functions/weaveImage.mdx rename to weave/reference/typescript-sdk/functions/weaveimage.mdx index 93d66cc549..509ed16a31 100644 --- a/weave/reference/typescript-sdk/functions/weaveImage.mdx +++ b/weave/reference/typescript-sdk/functions/weaveimage.mdx @@ -5,7 +5,7 @@ description: "TypeScript SDK reference" # weaveImage -▸ **weaveImage**(`options`): [`WeaveImage`](../interfaces/WeaveImage) +▸ **weaveImage**(`options`): [`WeaveImage`](../interfaces/weaveimage) Create a new WeaveImage object @@ -17,7 +17,7 @@ Create a new WeaveImage object #### Returns -[`WeaveImage`](../interfaces/WeaveImage) +[`WeaveImage`](../interfaces/weaveimage) `Example` @@ -28,6 +28,6 @@ const weaveImage = weaveImage({ data: imageBuffer }); #### Defined in -[media.ts:28](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/media.ts#L28) +[media.ts:28](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/media.ts#L28) ___ diff --git a/weave/reference/typescript-sdk/functions/wrapOpenAI.mdx b/weave/reference/typescript-sdk/functions/wrapopenai.mdx similarity index 91% rename from weave/reference/typescript-sdk/functions/wrapOpenAI.mdx rename to weave/reference/typescript-sdk/functions/wrapopenai.mdx index 29bc561793..f9dbca5a58 100644 --- a/weave/reference/typescript-sdk/functions/wrapOpenAI.mdx +++ b/weave/reference/typescript-sdk/functions/wrapopenai.mdx @@ -37,4 +37,4 @@ const result = await openai.chat.completions.create({ #### Defined in -[integrations/openai.ts:469](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/integrations/openai.ts#L469) \ No newline at end of file +[integrations/openai.ts:469](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/integrations/openai.ts#L469) \ No newline at end of file diff --git a/weave/reference/typescript-sdk/interfaces/CallSchema.mdx b/weave/reference/typescript-sdk/interfaces/callschema.mdx similarity index 65% rename from weave/reference/typescript-sdk/interfaces/CallSchema.mdx rename to weave/reference/typescript-sdk/interfaces/callschema.mdx index 4c66792c21..488d34ded0 100644 --- a/weave/reference/typescript-sdk/interfaces/CallSchema.mdx +++ b/weave/reference/typescript-sdk/interfaces/callschema.mdx @@ -13,22 +13,22 @@ CallSchema ### Properties -- [attributes](./CallSchema#attributes) -- [deleted\_at](./CallSchema#deleted_at) -- [display\_name](./CallSchema#display_name) -- [ended\_at](./CallSchema#ended_at) -- [exception](./CallSchema#exception) -- [id](./CallSchema#id) -- [inputs](./CallSchema#inputs) -- [op\_name](./CallSchema#op_name) -- [output](./CallSchema#output) -- [parent\_id](./CallSchema#parent_id) -- [project\_id](./CallSchema#project_id) -- [started\_at](./CallSchema#started_at) -- [summary](./CallSchema#summary) -- [trace\_id](./CallSchema#trace_id) -- [wb\_run\_id](./CallSchema#wb_run_id) -- [wb\_user\_id](./CallSchema#wb_user_id) +- [attributes](./callschema#attributes) +- [deleted\_at](./callschema#deleted_at) +- [display\_name](./callschema#display_name) +- [ended\_at](./callschema#ended_at) +- [exception](./callschema#exception) +- [id](./callschema#id) +- [inputs](./callschema#inputs) +- [op\_name](./callschema#op_name) +- [output](./callschema#output) +- [parent\_id](./callschema#parent_id) +- [project\_id](./callschema#project_id) +- [started\_at](./callschema#started_at) +- [summary](./callschema#summary) +- [trace\_id](./callschema#trace_id) +- [wb\_run\_id](./callschema#wb_run_id) +- [wb\_user\_id](./callschema#wb_user_id) ## Properties @@ -40,7 +40,7 @@ Attributes #### Defined in -[generated/traceServerApi.ts:118](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/generated/traceServerApi.ts#L118) +[generated/traceServerApi.ts:118](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/generated/traceServerApi.ts#L118) ___ @@ -52,7 +52,7 @@ Deleted At #### Defined in -[generated/traceServerApi.ts:133](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/generated/traceServerApi.ts#L133) +[generated/traceServerApi.ts:133](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/generated/traceServerApi.ts#L133) ___ @@ -64,7 +64,7 @@ Display Name #### Defined in -[generated/traceServerApi.ts:107](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/generated/traceServerApi.ts#L107) +[generated/traceServerApi.ts:107](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/generated/traceServerApi.ts#L107) ___ @@ -76,7 +76,7 @@ Ended At #### Defined in -[generated/traceServerApi.ts:122](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/generated/traceServerApi.ts#L122) +[generated/traceServerApi.ts:122](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/generated/traceServerApi.ts#L122) ___ @@ -88,7 +88,7 @@ Exception #### Defined in -[generated/traceServerApi.ts:124](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/generated/traceServerApi.ts#L124) +[generated/traceServerApi.ts:124](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/generated/traceServerApi.ts#L124) ___ @@ -100,7 +100,7 @@ Id #### Defined in -[generated/traceServerApi.ts:101](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/generated/traceServerApi.ts#L101) +[generated/traceServerApi.ts:101](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/generated/traceServerApi.ts#L101) ___ @@ -112,7 +112,7 @@ Inputs #### Defined in -[generated/traceServerApi.ts:120](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/generated/traceServerApi.ts#L120) +[generated/traceServerApi.ts:120](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/generated/traceServerApi.ts#L120) ___ @@ -124,7 +124,7 @@ Op Name #### Defined in -[generated/traceServerApi.ts:105](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/generated/traceServerApi.ts#L105) +[generated/traceServerApi.ts:105](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/generated/traceServerApi.ts#L105) ___ @@ -136,7 +136,7 @@ Output #### Defined in -[generated/traceServerApi.ts:126](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/generated/traceServerApi.ts#L126) +[generated/traceServerApi.ts:126](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/generated/traceServerApi.ts#L126) ___ @@ -148,7 +148,7 @@ Parent Id #### Defined in -[generated/traceServerApi.ts:111](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/generated/traceServerApi.ts#L111) +[generated/traceServerApi.ts:111](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/generated/traceServerApi.ts#L111) ___ @@ -160,7 +160,7 @@ Project Id #### Defined in -[generated/traceServerApi.ts:103](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/generated/traceServerApi.ts#L103) +[generated/traceServerApi.ts:103](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/generated/traceServerApi.ts#L103) ___ @@ -176,7 +176,7 @@ date-time #### Defined in -[generated/traceServerApi.ts:116](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/generated/traceServerApi.ts#L116) +[generated/traceServerApi.ts:116](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/generated/traceServerApi.ts#L116) ___ @@ -186,7 +186,7 @@ ___ #### Defined in -[generated/traceServerApi.ts:127](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/generated/traceServerApi.ts#L127) +[generated/traceServerApi.ts:127](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/generated/traceServerApi.ts#L127) ___ @@ -198,7 +198,7 @@ Trace Id #### Defined in -[generated/traceServerApi.ts:109](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/generated/traceServerApi.ts#L109) +[generated/traceServerApi.ts:109](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/generated/traceServerApi.ts#L109) ___ @@ -210,7 +210,7 @@ Wb Run Id #### Defined in -[generated/traceServerApi.ts:131](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/generated/traceServerApi.ts#L131) +[generated/traceServerApi.ts:131](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/generated/traceServerApi.ts#L131) ___ @@ -222,4 +222,4 @@ Wb User Id #### Defined in -[generated/traceServerApi.ts:129](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/generated/traceServerApi.ts#L129) \ No newline at end of file +[generated/traceServerApi.ts:129](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/generated/traceServerApi.ts#L129) \ No newline at end of file diff --git a/weave/reference/typescript-sdk/interfaces/CallsFilter.mdx b/weave/reference/typescript-sdk/interfaces/callsfilter.mdx similarity index 67% rename from weave/reference/typescript-sdk/interfaces/CallsFilter.mdx rename to weave/reference/typescript-sdk/interfaces/callsfilter.mdx index 66fb8eb535..1c7397ff7a 100644 --- a/weave/reference/typescript-sdk/interfaces/CallsFilter.mdx +++ b/weave/reference/typescript-sdk/interfaces/callsfilter.mdx @@ -13,15 +13,15 @@ CallsFilter ### Properties -- [call\_ids](./CallsFilter#call_ids) -- [input\_refs](./CallsFilter#input_refs) -- [op\_names](./CallsFilter#op_names) -- [output\_refs](./CallsFilter#output_refs) -- [parent\_ids](./CallsFilter#parent_ids) -- [trace\_ids](./CallsFilter#trace_ids) -- [trace\_roots\_only](./CallsFilter#trace_roots_only) -- [wb\_run\_ids](./CallsFilter#wb_run_ids) -- [wb\_user\_ids](./CallsFilter#wb_user_ids) +- [call\_ids](./callsfilter#call_ids) +- [input\_refs](./callsfilter#input_refs) +- [op\_names](./callsfilter#op_names) +- [output\_refs](./callsfilter#output_refs) +- [parent\_ids](./callsfilter#parent_ids) +- [trace\_ids](./callsfilter#trace_ids) +- [trace\_roots\_only](./callsfilter#trace_roots_only) +- [wb\_run\_ids](./callsfilter#wb_run_ids) +- [wb\_user\_ids](./callsfilter#wb_user_ids) ## Properties @@ -33,7 +33,7 @@ Call Ids #### Defined in -[generated/traceServerApi.ts:196](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/generated/traceServerApi.ts#L196) +[generated/traceServerApi.ts:196](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/generated/traceServerApi.ts#L196) ___ @@ -45,7 +45,7 @@ Input Refs #### Defined in -[generated/traceServerApi.ts:188](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/generated/traceServerApi.ts#L188) +[generated/traceServerApi.ts:188](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/generated/traceServerApi.ts#L188) ___ @@ -57,7 +57,7 @@ Op Names #### Defined in -[generated/traceServerApi.ts:186](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/generated/traceServerApi.ts#L186) +[generated/traceServerApi.ts:186](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/generated/traceServerApi.ts#L186) ___ @@ -69,7 +69,7 @@ Output Refs #### Defined in -[generated/traceServerApi.ts:190](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/generated/traceServerApi.ts#L190) +[generated/traceServerApi.ts:190](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/generated/traceServerApi.ts#L190) ___ @@ -81,7 +81,7 @@ Parent Ids #### Defined in -[generated/traceServerApi.ts:192](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/generated/traceServerApi.ts#L192) +[generated/traceServerApi.ts:192](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/generated/traceServerApi.ts#L192) ___ @@ -93,7 +93,7 @@ Trace Ids #### Defined in -[generated/traceServerApi.ts:194](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/generated/traceServerApi.ts#L194) +[generated/traceServerApi.ts:194](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/generated/traceServerApi.ts#L194) ___ @@ -105,7 +105,7 @@ Trace Roots Only #### Defined in -[generated/traceServerApi.ts:198](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/generated/traceServerApi.ts#L198) +[generated/traceServerApi.ts:198](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/generated/traceServerApi.ts#L198) ___ @@ -117,7 +117,7 @@ Wb Run Ids #### Defined in -[generated/traceServerApi.ts:202](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/generated/traceServerApi.ts#L202) +[generated/traceServerApi.ts:202](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/generated/traceServerApi.ts#L202) ___ @@ -129,4 +129,4 @@ Wb User Ids #### Defined in -[generated/traceServerApi.ts:200](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/generated/traceServerApi.ts#L200) \ No newline at end of file +[generated/traceServerApi.ts:200](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/generated/traceServerApi.ts#L200) \ No newline at end of file diff --git a/weave/reference/typescript-sdk/interfaces/WeaveAudio.mdx b/weave/reference/typescript-sdk/interfaces/weaveaudio.mdx similarity index 52% rename from weave/reference/typescript-sdk/interfaces/WeaveAudio.mdx rename to weave/reference/typescript-sdk/interfaces/weaveaudio.mdx index f1d1aa497e..d2d645eabf 100644 --- a/weave/reference/typescript-sdk/interfaces/WeaveAudio.mdx +++ b/weave/reference/typescript-sdk/interfaces/weaveaudio.mdx @@ -17,9 +17,9 @@ description: "TypeScript SDK reference" ### Properties -- [\_weaveType](./WeaveAudio#_weavetype) -- [audioType](./WeaveAudio#audiotype) -- [data](./WeaveAudio#data) +- [\_weaveType](./weaveaudio#_weavetype) +- [audioType](./weaveaudio#audiotype) +- [data](./weaveaudio#data) ## Properties @@ -29,7 +29,7 @@ description: "TypeScript SDK reference" #### Defined in -[media.ts:48](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/media.ts#L48) +[media.ts:48](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/media.ts#L48) ___ @@ -43,7 +43,7 @@ WeaveAudioInput.audioType #### Defined in -[media.ts:44](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/media.ts#L44) +[media.ts:44](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/media.ts#L44) ___ @@ -57,4 +57,4 @@ WeaveAudioInput.data #### Defined in -[media.ts:43](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/media.ts#L43) \ No newline at end of file +[media.ts:43](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/media.ts#L43) \ No newline at end of file diff --git a/weave/reference/typescript-sdk/interfaces/WeaveImage.mdx b/weave/reference/typescript-sdk/interfaces/weaveimage.mdx similarity index 52% rename from weave/reference/typescript-sdk/interfaces/WeaveImage.mdx rename to weave/reference/typescript-sdk/interfaces/weaveimage.mdx index db986c371d..3ec09da6bc 100644 --- a/weave/reference/typescript-sdk/interfaces/WeaveImage.mdx +++ b/weave/reference/typescript-sdk/interfaces/weaveimage.mdx @@ -17,9 +17,9 @@ description: "TypeScript SDK reference" ### Properties -- [\_weaveType](./WeaveImage#_weavetype) -- [data](./WeaveImage#data) -- [imageType](./WeaveImage#imagetype) +- [\_weaveType](./weaveimage#_weavetype) +- [data](./weaveimage#data) +- [imageType](./weaveimage#imagetype) ## Properties @@ -29,7 +29,7 @@ description: "TypeScript SDK reference" #### Defined in -[media.ts:14](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/media.ts#L14) +[media.ts:14](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/media.ts#L14) ___ @@ -43,7 +43,7 @@ WeaveImageInput.data #### Defined in -[media.ts:9](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/media.ts#L9) +[media.ts:9](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/media.ts#L9) ___ @@ -57,4 +57,4 @@ WeaveImageInput.imageType #### Defined in -[media.ts:10](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/media.ts#L10) \ No newline at end of file +[media.ts:10](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/media.ts#L10) \ No newline at end of file diff --git a/weave/reference/typescript-sdk/type-aliases/Op.mdx b/weave/reference/typescript-sdk/type-aliases/op.mdx similarity index 76% rename from weave/reference/typescript-sdk/type-aliases/Op.mdx rename to weave/reference/typescript-sdk/type-aliases/op.mdx index 391dd30025..84c4ff6c80 100644 --- a/weave/reference/typescript-sdk/type-aliases/Op.mdx +++ b/weave/reference/typescript-sdk/type-aliases/op.mdx @@ -5,7 +5,7 @@ description: "TypeScript SDK reference" # Op -Ƭ **Op**\<`T`\>: \{ `__boundThis?`: [`WeaveObject`](../classes/WeaveObject) ; `__isOp`: ``true`` ; `__name`: `string` ; `__parameterNames?`: `ParameterNamesOption` ; `__savedRef?`: `OpRef` \| `Promise`\<`OpRef`\> ; `__wrappedFunction`: `T` ; `invoke`: `CallMethod`\<`T`\> } & `T` & (...`args`: `Parameters`\<`T`\>) => `ReturnType`\<`T`\> extends `AsyncIterable`\ ? `AsyncIterable`\<`Awaited`\<`U`\>\> : `Promise`\<`Awaited`\<`ReturnType`\<`T`\>\>\> +Ƭ **Op**\<`T`\>: \{ `__boundThis?`: [`WeaveObject`](../classes/weaveobject) ; `__isOp`: ``true`` ; `__name`: `string` ; `__parameterNames?`: `ParameterNamesOption` ; `__savedRef?`: `OpRef` \| `Promise`\<`OpRef`\> ; `__wrappedFunction`: `T` ; `invoke`: `CallMethod`\<`T`\> } & `T` & (...`args`: `Parameters`\<`T`\>) => `ReturnType`\<`T`\> extends `AsyncIterable`\ ? `AsyncIterable`\<`Awaited`\<`U`\>\> : `Promise`\<`Awaited`\<`ReturnType`\<`T`\>\>\> #### Type parameters @@ -15,6 +15,6 @@ description: "TypeScript SDK reference" #### Defined in -[opType.ts:7](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/opType.ts#L7) +[opType.ts:7](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/opType.ts#L7) ___ diff --git a/weave/reference/typescript-sdk/type-aliases/OpDecorator.mdx b/weave/reference/typescript-sdk/type-aliases/opdecorator.mdx similarity index 88% rename from weave/reference/typescript-sdk/type-aliases/OpDecorator.mdx rename to weave/reference/typescript-sdk/type-aliases/opdecorator.mdx index edf53da1e8..6dccb7121d 100644 --- a/weave/reference/typescript-sdk/type-aliases/OpDecorator.mdx +++ b/weave/reference/typescript-sdk/type-aliases/opdecorator.mdx @@ -27,7 +27,7 @@ For legacy decorators: #### Defined in -[opType.ts:41](https://github.com/wandb/weave/blob/5d9590d2658eeb69c9c9f04342e107bf9a0a4c90/sdks/node/src/opType.ts#L41) +[opType.ts:41](https://github.com/wandb/weave/blob/01ba25415eecdd98ace095491cc3bdfc7f4ba384/sdks/node/src/opType.ts#L41) ## Functions