mirror of
https://github.com/kennethreitz/instructor.git
synced 2026-06-05 22:50:18 +00:00
Installed erdantic and added schemas (#20)
* Move examples to dir and fix imports * Install erdantic and pygraphviz * Add schema function and image * Separate erd diagram function from example script --------- Co-authored-by: Jason Liu <jxnl@users.noreply.github.com>
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import openai
|
||||
from typing import List
|
||||
|
||||
import openai
|
||||
from pydantic import Field, BaseModel
|
||||
|
||||
from openai_function_call import OpenAISchema
|
||||
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
import erdantic as erd
|
||||
|
||||
from citation_fuzzy_match import QuestionAnswer
|
||||
|
||||
diagram = erd.create(QuestionAnswer)
|
||||
diagram.draw("examples/citation_fuzzy_match/schema.png")
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
@@ -0,0 +1,6 @@
|
||||
import erdantic as erd
|
||||
|
||||
from parse_recursive_paths import DirectoryTree
|
||||
|
||||
diagram = erd.create(DirectoryTree)
|
||||
diagram.draw("examples/parse_recursive_paths/schema.png")
|
||||
@@ -40,14 +40,15 @@ Example usage:
|
||||
# >>> root/folder2/subfolder1/file4.txt NodeType.FILE
|
||||
"""
|
||||
|
||||
import openai
|
||||
import enum
|
||||
|
||||
from pydantic import Field
|
||||
from typing import List
|
||||
from openai_function_call import OpenAISchema
|
||||
|
||||
import openai
|
||||
from pydantic import Field
|
||||
from tenacity import retry, stop_after_attempt
|
||||
|
||||
from openai_function_call import OpenAISchema
|
||||
|
||||
|
||||
class NodeType(str, enum.Enum):
|
||||
"""Enumeration representing the types of nodes in a filesystem."""
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 22 KiB |
@@ -0,0 +1,6 @@
|
||||
from erdantic import erd
|
||||
|
||||
from query_planner_execution import QueryPlan
|
||||
|
||||
diagram = erd.create(QueryPlan)
|
||||
diagram.draw("examples/query_planner_execution/schema.png")
|
||||
+4
-7
@@ -1,14 +1,11 @@
|
||||
from functools import lru_cache
|
||||
import openai
|
||||
import enum
|
||||
import json
|
||||
import asyncio
|
||||
import enum
|
||||
from typing import List
|
||||
|
||||
import openai
|
||||
from pydantic import Field
|
||||
from typing import List, Tuple
|
||||
|
||||
from openai_function_call import OpenAISchema
|
||||
from tenacity import retry, stop_after_attempt
|
||||
from pprint import pprint
|
||||
|
||||
|
||||
class QueryType(str, enum.Enum):
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 19 KiB |
@@ -0,0 +1,6 @@
|
||||
import erdantic as erd
|
||||
|
||||
from safe_sql import SQL
|
||||
|
||||
diagram = erd.create(SQL)
|
||||
diagram.draw("examples/safe_sql/schema.png")
|
||||
@@ -1,8 +1,10 @@
|
||||
from openai_function_call import OpenAISchema
|
||||
from pydantic import Field
|
||||
from typing import Any, List
|
||||
import openai
|
||||
import enum
|
||||
from typing import Any, List
|
||||
|
||||
import openai
|
||||
from pydantic import Field
|
||||
|
||||
from openai_function_call import OpenAISchema
|
||||
|
||||
|
||||
class SQLTemplateType(str, enum.Enum):
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 22 KiB |
@@ -0,0 +1,6 @@
|
||||
import erdantic as erd
|
||||
|
||||
from segment_search_queries import MultiSearch
|
||||
|
||||
diagram = erd.create(MultiSearch)
|
||||
diagram.draw("examples/segment_search_queries/schema.png")
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
+7
-5
@@ -16,12 +16,14 @@ Examples:
|
||||
# >>> Searching for `Documents` with query `GPDR policy` using `SearchType.EMAIL`
|
||||
"""
|
||||
|
||||
from openai_function_call import OpenAISchema
|
||||
from pydantic import Field
|
||||
from typing import List
|
||||
from tenacity import retry, stop_after_attempt
|
||||
import openai
|
||||
import enum
|
||||
from typing import List
|
||||
|
||||
import openai
|
||||
from pydantic import Field
|
||||
from tenacity import retry, stop_after_attempt
|
||||
|
||||
from openai_function_call import OpenAISchema
|
||||
|
||||
|
||||
class SearchType(str, enum.Enum):
|
||||
@@ -0,0 +1,6 @@
|
||||
import erdantic as erd
|
||||
|
||||
from task_planner_topological_sort import TaskPlan
|
||||
|
||||
diagram = erd.create(TaskPlan)
|
||||
diagram.draw("examples/task_planner_topological_sort/schema.png")
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
+4
-2
@@ -10,10 +10,12 @@ we will wait unnecessarily with my current implementation.
|
||||
Added by Jan Philipp Harries / @jpdus
|
||||
"""
|
||||
|
||||
import openai
|
||||
import asyncio
|
||||
from pydantic import Field, BaseModel
|
||||
from typing import List, Generator
|
||||
|
||||
import openai
|
||||
from pydantic import Field, BaseModel
|
||||
|
||||
from openai_function_call import OpenAISchema
|
||||
|
||||
|
||||
+3
-1
@@ -1,2 +1,4 @@
|
||||
openai
|
||||
pydantic
|
||||
pydantic
|
||||
pygraphviz
|
||||
erdantic
|
||||
Reference in New Issue
Block a user