API Reference¶
This document provides a reference for the WhyHow API.
All synchronous functions in WhyHow API have corresponding asynchronous counterparts. WhyHow client is essentially a thin wrapper around httpx, which provides flexibility for customization. Users should close the client when it's no longer needed, as outlined in the httpx documentation.
client
¶
Implementation of the client logic.
AsyncWhyHow
¶
AsyncWhyHow(api_key: str | None = None, base_url: str | None = None, httpx_kwargs: dict[str, Any] | None = None)
Asynchronous client for the WhyHow API.
Parameters:
-
api_key
(str
, default:None
) –The API key to use for authentication. If not provided, the WHYHOW_API_KEY environment variable will be used.
-
base_url
(str
, default:None
) –The base URL for the API.
-
httpx_kwargs
(dict
, default:None
) –Additional keyword arguments to pass to the httpx async client.
Attributes:
-
httpx_client
(AsyncClient
) –An async httpx client.
WhyHow
¶
WhyHow(api_key: str | None = None, base_url: str | None = None, httpx_kwargs: dict[str, Any] | None = None)
Synchronous client for the WhyHow API.
Parameters:
-
api_key
(str
, default:None
) –The API key to use for authentication. If not provided, the WHYHOW_API_KEY environment variable will be used.
-
base_url
(str
, default:None
) –The base URL for the API.
-
httpx_kwargs
(dict
, default:None
) –Additional keyword arguments to pass to the httpx client.
Attributes:
-
httpx_client
(Client
) –A synchronous httpx client.
resources
¶
Collection of route specific resources.
AsyncChunksResource
¶
Bases: AsyncResource
Chunk resource.
create
async
¶
get
async
¶
get(chunk_id: str, include_embeddings: bool | None = None) -> Chunk
Get chunk by ID.
Parameters:
-
chunk_id
(str
) –The ID of the chunk.
-
include_embeddings
(bool
, default:None
) –Whether to include embeddings.
Returns:
-
Chunk
–The chunk.
get_all
async
¶
get_all(limit: int = 10, workspace_id: str | None = None, workspace_name: str | None = None, document_id: str | None = None, document_filename: str | None = None, include_embeddings: bool | None = None) -> AsyncIterator[Chunk]
Get all chunks.
Parameters:
-
limit
(int
, default:10
) –The number of chunks to return.
-
workspace_id
(str
, default:None
) –The ID of the workspace.
-
workspace_name
(str
, default:None
) –The name of the workspace.
-
document_id
(str
, default:None
) –The ID of the document.
-
document_filename
(str
, default:None
) –The filename of the document.
-
include_embeddings
(bool
, default:None
) –Whether to include embeddings.
Returns:
-
AsyncIterator[Chunk]
–The chunk iterator.
Yields:
-
Chunk
–The chunk.
AsyncDocumentsResource
¶
Bases: AsyncResource
Async documents resource.
delete
async
¶
delete(document_id: str) -> Document
Delete a document.
Parameters:
-
document_id
(str
) –The document ID.
Returns:
-
Document
–The document.
Raises:
-
ValueError
–If the document is deleted but not returned.
get_all
async
¶
get_all(limit: int = 10, filename: str | None = None, workspace_id: str | None = None, workspace_name: str | None = None) -> AsyncIterator[Document]
Get all documents.
Parameters:
-
limit
(int
, default:10
) –The number of documents to return.
-
filename
(str
, default:None
) –The filename.
-
workspace_id
(str
, default:None
) –The workspace ID.
-
workspace_name
(str
, default:None
) –The workspace name.
Returns:
-
AsyncIterator[Document]
–The document iterator.
Yields:
-
Document
–The document.
upload
async
¶
upload(path: str | Path, workspace_id: str, max_seconds: int = 60, sleep_seconds: float = 1.5) -> Document
Upload a document.
Parameters:
-
path
(Path
) –The path to the document.
-
workspace_id
(str
) –The workspace ID.
-
max_seconds
(int
, default:60
) –The maximum number of seconds to wait for the document to be uploaded/processed.
-
sleep_seconds
(float
, default:1.5
) –The number of seconds to sleep between polling.
Returns:
-
Document
–The document.
Raises:
-
FileNotFoundError
–If the file is not found.
-
ValueError
–If the file format is not supported or the upload failed.
AsyncGraphsResource
¶
Bases: AsyncResource
Graph resources.
add_chunks
async
¶
add_chunks(graph_id: str, document_ids: list[str] | None = None, data_types: list[VALID_DATA_TYPE] | None = None, tags: list[str] | None = None, user_metadata: dict[str, Any] | None = None, ids: list[str] | None = None) -> Graph
Add chunks to a graph.
Parameters:
-
graph_id
(str
) –The ID of the graph.
-
document_ids
(list[str]
, default:None
) –The IDs of the documents.
-
data_types
(list[str]
, default:None
) –The data types. Possible values are "string" and "object".
-
tags
(list[str]
, default:None
) –The tags.
-
user_metadata
(dict[str, Any]
, default:None
) –The user metadata.
-
ids
(list[str]
, default:None
) –The IDs of the chunks.
Returns:
-
Graph
–The graph.
add_triples
async
¶
create
async
¶
create(name: str, workspace_id: str, schema_id: str, mode: CREATION_MODE = 'unstructured', document_ids: list[str] | None = None) -> Graph
Create a graph.
Parameters:
-
name
(str
) –The name of the graph.
-
workspace_id
(str
) –The ID of the workspace.
-
schema_id
(str
) –The ID of the schema.
-
mode
(Literal['unstructured', 'structured', 'mixed']
, default:'unstructured'
) –The creation mode.
-
document_ids
(list[str]
, default:None
) –The IDs of the documents.
Returns:
-
Graph
–The graph.
create_graph_from_graph_chunks
async
¶
create_graph_from_graph_chunks(name: str, workspace_id: str, graph_chunks: list[GraphChunk]) -> Graph
Create a graph from graph chunks.
Parameters:
-
name
(str
) –The name of the graph.
-
workspace_id
(str
) –The ID of the workspace.
-
graph_chunks
(list[GraphChunk]
) –The graph chunks.
Returns:
-
Graph
–The graph.
create_graph_from_triples
async
¶
export_cypher
async
¶
Export a graph to Cypher.
Parameters:
-
graph_id
(str
) –The ID of the graph.
Returns:
-
str
–The Cypher text.
get
async
¶
get(graph_id: str) -> Graph
Get a graph by its ID.
Parameters:
-
graph_id
(str
) –The ID of the graph.
Returns:
-
Graph
–The graph.
get_all
async
¶
get_all(limit: int = 10, name: str | None = None, workspace_id: str | None = None, workspace_name: str | None = None, schema_id: str | None = None, schema_name: str | None = None) -> AsyncIterator[Graph]
Get all graphs.
Parameters:
-
limit
(int
, default:10
) –The number of graphs to return.
-
name
(str
, default:None
) –The name of the graph.
-
workspace_id
(str
, default:None
) –The ID of the workspace.
-
workspace_name
(str
, default:None
) –The name of the workspace.
-
schema_id
(str
, default:None
) –The ID of the schema.
-
schema_name
(str
, default:None
) –The name of the schema.
Returns:
-
AsyncIterator[Graph]
–The graph iterator.
Yields:
-
Graph
–The graph.
query_structured
async
¶
query_structured(graph_id: str, entities: list[str] | None = None, relations: list[str] | None = None, values: list[str] | None = None) -> Query
Structured query.
query_unstructured
async
¶
query_unstructured(graph_id: str, query: str, return_answer: bool = True, include_chunks: bool = False) -> Query
Query an unstructured graph.
Parameters:
-
graph_id
(str
) –The ID of the graph.
-
query
(str
) –The query.
-
return_answer
(bool
, default:True
) –Whether to return the answer.
-
include_chunks
(bool
, default:False
) –Whether to include chunks.
Returns:
-
Query
–The query.
Raises:
-
ValueError
–If no queries are found in the response body.
update
async
¶
update(graph_id: str, name: str | None = None, public: bool | None = None) -> Graph
Update a graph.
Parameters:
-
graph_id
(str
) –The ID of the graph.
-
name
(str
, default:None
) –The name of the graph.
-
public
(bool
, default:None
) –Whether the graph is public.
Returns:
-
Graph
–The graph.
AsyncSchemasResource
¶
Bases: AsyncResource
Async schemas resource.
create
async
¶
create(name: str, workspace_id: str, entities: list[SchemaEntity], relations: list[SchemaRelation], patterns: list[SchemaTriplePattern]) -> Schema
Create a schema.
Parameters:
-
name
(str
) –The schema name.
-
workspace_id
(str
) –The workspace ID.
-
entities
(list[SchemaEntity]
) –The schema entities.
-
relations
(list[SchemaRelation]
) –The schema relations.
-
patterns
(list[TriplePattern]
) –The schema patterns.
Returns:
-
Schema
–The schema.
generate
async
¶
generate(questions: list[str]) -> tuple[list[SchemaEntity], list[SchemaRelation], list[SchemaTriplePattern]]
Generate a schema.
Parameters:
-
questions
(list[str]
) –The questions.
Returns:
-
entities
(list[SchemaEntity]
) –The schema entities.
-
relations
(list[SchemaRelation]
) –The schema relations.
-
patterns
(list[SchemaTriplePattern]
) –The schema patterns.
get_all
async
¶
get_all(limit: int = 10, workspace_id: str | None = None, workspace_name: str | None = None) -> AsyncIterator[Schema]
Get all schemas.
Parameters:
-
limit
(int
, default:10
) –The maximum number of schemas to fetch in one request.
-
workspace_id
(str
, default:None
) –The workspace ID.
-
workspace_name
(str
, default:None
) –The workspace name.
Returns:
-
AsyncIterator[Schema]
–The schema iterator.
Yields:
-
Schema
–A schema.
load_json
staticmethod
¶
load_json(file_path: str | Path) -> tuple[list[SchemaEntity], list[SchemaRelation], list[SchemaTriplePattern]]
Load a JSON file containing a schema.
Parameters:
-
file_path
(str | Path
) –The file path.
Returns:
-
list[SchemaEntity]
–The schema entities.
-
list[SchemaRelation]
–The schema relations.
-
list[SchemaTriplePattern]
–The schema patterns.
AsyncWorkspacesResource
¶
Bases: AsyncResource
Workspaces resource.
create
async
¶
create(name: str) -> Workspace
Create a workspace.
Parameters:
-
name
(str
) –The name of the workspace.
Returns:
-
Workspace
–The created workspace.
delete
async
¶
delete(workspace_id: str) -> Workspace
Delete a workspace.
Parameters:
-
workspace_id
(str
) –The workspace ID.
get
async
¶
get(workspace_id: str) -> Workspace
Get a workspaces.
Parameters:
-
workspace_id
(str
) –The workspace ID.
Returns:
-
Workspace
–The workspace.
get_all
async
¶
get_all(limit: int = 10, name: str | None = None) -> AsyncIterator[Workspace]
Iterate over all workspaces.
Parameters:
-
limit
(int
, default:10
) –The maximum number of workspaces to fetch in each request.
-
name
(str
, default:None
) –The name of the workspace to filter by.
Yields:
-
Workspace
–A workspace.
ChunksResource
¶
Bases: Resource
Chunk resource.
create
¶
get
¶
get(chunk_id: str, include_embeddings: bool | None = None) -> Chunk
Get chunk by ID.
Parameters:
-
chunk_id
(str
) –The ID of the chunk.
-
include_embeddings
(bool
, default:None
) –Whether to include embeddings.
Returns:
-
Chunk
–The chunk.
get_all
¶
get_all(limit: int = 10, workspace_id: str | None = None, workspace_name: str | None = None, document_id: str | None = None, document_filename: str | None = None, include_embeddings: bool | None = None) -> Iterator[Chunk]
Get all chunks.
Parameters:
-
limit
(int
, default:10
) –The number of chunks to return.
-
workspace_id
(str
, default:None
) –The ID of the workspace.
-
workspace_name
(str
, default:None
) –The name of the workspace.
-
document_id
(str
, default:None
) –The ID of the document.
-
document_filename
(str
, default:None
) –The filename of the document.
-
include_embeddings
(bool
, default:None
) –Whether to include embeddings.
Returns:
-
Iterator[Chunk]
–The chunk iterator.
Yields:
-
Chunk
–The chunk.
DocumentsResource
¶
Bases: Resource
Documents resource.
delete
¶
delete(document_id: str) -> Document
Delete a document.
Parameters:
-
document_id
(str
) –The document ID.
Returns:
-
Document
–The document.
Raises:
-
ValueError
–If the document is deleted but not returned.
get_all
¶
get_all(limit: int = 10, filename: str | None = None, workspace_id: str | None = None, workspace_name: str | None = None) -> Iterator[Document]
Get all documents.
Parameters:
-
limit
(int
, default:10
) –The number of documents to return.
-
filename
(str
, default:None
) –The filename.
-
workspace_id
(str
, default:None
) –The workspace ID.
-
workspace_name
(str
, default:None
) –The workspace name.
Returns:
-
Iterator[Document]
–The document iterator.
Yields:
-
Document
–The document.
upload
¶
upload(path: str | Path, workspace_id: str, max_seconds: int = 60, sleep_seconds: float = 1.5) -> Document
Upload a document.
Parameters:
-
path
(Path
) –The path to the document.
-
workspace_id
(str
) –The workspace ID.
-
max_seconds
(int
, default:60
) –The maximum number of seconds to wait for the document to be uploaded/processed.
-
sleep_seconds
(float
, default:1.5
) –The number of seconds to sleep between polling.
Returns:
-
Document
–The document.
Raises:
-
FileNotFoundError
–If the file is not found.
-
ValueError
–If the file format is not supported or the upload fails.
GraphsResource
¶
Bases: Resource
Graph resources.
add_chunks
¶
add_chunks(graph_id: str, document_ids: list[str] | None = None, data_types: list[VALID_DATA_TYPE] | None = None, tags: list[str] | None = None, user_metadata: dict[str, Any] | None = None, ids: list[str] | None = None) -> Graph
Add chunks to a graph.
Parameters:
-
graph_id
(str
) –The ID of the graph.
-
document_ids
(list[str]
, default:None
) –The IDs of the documents.
-
data_types
(list[str]
, default:None
) –The data types. Possible values are "string" and "object".
-
tags
(list[str]
, default:None
) –The tags.
-
user_metadata
(dict[str, Any]
, default:None
) –The user metadata.
-
ids
(list[str]
, default:None
) –The IDs of the chunks.
Returns:
-
Graph
–The graph.
add_triples
¶
create
¶
create(name: str, workspace_id: str, schema_id: str, mode: CREATION_MODE = 'unstructured', document_ids: list[str] | None = None) -> Graph
Create a graph.
Parameters:
-
name
(str
) –The name of the graph.
-
workspace_id
(str
) –The ID of the workspace.
-
schema_id
(str
) –The ID of the schema.
-
mode
(Literal['unstructured', 'structured', 'mixed']
, default:'unstructured'
) –The creation mode.
-
document_ids
(list[str]
, default:None
) –The IDs of the documents.
Returns:
-
Graph
–The graph.
create_graph_from_graph_chunks
¶
create_graph_from_graph_chunks(name: str, workspace_id: str, graph_chunks: list[GraphChunk]) -> Graph
Create a graph from graph chunks.
Parameters:
-
name
(str
) –The name of the graph.
-
workspace_id
(str
) –The ID of the workspace.
-
graph_chunks
(list[GraphChunk]
) –The graph chunks.
Returns:
-
Graph
–The graph.
create_graph_from_triples
¶
export_cypher
¶
Export a graph to Cypher.
Parameters:
-
graph_id
(str
) –The ID of the graph.
Returns:
-
str
–The Cypher text.
get
¶
get(graph_id: str) -> Graph
Get a graph by its ID.
Parameters:
-
graph_id
(str
) –The ID of the graph.
Returns:
-
Graph
–The graph.
get_all
¶
get_all(limit: int = 10, name: str | None = None, workspace_id: str | None = None, workspace_name: str | None = None, schema_id: str | None = None, schema_name: str | None = None) -> Iterator[Graph]
Get all graphs.
Parameters:
-
limit
(int
, default:10
) –The number of graphs to return.
-
name
(str
, default:None
) –The name of the graph.
-
workspace_id
(str
, default:None
) –The ID of the workspace.
-
workspace_name
(str
, default:None
) –The name of the workspace.
-
schema_id
(str
, default:None
) –The ID of the schema.
-
schema_name
(str
, default:None
) –The name of the schema.
Returns:
-
Iterator[Graph]
–The graph iterator.
Yields:
-
Graph
–The graph.
query_structured
¶
query_structured(graph_id: str, entities: list[str] | None = None, relations: list[str] | None = None, values: list[str] | None = None) -> Query
Structured query.
query_unstructured
¶
query_unstructured(graph_id: str, query: str, return_answer: bool = True, include_chunks: bool = False) -> Query
Unstructured query.
Parameters:
-
graph_id
(str
) –The ID of the graph.
-
query
(str
) –The query.
-
return_answer
(bool
, default:True
) –Whether to return the answer.
-
include_chunks
(bool
, default:False
) –Whether to include chunks.
Returns:
-
Query
–The query.
Raises:
-
ValueError
–If no queries are found in the response body.
SchemasResource
¶
Bases: Resource
Schemas resource.
create
¶
create(name: str, workspace_id: str, entities: list[SchemaEntity], relations: list[SchemaRelation], patterns: list[SchemaTriplePattern]) -> Schema
Create a schema.
Parameters:
-
name
(str
) –The schema name.
-
workspace_id
(str
) –The workspace ID.
-
entities
(list[SchemaEntity]
) –The schema entities.
-
relations
(list[SchemaRelation]
) –The schema relations.
-
patterns
(list[TriplePattern]
) –The schema patterns.
Returns:
-
Schema
–The schema.
generate
¶
generate(questions: list[str]) -> tuple[list[SchemaEntity], list[SchemaRelation], list[SchemaTriplePattern]]
Generate a schema.
Parameters:
-
questions
(list[str]
) –The questions.
Returns:
-
entities
(list[SchemaEntity]
) –The schema entities.
-
relations
(list[SchemaRelation]
) –The schema relations.
-
patterns
(list[SchemaTriplePattern]
) –The schema patterns.
get_all
¶
get_all(limit: int = 10, workspace_id: str | None = None, workspace_name: str | None = None) -> Iterator[Schema]
Get all schemas.
Parameters:
-
limit
(int
, default:10
) –The maximum number of schemas to fetch in one request.
-
workspace_id
(str
, default:None
) –The workspace ID.
-
workspace_name
(str
, default:None
) –The workspace name.
Returns:
-
Iterator[Schema]
–The schema iterator.
Yields:
-
Schema
–A schema.
load_json
staticmethod
¶
load_json(file_path: str | Path) -> tuple[list[SchemaEntity], list[SchemaRelation], list[SchemaTriplePattern]]
Load a JSON file containing a schema.
Parameters:
-
file_path
(str | Path
) –The file path.
Returns:
-
list[SchemaEntity]
–The schema entities.
-
list[SchemaRelation]
–The schema relations.
-
list[SchemaTriplePattern]
–The schema patterns.
WorkspacesResource
¶
Bases: Resource
Workspaces resource.
create
¶
create(name: str) -> Workspace
Create a workspace.
Parameters:
-
name
(str
) –The name of the workspace.
Returns:
-
Workspace
–The created workspace.
delete
¶
delete(workspace_id: str) -> Workspace
Delete a workspace.
Parameters:
-
workspace_id
(str
) –The workspace ID.
get
¶
get(workspace_id: str) -> Workspace
Get a workspaces.
Parameters:
-
workspace_id
(str
) –The workspace ID.
Returns:
-
Workspace
–The workspace.
get_all
¶
get_all(limit: int = 10, name: str | None = None) -> Iterator[Workspace]
Iterate over all workspaces.
Parameters:
-
limit
(int
, default:10
) –The maximum number of workspaces to fetch in each request.
-
name
(str
, default:None
) –The name of the workspace to filter by.
Yields:
-
Workspace
–A workspace.
schemas
¶
User facing pyndantic models.
Chunk
¶
Bases: BaseModel
Chunk model.
Attributes:
-
chunk_id
(str | None
) –The chunk ID.
-
created_at
(datetime | None
) –The creation datetime.
-
updated_at
(datetime | None
) –The update datetime.
-
document_id
(str | None
) –The document ID.
-
workspace_ids
(list[str] | None
) –The workspace IDs.
-
metadata
(ChunkMetadata | None
) –The chunk metadata.
-
content
(str | dict[str, Any]
) –The chunk content.
-
embedding
(list[float] | None
) –The chunk embedding.
-
tags
(dict[str, list[str]] | list[str]
) –The chunk tags.
-
user_metadata
(dict[str, Any]
) –The chunk user metadata.
ChunkMetadata
¶
Bases: BaseModel
Chunk metadata model.
Attributes:
-
language
((str, optional)
) –The chunk language.
-
length
((int, optional)
) –The chunk length.
-
size
((int, optional)
) –The chunk size.
-
data_source_type
((str, optional)
) –The chunk data source type.
-
index
((int, optional)
) –The chunk index.
-
page
((int, optional)
) –The chunk page.
-
start
((int, optional)
) –The chunk start.
-
end
((int, optional)
) –The chunk end.
Document
¶
Bases: BaseModel
Document model.
Attributes:
-
document_id
(str
) –The document ID.
-
created_at
((datetime, optional)
) –The creation datetime.
-
updated_at
((datetime, optional)
) –The update datetime.
-
workspace_ids
(list[str]
) –The workspace IDs.
-
metadata
(DocumentMetadata
) –The document metadata.
-
status
(str
) –The document status.
-
tags
((dict[str, Any], optional)
) –The document tags.
-
user_metadata
((dict[str, Any], optional)
) –The document user metadata.
DocumentMetadata
¶
Bases: BaseModel
Document metadata model.
Attributes:
-
size
(int
) –The document size.
-
format
(str
) –The document format.
-
filename
(str
) –The document filename.
Graph
¶
Bases: BaseModel
Graph model.
Attributes:
-
graph_id
(str
) –The graph ID.
-
name
(str
) –The graph name.
-
workspace_id
(str
) –The workspace ID.
-
created_at
((datetime, optional)
) –The creation datetime.
-
updated_at
((datetime, optional)
) –The update datetime.
-
schema_id
((str, optional)
) –The schema ID.
-
status
(str
) –The graph status.
-
errors
((list[GraphErrorDetails], optional)
) –The graph errors.
-
public
((bool, optional)
) –The graph public status.
GraphChunk
¶
GraphErrorDetails
¶
Bases: BaseModel
Graph error details model.
Attributes:
-
message
(str
) –The error message.
-
created_at
((datetime, optional)
) –The creation datetime.
-
level
(str
) –The error level.
Node
¶
Bases: BaseModel
Node model.
Attributes:
-
node_id
(str
) –The node ID. It can be None since we allow for the user to also create nodes and only then send them to the server (that will generate the node ID).
-
label
(str
) –The node label.
-
name
(str
) –The node name.
-
chunk_ids
((list[str], optional)
) –The chunk IDs.
-
properties
((dict[str, Any], optional)
) –The node properties.
-
created_at
((datetime, optional)
) –The creation datetime.
-
updated_at
((datetime, optional)
) –The update datetime.
Query
¶
Bases: BaseModel
Query model.
Attributes:
-
query_id
(str
) –The query ID.
-
graph_id
(str
) –The graph ID.
-
answer
((str, optional)
) –The query answer.
-
status
(str
) –The query status.
-
nodes
(list[Node]
) –The query nodes.
-
triples
(list[Triple]
) –The query triples.
-
created_at
((datetime, optional)
) –The creation datetime.
-
updated_at
((datetime, optional)
) –The update datetime.
Relation
¶
Bases: BaseModel
Relation model.
Attributes:
-
name
(str
) –The relation name.
-
properties
((dict[str, Any], optional)
) –The relation properties.
Schema
¶
Bases: BaseModel
Schema model.
Attributes:
-
schema_id
(str
) –The schema ID.
-
name
(str
) –The schema name.
-
entities
(list[SchemaEntity]
) –The schema entities.
-
relations
(list[SchemaRelation]
) –The schema relations.
-
patterns
(list[SchemaTriplePattern]
) –The schema patterns.
-
workspace_id
(str
) –The workspace ID.
-
created_at
((datetime, optional)
) –The creation datetime.
-
updated_at
((datetime, optional)
) –The update datetime.
SchemaEntity
¶
Bases: BaseModel
Entity model.
Attributes:
-
name
(str
) –The entity name.
-
description
((str, optional)
) –The entity description.
-
fields
((list[SchemaEntityField], optional)
) –The entity fields.
SchemaEntityField
¶
Bases: BaseModel
Entity field model.
Attributes:
-
name
(str
) –The field name.
-
properties
((list[str], optional)
) –The field properties.
SchemaRelation
¶
Bases: BaseModel
Relation model.
Attributes:
-
name
(str
) –The relation name.
-
description
((str, optional)
) –The relation description.
SchemaTriplePattern
¶
Bases: BaseModel
Triple pattern model.
Attributes:
-
head
(SchemaEntity
) –The head entity.
-
relation
(SchemaRelation
) –The relation.
-
tail
(SchemaEntity
) –The tail entity.
-
description
(str
) –The triple description.
Task
¶
Bases: BaseModel
Task model.
Attributes:
-
task_id
((str | None, optional)
) –The task ID.
-
start_time
((datetime | None, optional)
) –The start time of the task.
-
end_time
((datetime | None, optional)
) –The end time of the task.
-
status
(str
) –The status of the task.
-
result
((str | None, optional)
) –The result of the task.
Triple
¶
Bases: BaseModel
Triple model.
Attributes:
-
triple_id
((str, optional)
) –The triple ID. It can be None since we allow for the user to also create triples and only then send them to the server (that will generate the triple ID).
-
head
(Node
) –The head node.
-
tail
(Node
) –The tail node.
-
relation
(Relation
) –The relation.
-
chunk_ids
((list[str], optional)
) –The chunk IDs.
-
created_at
((datetime, optional)
) –The creation datetime.
-
updated_at
((datetime, optional)
) –The update datetime.
Workspace
¶
Bases: BaseModel
Workspace model.
Attributes:
-
workspace_id
(str
) –The workspace ID.
-
name
(str
) –The workspace name.
-
created_at
((datetime, optional)
) –The creation datetime.
-
updated_at
((datetime, optional)
) –The update datetime.