From 2eabe2d51ed558663488445c185086072e4a1531 Mon Sep 17 00:00:00 2001 From: norpadon Date: Thu, 27 Jun 2024 23:05:08 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20norpadon?= =?UTF-8?q?/wanga@24cde85a271e87359b788f095fafd4f7bf6c830c=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _modules/wanga/schema/schema.html | 200 +++++++++++++++++++++++++++--- api.html | 99 ++++++++++++++- genindex.html | 27 +++- objects.inv | Bin 513 -> 553 bytes searchindex.js | 2 +- 5 files changed, 307 insertions(+), 21 deletions(-) diff --git a/_modules/wanga/schema/schema.html b/_modules/wanga/schema/schema.html index a17ad43..c279209 100644 --- a/_modules/wanga/schema/schema.html +++ b/_modules/wanga/schema/schema.html @@ -76,10 +76,22 @@

Source code for wanga.schema.schema

 from collections.abc import Mapping, Sequence
 from types import NoneType
-from typing import Callable, TypeAlias
+from typing import Callable, Literal, TypeAlias
 
 from attrs import evolve, frozen
 
+from .jsonschema import (
+    AnthropicCallableSchema,
+    ArrayJsonSchema,
+    CallableJsonSchema,
+    EnumJsonSchema,
+    JsonSchema,
+    JsonSchemaFlavour,
+    LeafJsonSchema,
+    LeafTypeName,
+    ObjectJsonSchema,
+    OpenAICallableSchema,
+)
 from .utils import TypeAnnotation
 
 __all__ = [
@@ -100,6 +112,19 @@ 

Source code for wanga.schema.schema

 JSON: TypeAlias = int | float | str | None | dict[str, "JSON"] | list["JSON"]
 
 
+type_to_jsonname: dict[type | None, LeafTypeName] = {
+    int: "integer",
+    float: "number",
+    str: "string",
+    bool: "boolean",
+    None: "null",
+}
+
+
+class JsonSchemaGenerationError(ValueError):
+    pass
+
+
 
[docs] @frozen @@ -108,8 +133,12 @@

Source code for wanga.schema.schema

 
 
[docs] - def json_schema(self) -> JSON: - r"""Returns the JSON schema of the node to use in the LLM function call APIs.""" + def json_schema(self, parent_hint: str | None = None) -> JsonSchema: + r"""Returns the JSON schema of the node to use in the LLM function call APIs. + + Args: + parent_hint: Hint from the parent object. + """ raise NotImplementedError
@@ -126,7 +155,15 @@

Source code for wanga.schema.schema

             `None` if the annotation is `None`.
     """
 
-    original_annotation: NoneType | TypeAnnotation
+ original_annotation: NoneType | TypeAnnotation + +
+[docs] + def json_schema(self, parent_hint: str | None = None) -> LeafJsonSchema: + raise JsonSchemaGenerationError( + "JSON schema cannot be generated for missing or undefined annotations." + )
+
@@ -142,7 +179,18 @@

Source code for wanga.schema.schema

         primitive_type: The primitive type.
     """
 
-    primitive_type: type[int] | type[float] | type[str] | type[bool]
+ primitive_type: type[int] | type[float] | type[str] | type[bool] + +
+[docs] + def json_schema(self, parent_hint: str | None = None) -> LeafJsonSchema: + result = LeafJsonSchema( + type=type_to_jsonname[self.primitive_type], + ) + if parent_hint: + result["description"] = parent_hint + return result
+
@@ -159,7 +207,16 @@

Source code for wanga.schema.schema

     """
 
     sequence_type: type[Sequence]
-    item_schema: SchemaNode
+ item_schema: SchemaNode + +
+[docs] + def json_schema(self, parent_hint: str | None = None) -> ArrayJsonSchema: + result = ArrayJsonSchema(type="array", items=self.item_schema.json_schema()) + if parent_hint: + result["description"] = parent_hint + return result
+
@@ -175,7 +232,15 @@

Source code for wanga.schema.schema

     """
 
     tuple_type: type[tuple]
-    item_schemas: list[SchemaNode]
+ item_schemas: list[SchemaNode] + +
+[docs] + def json_schema(self, parent_hint: str | None = None) -> JsonSchema: + raise JsonSchemaGenerationError( + "JSON schema cannot be generated for heterogeneous tuple types." + )
+ @@ -193,7 +258,15 @@

Source code for wanga.schema.schema

 
     mapping_type: type[Mapping]
     key_schema: SchemaNode
-    value_schema: SchemaNode
+ value_schema: SchemaNode + +
+[docs] + def json_schema(self, parent_hint: str | None = None) -> JsonSchema: + raise JsonSchemaGenerationError( + "JSON schema cannot be generated for Mapping types." + )
+ @@ -208,10 +281,59 @@

Source code for wanga.schema.schema

             May be None in case of optional types.
     """
 
-    options: list[SchemaNode | None]
+ options: list[SchemaNode | None] + +
+[docs] + def json_schema(self, parent_hint: str | None = None) -> JsonSchema: + if all( + option is None or isinstance(option, PrimitiveNode) + for option in self.options + ): + type_names = { + type_to_jsonname[option.primitive_type] # type: ignore + for option in self.options + if option is not None + } + if "number" in type_names and "integer" in type_names: + type_names.remove("integer") + type_names = list(type_names) + if len(type_names) == 1: + type_names = type_names[0] + result = LeafJsonSchema( + type=type_names, # type: ignore + ) + if parent_hint: + result["description"] = parent_hint + return result + raise JsonSchemaGenerationError( + "JSON schema cannot be generated for non-trivial Union types." + )
+ +@frozen +class LiteralNode(SchemaNode): + r"""Node corresponding to the `Literal` type. + + Attributes: + options: The value of the literal. + """ + + options: list[int | float | str | bool] + + def json_schema(self, parent_hint: str | None = None) -> EnumJsonSchema: + if not all(isinstance(option, str) for option in self.options): + raise JsonSchemaGenerationError( + "JSON schema can only be generated for string literal types." + ) + result = EnumJsonSchema(type="string", enum=self.options) # type: ignore + if parent_hint: + result["description"] = parent_hint + return result + +
[docs] @frozen @@ -228,7 +350,10 @@

Source code for wanga.schema.schema

     name: str
     schema: SchemaNode
     hint: str | None
-    required: bool
+ required: bool + + def json_schema(self) -> JsonSchema: + return self.schema.json_schema(parent_hint=self.hint)
@@ -249,7 +374,26 @@

Source code for wanga.schema.schema

     constructor_fn: Callable
     name: str
     fields: list[ObjectField]
-    hint: str | None
+ hint: str | None + +
+[docs] + def json_schema(self, parent_hint: str | None = None) -> ObjectJsonSchema: + result = ObjectJsonSchema( + type="object", + properties={field.name: field.json_schema() for field in self.fields}, + required=[field.name for field in self.fields if field.required], + ) + joint_hint = [] + if parent_hint: + joint_hint.append(parent_hint) + if self.hint: + joint_hint.append(self.hint) + joint_hint = "\n\n".join(joint_hint) + if joint_hint: + result["description"] = joint_hint + return result
+ @@ -263,18 +407,40 @@

Source code for wanga.schema.schema

         call_schema: Schema of the function call.
         return_schema: Schema of the return value.
             None if the function returns None.
+        long_description: Long description extracted from the docstring.
+            It is used to pass tool descriptions to LLMs. It is not used
+            for return values.
     """
 
     call_schema: ObjectNode
     return_schema: SchemaNode
+    long_description: str | None
 
-    def json_schema(self) -> JSON:
-        result = dict(
-            name=self.call_schema.name,
-            parameters=evolve(self.call_schema, hint=None).json_schema(),
-        )
+    def json_schema(
+        self, flavour: JsonSchemaFlavour, include_long_description: bool = False
+    ) -> CallableJsonSchema:
+        full_description = []
         if self.call_schema.hint:
-            result["description"] = self.call_schema.hint
+            full_description.append(self.call_schema.hint)
+        if self.long_description and include_long_description:
+            full_description.append(self.long_description)
+        full_description = "\n\n".join(full_description)
+        if flavour is JsonSchemaFlavour.ANTHROPIC:
+            result = AnthropicCallableSchema(
+                name=self.call_schema.name,
+                input_schema=evolve(self.call_schema, hint=None).json_schema(),
+            )
+            if full_description:
+                result["description"] = full_description
+        elif flavour is JsonSchemaFlavour.OPENAI:
+            result = OpenAICallableSchema(
+                name=self.call_schema.name,
+                parameters=evolve(self.call_schema, hint=None).json_schema(),
+            )
+            if full_description:
+                result["description"] = full_description
+        else:
+            raise ValueError(f"Unknown JSON schema flavour: {flavour}")
         return result
diff --git a/api.html b/api.html index 0824acc..36bbd77 100644 --- a/api.html +++ b/api.html @@ -102,7 +102,7 @@

Schema extraction and manipulation

Schema Definition

-class wanga.schema.schema.CallableSchema(call_schema: ObjectNode, return_schema: SchemaNode)[source]
+class wanga.schema.schema.CallableSchema(call_schema: ObjectNode, return_schema: SchemaNode, long_description: str | None)[source]

Complete schema of a function or a class.

@@ -127,6 +127,19 @@

Schema extraction and manipulation +
+long_description
+

Long description extracted from the docstring. +It is used to pass tool descriptions to LLMs. It is not used +for return values.

+
+
Type:
+

str | None

+
+
+

+
@@ -166,6 +179,17 @@

Schema extraction and manipulation +
+json_schema(parent_hint: str | None = None) LeafJsonSchema | EnumJsonSchema | ObjectJsonSchema | ArrayJsonSchema[source]
+

Returns the JSON schema of the node to use in the LLM function call APIs.

+
+
Parameters:
+

parent_hint – Hint from the parent object.

+
+
+

+
@@ -222,6 +246,17 @@

Schema extraction and manipulation +
+json_schema(parent_hint: str | None = None) ObjectJsonSchema[source]
+

Returns the JSON schema of the node to use in the LLM function call APIs.

+
+
Parameters:
+

parent_hint – Hint from the parent object.

+
+
+

+
@@ -240,6 +275,17 @@

Schema extraction and manipulation +
+json_schema(parent_hint: str | None = None) LeafJsonSchema[source]
+

Returns the JSON schema of the node to use in the LLM function call APIs.

+
+
Parameters:
+

parent_hint – Hint from the parent object.

+
+
+

+
@@ -248,8 +294,13 @@

Schema extraction and manipulation
-json_schema() int | float | str | None | dict[str, JSON] | list[JSON][source]
+json_schema(parent_hint: str | None = None) LeafJsonSchema | EnumJsonSchema | ObjectJsonSchema | ArrayJsonSchema[source]

Returns the JSON schema of the node to use in the LLM function call APIs.

+
+
Parameters:
+

parent_hint – Hint from the parent object.

+
+

@@ -283,6 +334,17 @@

Schema extraction and manipulation +
+json_schema(parent_hint: str | None = None) ArrayJsonSchema[source]
+

Returns the JSON schema of the node to use in the LLM function call APIs.

+
+
Parameters:
+

parent_hint – Hint from the parent object.

+
+
+
+
@@ -311,6 +373,17 @@

Schema extraction and manipulation +
+json_schema(parent_hint: str | None = None) LeafJsonSchema | EnumJsonSchema | ObjectJsonSchema | ArrayJsonSchema[source]
+

Returns the JSON schema of the node to use in the LLM function call APIs.

+
+
Parameters:
+

parent_hint – Hint from the parent object.

+
+
+

+
@@ -324,6 +397,17 @@

Schema extraction and manipulation +
+json_schema(parent_hint: str | None = None) LeafJsonSchema[source]
+

Returns the JSON schema of the node to use in the LLM function call APIs.

+
+
Parameters:
+

parent_hint – Hint from the parent object.

+
+
+

+
@@ -342,6 +426,17 @@

Schema extraction and manipulation +
+json_schema(parent_hint: str | None = None) LeafJsonSchema | EnumJsonSchema | ObjectJsonSchema | ArrayJsonSchema[source]
+

Returns the JSON schema of the node to use in the LLM function call APIs.

+
+
Parameters:
+

parent_hint – Hint from the parent object.

+
+
+

+ diff --git a/genindex.html b/genindex.html index 612eb7a..532e2f7 100644 --- a/genindex.html +++ b/genindex.html @@ -82,6 +82,7 @@

Index

| I | J | K + | L | M | N | O @@ -137,8 +138,24 @@

I

J

@@ -150,6 +167,14 @@

K

+

L

+ + +
+

M

    diff --git a/objects.inv b/objects.inv index 1b1b1f03c02ec5ef6228270d2e943643a6960ddc..ea0ca44db9066c16f06f4a239b1db246a6702a62 100644 GIT binary patch delta 442 zcmV;r0Y(0S1gQj&d4E<*PQx$|-RBfWu&o8#?hq1E7lnvYv8-Hsnz;B!?6hRZHMkxp z!KvFOkq}_FtJt1-Z)V=uvA0AO1esF zcSH!X6fiqdP(iFkHyy+OpqTpUqRWIhSMg=-Ac0C~RV)}-T7PllxK^j~Rp9DMr6xBe z#&A_UXa-UG^l*4>bw9oYS85hZ@(RrvYQQp#7p^gI648c;8d5WQT&{t-dk%s{sTy$6 z&FElw)yA}m3GWz6uG}g3 zv=9SidKGi!@5_YXd(;^MW4*hxfA686AnVweX^KXj4c+Dw^aLxY+I^T6ptzUiedp>g zbP%ocVKpEo?J(=y_KZD`7Z6nYpQY1im-yGmr$yeamNTFnX>+~E{442)NTwMb41sDI ko>w7e&-w=}Z@h|Xh_*l~S`L9>EnsHBo|6KyZ^%54(kb}eGXMYp delta 402 zcmV;D0d4-N1c3yQd4E;SPQx$^zV|7D;MxeTyCEc`9R?L+;y7ig*Jk98Cf(?b*WmSd z64GT|TM5CEajG5r`|QuHn;nq_LAsd;mDe25H6ohf(h7d*Ptq%tCc8EZ8(Mr=d4)Y@g<-{0t(=(g~#nidWz7t|?#a6Y22&xKfUCCIo8Gq55$>Krf5Ts{-!>`c% zLwPK`y|j&nvxv5Y*AUy$<7xxc-ZS8N&_Fycc#b^`uiKg?vf({L$)r68FNp}Bd{!~R zEZah`_7M{6&Wrm1{5Ayl(8KV?sNot3u%*gR;()grBn=o8xn> zdAO1zYAD0R7k|gLwc->kWDaX4ArDrukW9&V6js_g^LN?KLB{5jTv3$vF?5?v(G#qp zYF}MafMia_`##nE?SZ$+-Kj@RTQlj?4vd407vNO6m9`4)8~^(FG{~jZ0;DBvuNR5C w@_wkKo3smfs+qqlea%7i4_MZ?C6Z&b0aDR&4D@FnGYj|ej1-W31NsKXaylr=O8@`> diff --git a/searchindex.js b/searchindex.js index 8425011..a764acf 100644 --- a/searchindex.js +++ b/searchindex.js @@ -1 +1 @@ -Search.setIndex({"alltitles": {"API Reference": [[0, "module-wanga"]], "Contents:": [[1, null]], "Indices and tables": [[1, "indices-and-tables"]], "Schema Definition": [[0, "module-wanga.schema.schema"]], "Schema Extraction": [[0, "schema-extraction"]], "Schema extraction and manipulation": [[0, "schema-extraction-and-manipulation"]], "Welcome to wanga\u2019s documentation!": [[1, "welcome-to-wanga-s-documentation"]]}, "docnames": ["api", "index"], "envversion": {"sphinx": 61, "sphinx.domains.c": 3, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 9, "sphinx.domains.index": 1, "sphinx.domains.javascript": 3, "sphinx.domains.math": 2, "sphinx.domains.python": 4, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx.ext.viewcode": 1}, "filenames": ["api.rst", "index.rst"], "indexentries": {"call_schema (wanga.schema.schema.callableschema attribute)": [[0, "wanga.schema.schema.CallableSchema.call_schema", false]], "callableschema (class in wanga.schema.schema)": [[0, "wanga.schema.schema.CallableSchema", false]], "fields (wanga.schema.schema.objectnode attribute)": [[0, "wanga.schema.schema.ObjectNode.fields", false]], "hint (wanga.schema.schema.objectnode attribute)": [[0, "wanga.schema.schema.ObjectNode.hint", false]], "item_schema (wanga.schema.schema.sequencenode attribute)": [[0, "wanga.schema.schema.SequenceNode.item_schema", false]], "item_schemas (wanga.schema.schema.tuplenode attribute)": [[0, "wanga.schema.schema.TupleNode.item_schemas", false]], "json_schema() (wanga.schema.schema.schemanode method)": [[0, "wanga.schema.schema.SchemaNode.json_schema", false]], "key_schema (wanga.schema.schema.mappingnode attribute)": [[0, "wanga.schema.schema.MappingNode.key_schema", false]], "mapping_type (wanga.schema.schema.mappingnode attribute)": [[0, "wanga.schema.schema.MappingNode.mapping_type", false]], "mappingnode (class in wanga.schema.schema)": [[0, "wanga.schema.schema.MappingNode", false]], "module": [[0, "module-wanga", false], [0, "module-wanga.schema.schema", false]], "name (wanga.schema.schema.objectnode attribute)": [[0, "wanga.schema.schema.ObjectNode.name", false]], "objectfield (class in wanga.schema.schema)": [[0, "wanga.schema.schema.ObjectField", false]], "objectnode (class in wanga.schema.schema)": [[0, "wanga.schema.schema.ObjectNode", false]], "options (wanga.schema.schema.unionnode attribute)": [[0, "wanga.schema.schema.UnionNode.options", false]], "primitive_type (wanga.schema.schema.primitivenode attribute)": [[0, "wanga.schema.schema.PrimitiveNode.primitive_type", false]], "primitivenode (class in wanga.schema.schema)": [[0, "wanga.schema.schema.PrimitiveNode", false]], "return_schema (wanga.schema.schema.callableschema attribute)": [[0, "wanga.schema.schema.CallableSchema.return_schema", false]], "schemanode (class in wanga.schema.schema)": [[0, "wanga.schema.schema.SchemaNode", false]], "sequence_type (wanga.schema.schema.sequencenode attribute)": [[0, "wanga.schema.schema.SequenceNode.sequence_type", false]], "sequencenode (class in wanga.schema.schema)": [[0, "wanga.schema.schema.SequenceNode", false]], "tuple_type (wanga.schema.schema.tuplenode attribute)": [[0, "wanga.schema.schema.TupleNode.tuple_type", false]], "tuplenode (class in wanga.schema.schema)": [[0, "wanga.schema.schema.TupleNode", false]], "undefinednode (class in wanga.schema.schema)": [[0, "wanga.schema.schema.UndefinedNode", false]], "unionnode (class in wanga.schema.schema)": [[0, "wanga.schema.schema.UnionNode", false]], "value_schema (wanga.schema.schema.mappingnode attribute)": [[0, "wanga.schema.schema.MappingNode.value_schema", false]], "wanga": [[0, "module-wanga", false]], "wanga.schema.schema": [[0, "module-wanga.schema.schema", false]]}, "objects": {"": [[0, 0, 0, "-", "wanga"]], "wanga.schema": [[0, 0, 0, "-", "schema"]], "wanga.schema.schema": [[0, 1, 1, "", "CallableSchema"], [0, 1, 1, "", "MappingNode"], [0, 1, 1, "", "ObjectField"], [0, 1, 1, "", "ObjectNode"], [0, 1, 1, "", "PrimitiveNode"], [0, 1, 1, "", "SchemaNode"], [0, 1, 1, "", "SequenceNode"], [0, 1, 1, "", "TupleNode"], [0, 1, 1, "", "UndefinedNode"], [0, 1, 1, "", "UnionNode"]], "wanga.schema.schema.CallableSchema": [[0, 2, 1, "", "call_schema"], [0, 2, 1, "", "return_schema"]], "wanga.schema.schema.MappingNode": [[0, 2, 1, "", "key_schema"], [0, 2, 1, "", "mapping_type"], [0, 2, 1, "", "value_schema"]], "wanga.schema.schema.ObjectNode": [[0, 2, 1, "", "fields"], [0, 2, 1, "", "hint"], [0, 2, 1, "", "name"]], "wanga.schema.schema.PrimitiveNode": [[0, 2, 1, "", "primitive_type"]], "wanga.schema.schema.SchemaNode": [[0, 3, 1, "", "json_schema"]], "wanga.schema.schema.SequenceNode": [[0, 2, 1, "", "item_schema"], [0, 2, 1, "", "sequence_type"]], "wanga.schema.schema.TupleNode": [[0, 2, 1, "", "item_schemas"], [0, 2, 1, "", "tuple_type"]], "wanga.schema.schema.UnionNode": [[0, 2, 1, "", "options"]]}, "objnames": {"0": ["py", "module", "Python module"], "1": ["py", "class", "Python class"], "2": ["py", "attribute", "Python attribute"], "3": ["py", "method", "Python method"]}, "objtypes": {"0": "py:module", "1": "py:class", "2": "py:attribute", "3": "py:method"}, "terms": {"The": 0, "abc": 0, "an": 0, "ani": 0, "annot": 0, "api": 1, "ar": 0, "atribut": 0, "base": 0, "bool": 0, "call": 0, "call_schema": 0, "callabl": 0, "callableschema": 0, "case": 0, "class": 0, "collect": 0, "complet": 0, "composit": 0, "constructor": 0, "constructor_fn": 0, "correspond": 0, "defaultdict": 0, "dict": 0, "docstr": 0, "doe": 0, "e": 0, "field": 0, "float": 0, "from": 0, "function": 0, "g": 0, "gener": 0, "hint": 0, "homogen": 0, "i": 0, "includ": 0, "index": 1, "int": 0, "item": 0, "item_schema": 0, "json": 0, "json_schema": 0, "kei": 0, "key_schema": 0, "list": 0, "llm": 0, "mai": 0, "map": 0, "mapping_typ": 0, "mappingnod": 0, "miss": 0, "modul": 1, "name": 0, "namedtupl": 0, "node": 0, "none": 0, "object": 0, "objectfield": 0, "objectnod": 0, "option": 0, "original_annot": 0, "page": 1, "paramet": 0, "primit": 0, "primitim": 0, "primitive_typ": 0, "primitivenod": 0, "refer": 1, "repres": 0, "requir": 0, "return": 0, "return_schema": 0, "schemanod": 0, "search": 1, "sequenc": 0, "sequence_typ": 0, "sequencenod": 0, "signatur": 0, "sourc": 0, "str": 0, "string": 0, "subclass": 0, "tupl": 0, "tuple_typ": 0, "tuplenod": 0, "type": 0, "undefinednod": 0, "union": 0, "unionnod": 0, "us": 0, "valu": 0, "value_schema": 0, "wanga": 0, "whether": 0}, "titles": ["API Reference", "Welcome to wanga\u2019s documentation!"], "titleterms": {"": 1, "api": 0, "content": 1, "definit": 0, "document": 1, "extract": 0, "indic": 1, "manipul": 0, "refer": 0, "schema": 0, "tabl": 1, "wanga": 1, "welcom": 1}}) \ No newline at end of file +Search.setIndex({"alltitles": {"API Reference": [[0, "module-wanga"]], "Contents:": [[1, null]], "Indices and tables": [[1, "indices-and-tables"]], "Schema Definition": [[0, "module-wanga.schema.schema"]], "Schema Extraction": [[0, "schema-extraction"]], "Schema extraction and manipulation": [[0, "schema-extraction-and-manipulation"]], "Welcome to wanga\u2019s documentation!": [[1, "welcome-to-wanga-s-documentation"]]}, "docnames": ["api", "index"], "envversion": {"sphinx": 61, "sphinx.domains.c": 3, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 9, "sphinx.domains.index": 1, "sphinx.domains.javascript": 3, "sphinx.domains.math": 2, "sphinx.domains.python": 4, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx.ext.viewcode": 1}, "filenames": ["api.rst", "index.rst"], "indexentries": {"call_schema (wanga.schema.schema.callableschema attribute)": [[0, "wanga.schema.schema.CallableSchema.call_schema", false]], "callableschema (class in wanga.schema.schema)": [[0, "wanga.schema.schema.CallableSchema", false]], "fields (wanga.schema.schema.objectnode attribute)": [[0, "wanga.schema.schema.ObjectNode.fields", false]], "hint (wanga.schema.schema.objectnode attribute)": [[0, "wanga.schema.schema.ObjectNode.hint", false]], "item_schema (wanga.schema.schema.sequencenode attribute)": [[0, "wanga.schema.schema.SequenceNode.item_schema", false]], "item_schemas (wanga.schema.schema.tuplenode attribute)": [[0, "wanga.schema.schema.TupleNode.item_schemas", false]], "json_schema() (wanga.schema.schema.mappingnode method)": [[0, "wanga.schema.schema.MappingNode.json_schema", false]], "json_schema() (wanga.schema.schema.objectnode method)": [[0, "wanga.schema.schema.ObjectNode.json_schema", false]], "json_schema() (wanga.schema.schema.primitivenode method)": [[0, "wanga.schema.schema.PrimitiveNode.json_schema", false]], "json_schema() (wanga.schema.schema.schemanode method)": [[0, "wanga.schema.schema.SchemaNode.json_schema", false]], "json_schema() (wanga.schema.schema.sequencenode method)": [[0, "wanga.schema.schema.SequenceNode.json_schema", false]], "json_schema() (wanga.schema.schema.tuplenode method)": [[0, "wanga.schema.schema.TupleNode.json_schema", false]], "json_schema() (wanga.schema.schema.undefinednode method)": [[0, "wanga.schema.schema.UndefinedNode.json_schema", false]], "json_schema() (wanga.schema.schema.unionnode method)": [[0, "wanga.schema.schema.UnionNode.json_schema", false]], "key_schema (wanga.schema.schema.mappingnode attribute)": [[0, "wanga.schema.schema.MappingNode.key_schema", false]], "long_description (wanga.schema.schema.callableschema attribute)": [[0, "wanga.schema.schema.CallableSchema.long_description", false]], "mapping_type (wanga.schema.schema.mappingnode attribute)": [[0, "wanga.schema.schema.MappingNode.mapping_type", false]], "mappingnode (class in wanga.schema.schema)": [[0, "wanga.schema.schema.MappingNode", false]], "module": [[0, "module-wanga", false], [0, "module-wanga.schema.schema", false]], "name (wanga.schema.schema.objectnode attribute)": [[0, "wanga.schema.schema.ObjectNode.name", false]], "objectfield (class in wanga.schema.schema)": [[0, "wanga.schema.schema.ObjectField", false]], "objectnode (class in wanga.schema.schema)": [[0, "wanga.schema.schema.ObjectNode", false]], "options (wanga.schema.schema.unionnode attribute)": [[0, "wanga.schema.schema.UnionNode.options", false]], "primitive_type (wanga.schema.schema.primitivenode attribute)": [[0, "wanga.schema.schema.PrimitiveNode.primitive_type", false]], "primitivenode (class in wanga.schema.schema)": [[0, "wanga.schema.schema.PrimitiveNode", false]], "return_schema (wanga.schema.schema.callableschema attribute)": [[0, "wanga.schema.schema.CallableSchema.return_schema", false]], "schemanode (class in wanga.schema.schema)": [[0, "wanga.schema.schema.SchemaNode", false]], "sequence_type (wanga.schema.schema.sequencenode attribute)": [[0, "wanga.schema.schema.SequenceNode.sequence_type", false]], "sequencenode (class in wanga.schema.schema)": [[0, "wanga.schema.schema.SequenceNode", false]], "tuple_type (wanga.schema.schema.tuplenode attribute)": [[0, "wanga.schema.schema.TupleNode.tuple_type", false]], "tuplenode (class in wanga.schema.schema)": [[0, "wanga.schema.schema.TupleNode", false]], "undefinednode (class in wanga.schema.schema)": [[0, "wanga.schema.schema.UndefinedNode", false]], "unionnode (class in wanga.schema.schema)": [[0, "wanga.schema.schema.UnionNode", false]], "value_schema (wanga.schema.schema.mappingnode attribute)": [[0, "wanga.schema.schema.MappingNode.value_schema", false]], "wanga": [[0, "module-wanga", false]], "wanga.schema.schema": [[0, "module-wanga.schema.schema", false]]}, "objects": {"": [[0, 0, 0, "-", "wanga"]], "wanga.schema": [[0, 0, 0, "-", "schema"]], "wanga.schema.schema": [[0, 1, 1, "", "CallableSchema"], [0, 1, 1, "", "MappingNode"], [0, 1, 1, "", "ObjectField"], [0, 1, 1, "", "ObjectNode"], [0, 1, 1, "", "PrimitiveNode"], [0, 1, 1, "", "SchemaNode"], [0, 1, 1, "", "SequenceNode"], [0, 1, 1, "", "TupleNode"], [0, 1, 1, "", "UndefinedNode"], [0, 1, 1, "", "UnionNode"]], "wanga.schema.schema.CallableSchema": [[0, 2, 1, "", "call_schema"], [0, 2, 1, "", "long_description"], [0, 2, 1, "", "return_schema"]], "wanga.schema.schema.MappingNode": [[0, 3, 1, "", "json_schema"], [0, 2, 1, "", "key_schema"], [0, 2, 1, "", "mapping_type"], [0, 2, 1, "", "value_schema"]], "wanga.schema.schema.ObjectNode": [[0, 2, 1, "", "fields"], [0, 2, 1, "", "hint"], [0, 3, 1, "", "json_schema"], [0, 2, 1, "", "name"]], "wanga.schema.schema.PrimitiveNode": [[0, 3, 1, "", "json_schema"], [0, 2, 1, "", "primitive_type"]], "wanga.schema.schema.SchemaNode": [[0, 3, 1, "", "json_schema"]], "wanga.schema.schema.SequenceNode": [[0, 2, 1, "", "item_schema"], [0, 3, 1, "", "json_schema"], [0, 2, 1, "", "sequence_type"]], "wanga.schema.schema.TupleNode": [[0, 2, 1, "", "item_schemas"], [0, 3, 1, "", "json_schema"], [0, 2, 1, "", "tuple_type"]], "wanga.schema.schema.UndefinedNode": [[0, 3, 1, "", "json_schema"]], "wanga.schema.schema.UnionNode": [[0, 3, 1, "", "json_schema"], [0, 2, 1, "", "options"]]}, "objnames": {"0": ["py", "module", "Python module"], "1": ["py", "class", "Python class"], "2": ["py", "attribute", "Python attribute"], "3": ["py", "method", "Python method"]}, "objtypes": {"0": "py:module", "1": "py:class", "2": "py:attribute", "3": "py:method"}, "terms": {"It": 0, "The": 0, "abc": 0, "an": 0, "ani": 0, "annot": 0, "api": 1, "ar": 0, "arrayjsonschema": 0, "atribut": 0, "base": 0, "bool": 0, "call": 0, "call_schema": 0, "callabl": 0, "callableschema": 0, "case": 0, "class": 0, "collect": 0, "complet": 0, "composit": 0, "constructor": 0, "constructor_fn": 0, "correspond": 0, "defaultdict": 0, "descript": 0, "dict": 0, "docstr": 0, "doe": 0, "e": 0, "enumjsonschema": 0, "field": 0, "float": 0, "from": 0, "function": 0, "g": 0, "gener": 0, "hint": 0, "homogen": 0, "i": 0, "includ": 0, "index": 1, "int": 0, "item": 0, "item_schema": 0, "json": 0, "json_schema": 0, "kei": 0, "key_schema": 0, "leafjsonschema": 0, "list": 0, "llm": 0, "long": 0, "long_descript": 0, "mai": 0, "map": 0, "mapping_typ": 0, "mappingnod": 0, "miss": 0, "modul": 1, "name": 0, "namedtupl": 0, "node": 0, "none": 0, "object": 0, "objectfield": 0, "objectjsonschema": 0, "objectnod": 0, "option": 0, "original_annot": 0, "page": 1, "paramet": 0, "parent": 0, "parent_hint": 0, "pass": 0, "primit": 0, "primitim": 0, "primitive_typ": 0, "primitivenod": 0, "refer": 1, "repres": 0, "requir": 0, "return": 0, "return_schema": 0, "schemanod": 0, "search": 1, "sequenc": 0, "sequence_typ": 0, "sequencenod": 0, "signatur": 0, "sourc": 0, "str": 0, "string": 0, "subclass": 0, "tool": 0, "tupl": 0, "tuple_typ": 0, "tuplenod": 0, "type": 0, "undefinednod": 0, "union": 0, "unionnod": 0, "us": 0, "valu": 0, "value_schema": 0, "wanga": 0, "whether": 0}, "titles": ["API Reference", "Welcome to wanga\u2019s documentation!"], "titleterms": {"": 1, "api": 0, "content": 1, "definit": 0, "document": 1, "extract": 0, "indic": 1, "manipul": 0, "refer": 0, "schema": 0, "tabl": 1, "wanga": 1, "welcom": 1}}) \ No newline at end of file