mirror of
https://github.com/langgenius/dify.git
synced 2026-05-25 19:00:43 -04:00
chore(api): upgrade graphon to 0.4.0 (#36124)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: QuantumGhost <obelisk.reg+git@gmail.com>
This commit is contained in:
@@ -10,7 +10,7 @@ from graphon.entities import WorkflowStartReason
|
||||
from graphon.entities.pause_reason import PauseReasonType
|
||||
from graphon.enums import WorkflowExecutionStatus, WorkflowNodeExecutionMetadataKey, WorkflowNodeExecutionStatus
|
||||
from graphon.model_runtime.entities.llm_entities import LLMResult, LLMUsage
|
||||
from graphon.nodes.human_input.entities import FormInput, UserAction
|
||||
from graphon.nodes.human_input.entities import FormInputConfig, UserActionConfig
|
||||
|
||||
|
||||
class AnnotationReplyAccount(BaseModel):
|
||||
@@ -284,8 +284,8 @@ class HumanInputRequiredResponse(StreamResponse):
|
||||
node_id: str
|
||||
node_title: str
|
||||
form_content: str
|
||||
inputs: Sequence[FormInput] = Field(default_factory=list)
|
||||
actions: Sequence[UserAction] = Field(default_factory=list)
|
||||
inputs: Sequence[FormInputConfig] = Field(default_factory=list)
|
||||
actions: Sequence[UserActionConfig] = Field(default_factory=list)
|
||||
display_in_ui: bool = False
|
||||
form_token: str | None = None
|
||||
resolved_default_values: Mapping[str, Any] = Field(default_factory=dict)
|
||||
@@ -307,8 +307,8 @@ class HumanInputRequiredPauseReasonPayload(BaseModel):
|
||||
node_id: str
|
||||
node_title: str
|
||||
form_content: str
|
||||
inputs: Sequence[FormInput] = Field(default_factory=list)
|
||||
actions: Sequence[UserAction] = Field(default_factory=list)
|
||||
inputs: Sequence[FormInputConfig] = Field(default_factory=list)
|
||||
actions: Sequence[UserActionConfig] = Field(default_factory=list)
|
||||
display_in_ui: bool = False
|
||||
form_token: str | None = None
|
||||
resolved_default_values: Mapping[str, Any] = Field(default_factory=dict)
|
||||
|
||||
@@ -5,7 +5,7 @@ from typing import Any, TypeAlias
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field
|
||||
|
||||
from graphon.nodes.human_input.entities import FormInput, UserAction
|
||||
from graphon.nodes.human_input.entities import FormInputConfig, UserActionConfig
|
||||
from models.execution_extra_content import ExecutionContentType
|
||||
|
||||
|
||||
@@ -16,8 +16,8 @@ class HumanInputFormDefinition(BaseModel):
|
||||
node_id: str
|
||||
node_title: str
|
||||
form_content: str
|
||||
inputs: Sequence[FormInput] = Field(default_factory=list)
|
||||
actions: Sequence[UserAction] = Field(default_factory=list)
|
||||
inputs: Sequence[FormInputConfig] = Field(default_factory=list)
|
||||
actions: Sequence[UserActionConfig] = Field(default_factory=list)
|
||||
display_in_ui: bool = False
|
||||
form_token: str | None = None
|
||||
resolved_default_values: Mapping[str, Any] = Field(default_factory=dict)
|
||||
|
||||
@@ -47,7 +47,7 @@ from graphon.graph.graph import NodeFactory
|
||||
from graphon.model_runtime.memory import PromptMessageMemory
|
||||
from graphon.model_runtime.model_providers.base.large_language_model import LargeLanguageModel
|
||||
from graphon.nodes.base.node import Node
|
||||
from graphon.nodes.code.code_node import WorkflowCodeExecutor
|
||||
from graphon.nodes.code.code_node import CodeExecutorProtocol
|
||||
from graphon.nodes.code.entities import CodeLanguage
|
||||
from graphon.nodes.code.limits import CodeNodeLimits
|
||||
from graphon.nodes.document_extractor import UnstructuredApiConfig
|
||||
@@ -289,7 +289,7 @@ class DifyNodeFactory(NodeFactory):
|
||||
self.graph_init_params = graph_init_params
|
||||
self.graph_runtime_state = graph_runtime_state
|
||||
self._dify_context = self._resolve_dify_context(graph_init_params.run_context)
|
||||
self._code_executor: WorkflowCodeExecutor = DefaultWorkflowCodeExecutor()
|
||||
self._code_executor: CodeExecutorProtocol = DefaultWorkflowCodeExecutor()
|
||||
self._code_limits = CodeNodeLimits(
|
||||
max_string_length=dify_config.CODE_MAX_STRING_LENGTH,
|
||||
max_number=dify_config.CODE_MAX_NUMBER,
|
||||
@@ -397,6 +397,7 @@ class DifyNodeFactory(NodeFactory):
|
||||
},
|
||||
BuiltinNodeTypes.HUMAN_INPUT: lambda: {
|
||||
"runtime": self._human_input_runtime,
|
||||
"file_reference_factory": self._file_reference_factory,
|
||||
"form_repository": self._human_input_runtime.build_form_repository(),
|
||||
},
|
||||
BuiltinNodeTypes.LLM: lambda: self._build_llm_compatible_node_init_kwargs(
|
||||
@@ -434,7 +435,7 @@ class DifyNodeFactory(NodeFactory):
|
||||
include_jinja2_template_renderer=False,
|
||||
),
|
||||
BuiltinNodeTypes.TOOL: lambda: {
|
||||
"tool_file_manager_factory": self._bound_tool_file_manager_factory(),
|
||||
"tool_file_manager": self._bound_tool_file_manager_factory(),
|
||||
"runtime": self._tool_runtime,
|
||||
},
|
||||
BuiltinNodeTypes.AGENT: lambda: {
|
||||
|
||||
@@ -49,7 +49,7 @@ from graphon.model_runtime.entities.model_entities import AIModelEntity
|
||||
from graphon.model_runtime.model_providers.base.large_language_model import LargeLanguageModel
|
||||
from graphon.nodes.human_input.entities import HumanInputNodeData
|
||||
from graphon.nodes.llm.runtime_protocols import (
|
||||
PreparedLLMProtocol,
|
||||
LLMProtocol,
|
||||
PromptMessageSerializerProtocol,
|
||||
RetrieverAttachmentLoaderProtocol,
|
||||
)
|
||||
@@ -140,7 +140,7 @@ class DifyFileReferenceFactory(FileReferenceFactoryProtocol):
|
||||
)
|
||||
|
||||
|
||||
class DifyPreparedLLM(PreparedLLMProtocol):
|
||||
class DifyPreparedLLM(LLMProtocol):
|
||||
"""Workflow-layer adapter that hides the full `ModelInstance` API from `graphon` nodes."""
|
||||
|
||||
def __init__(self, model_instance: ModelInstance) -> None:
|
||||
|
||||
@@ -8,6 +8,7 @@ OpenAPI output early.
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import json
|
||||
import logging
|
||||
import subprocess
|
||||
import sys
|
||||
@@ -28,6 +29,125 @@ CONSOLE_SWAGGER_FILENAME = "console-swagger.json"
|
||||
STALE_COMBINED_MARKDOWN_FILENAME = "api-reference.md"
|
||||
|
||||
|
||||
def _definition_ref_name(schema: object) -> str | None:
|
||||
if not isinstance(schema, dict):
|
||||
return None
|
||||
|
||||
ref = schema.get("$ref")
|
||||
if not isinstance(ref, str) or not ref.startswith("#/definitions/"):
|
||||
return None
|
||||
|
||||
return ref.removeprefix("#/definitions/")
|
||||
|
||||
|
||||
def _markdown_anchor(name: str) -> str:
|
||||
return name.lower()
|
||||
|
||||
|
||||
def _schema_markdown_type(schema: object) -> str:
|
||||
if not isinstance(schema, dict):
|
||||
return ""
|
||||
|
||||
ref_name = _definition_ref_name(schema)
|
||||
if ref_name is not None:
|
||||
return f"[{ref_name}](#{_markdown_anchor(ref_name)})"
|
||||
|
||||
for union_key in ("oneOf", "anyOf"):
|
||||
variants = schema.get(union_key)
|
||||
if not isinstance(variants, list):
|
||||
continue
|
||||
|
||||
variant_types = [
|
||||
variant_type
|
||||
for variant in variants
|
||||
if not (isinstance(variant, dict) and variant.get("type") == "null")
|
||||
for variant_type in [_schema_markdown_type(variant)]
|
||||
if variant_type
|
||||
]
|
||||
if len(variant_types) == 1:
|
||||
return variant_types[0]
|
||||
if variant_types:
|
||||
return "<br>".join(variant_types)
|
||||
|
||||
schema_type = schema.get("type")
|
||||
if schema_type == "array":
|
||||
item_type = _schema_markdown_type(schema.get("items"))
|
||||
return f"[ {item_type or 'object'} ]"
|
||||
if isinstance(schema_type, str):
|
||||
return schema_type
|
||||
|
||||
return ""
|
||||
|
||||
|
||||
def _replace_schema_table_type(markdown: str, definition_name: str, row_name: str, type_markdown: str) -> str:
|
||||
if not type_markdown:
|
||||
return markdown
|
||||
|
||||
lines = markdown.splitlines()
|
||||
section_header = f"#### {definition_name}"
|
||||
in_section = False
|
||||
|
||||
for index, line in enumerate(lines):
|
||||
if line == section_header:
|
||||
in_section = True
|
||||
continue
|
||||
if in_section and line.startswith("#### "):
|
||||
break
|
||||
if not in_section or not line.startswith(f"| {row_name} |"):
|
||||
continue
|
||||
|
||||
cells = line.split("|")
|
||||
if len(cells) < 5:
|
||||
continue
|
||||
cells[2] = f" {type_markdown} "
|
||||
lines[index] = "|".join(cells)
|
||||
break
|
||||
|
||||
return "\n".join(lines)
|
||||
|
||||
|
||||
def _patch_union_schema_markdown(markdown: str, spec_path: Path) -> str:
|
||||
"""Fill Swagger Markdown table cells that `swagger-markdown` leaves blank for union schemas."""
|
||||
|
||||
spec = json.loads(spec_path.read_text(encoding="utf-8"))
|
||||
definitions = spec.get("definitions")
|
||||
if not isinstance(definitions, dict):
|
||||
return markdown
|
||||
|
||||
for definition_name, schema in definitions.items():
|
||||
if not isinstance(definition_name, str) or not isinstance(schema, dict):
|
||||
continue
|
||||
one_of = schema.get("oneOf")
|
||||
if not isinstance(one_of, list):
|
||||
continue
|
||||
|
||||
markdown = _replace_schema_table_type(
|
||||
markdown,
|
||||
definition_name,
|
||||
definition_name,
|
||||
_schema_markdown_type(schema),
|
||||
)
|
||||
|
||||
for variant in one_of:
|
||||
variant_name = _definition_ref_name(variant)
|
||||
variant_schema = definitions.get(variant_name) if variant_name is not None else None
|
||||
if not isinstance(variant_name, str) or not isinstance(variant_schema, dict):
|
||||
continue
|
||||
properties = variant_schema.get("properties")
|
||||
if not isinstance(properties, dict):
|
||||
continue
|
||||
for property_name, property_schema in properties.items():
|
||||
if isinstance(property_name, str):
|
||||
markdown = _replace_schema_table_type(
|
||||
markdown,
|
||||
variant_name,
|
||||
property_name,
|
||||
_schema_markdown_type(property_schema),
|
||||
)
|
||||
|
||||
return markdown
|
||||
|
||||
|
||||
def _convert_spec_to_markdown(spec_path: Path, markdown_path: Path) -> None:
|
||||
markdown_path.parent.mkdir(parents=True, exist_ok=True)
|
||||
with tempfile.TemporaryDirectory(prefix=f"{markdown_path.stem}-", dir=markdown_path.parent) as temp_dir:
|
||||
@@ -57,7 +177,10 @@ def _convert_spec_to_markdown(spec_path: Path, markdown_path: Path) -> None:
|
||||
converter_output = "\n".join(item for item in (result.stdout, result.stderr) if item).strip()
|
||||
raise RuntimeError(f"swagger-markdown did not write {markdown_path}: {converter_output}")
|
||||
|
||||
converted_markdown = temp_markdown_path.read_text(encoding="utf-8")
|
||||
converted_markdown = _patch_union_schema_markdown(
|
||||
temp_markdown_path.read_text(encoding="utf-8"),
|
||||
spec_path,
|
||||
)
|
||||
if not converted_markdown.strip():
|
||||
raise RuntimeError(f"swagger-markdown wrote an empty document for {markdown_path}")
|
||||
|
||||
|
||||
@@ -11805,6 +11805,27 @@ Request payload for bulk downloading documents as a zip archive.
|
||||
| ---- | ---- | ----------- | -------- |
|
||||
| file_ids | [ string ] | | Yes |
|
||||
|
||||
#### FileInputConfig
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
| ---- | ---- | ----------- | -------- |
|
||||
| allowed_file_extensions | [ string ] | | No |
|
||||
| allowed_file_types | [ [FileType](#filetype) ] | | No |
|
||||
| allowed_file_upload_methods | [ [FileTransferMethod](#filetransfermethod) ] | | No |
|
||||
| output_variable_name | string | | Yes |
|
||||
| type | string | | No |
|
||||
|
||||
#### FileListInputConfig
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
| ---- | ---- | ----------- | -------- |
|
||||
| allowed_file_extensions | [ string ] | | No |
|
||||
| allowed_file_types | [ [FileType](#filetype) ] | | No |
|
||||
| allowed_file_upload_methods | [ [FileTransferMethod](#filetransfermethod) ] | | No |
|
||||
| number_limits | integer | | No |
|
||||
| output_variable_name | string | | Yes |
|
||||
| type | string | | No |
|
||||
|
||||
#### FileResponse
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
@@ -11824,6 +11845,18 @@ Request payload for bulk downloading documents as a zip archive.
|
||||
| tenant_id | string | | No |
|
||||
| user_id | string | | No |
|
||||
|
||||
#### FileTransferMethod
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
| ---- | ---- | ----------- | -------- |
|
||||
| FileTransferMethod | string | | |
|
||||
|
||||
#### FileType
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
| ---- | ---- | ----------- | -------- |
|
||||
| FileType | string | | |
|
||||
|
||||
#### ForgotPasswordCheckPayload
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
@@ -11869,33 +11902,11 @@ Request payload for bulk downloading documents as a zip archive.
|
||||
| email | string | | Yes |
|
||||
| language | string | | No |
|
||||
|
||||
#### FormInput
|
||||
|
||||
Form input definition.
|
||||
#### FormInputConfig
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
| ---- | ---- | ----------- | -------- |
|
||||
| default | [FormInputDefault](#forminputdefault) | | No |
|
||||
| output_variable_name | string | | Yes |
|
||||
| type | [FormInputType](#forminputtype) | | Yes |
|
||||
|
||||
#### FormInputDefault
|
||||
|
||||
Default configuration for form inputs.
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
| ---- | ---- | ----------- | -------- |
|
||||
| selector | [ string ] | | No |
|
||||
| type | [PlaceholderType](#placeholdertype) | | Yes |
|
||||
| value | string | | No |
|
||||
|
||||
#### FormInputType
|
||||
|
||||
Form input types.
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
| ---- | ---- | ----------- | -------- |
|
||||
| FormInputType | string | Form input types. | |
|
||||
| FormInputConfig | [ParagraphInputConfig](#paragraphinputconfig)<br>[SelectInputConfig](#selectinputconfig)<br>[FileInputConfig](#fileinputconfig)<br>[FileListInputConfig](#filelistinputconfig) | | |
|
||||
|
||||
#### GenerateSummaryPayload
|
||||
|
||||
@@ -12018,13 +12029,13 @@ Form input types.
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
| ---- | ---- | ----------- | -------- |
|
||||
| actions | [ [UserAction](#useraction) ] | | No |
|
||||
| actions | [ [UserActionConfig](#useractionconfig) ] | | No |
|
||||
| display_in_ui | boolean | | No |
|
||||
| expiration_time | integer | | Yes |
|
||||
| form_content | string | | Yes |
|
||||
| form_id | string | | Yes |
|
||||
| form_token | string | | No |
|
||||
| inputs | [ [FormInput](#forminput) ] | | No |
|
||||
| inputs | [ [FormInputConfig](#forminputconfig) ] | | No |
|
||||
| node_id | string | | Yes |
|
||||
| node_title | string | | Yes |
|
||||
| resolved_default_values | object | | No |
|
||||
@@ -12662,6 +12673,16 @@ Enum class for model type.
|
||||
| page | integer | | Yes |
|
||||
| total | integer | | Yes |
|
||||
|
||||
#### ParagraphInputConfig
|
||||
|
||||
Form input definition.
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
| ---- | ---- | ----------- | -------- |
|
||||
| default | [StringSource](#stringsource) | | No |
|
||||
| output_variable_name | string | | Yes |
|
||||
| type | string | | No |
|
||||
|
||||
#### Parser
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
@@ -12991,14 +13012,6 @@ Enum class for model type.
|
||||
| unit | string | | No |
|
||||
| variable | string | | No |
|
||||
|
||||
#### PlaceholderType
|
||||
|
||||
Default value types for form inputs.
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
| ---- | ---- | ----------- | -------- |
|
||||
| PlaceholderType | string | Default value types for form inputs. | |
|
||||
|
||||
#### PluginAutoUpgradeSettingsPayload
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
@@ -13279,6 +13292,14 @@ Default value types for form inputs.
|
||||
| max_tokens | integer | | Yes |
|
||||
| separator | string | | No |
|
||||
|
||||
#### SelectInputConfig
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
| ---- | ---- | ----------- | -------- |
|
||||
| option_source | [StringListSource](#stringlistsource) | | Yes |
|
||||
| output_variable_name | string | | Yes |
|
||||
| type | string | | No |
|
||||
|
||||
#### SimpleAccount
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
@@ -13361,6 +13382,24 @@ Default value types for form inputs.
|
||||
| ---- | ---- | ----------- | -------- |
|
||||
| StrategySetting | string | | |
|
||||
|
||||
#### StringListSource
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
| ---- | ---- | ----------- | -------- |
|
||||
| selector | [ string ] | | No |
|
||||
| type | [ValueSourceType](#valuesourcetype) | | Yes |
|
||||
| value | [ string ] | | No |
|
||||
|
||||
#### StringSource
|
||||
|
||||
Default configuration for form inputs.
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
| ---- | ---- | ----------- | -------- |
|
||||
| selector | [ string ] | | No |
|
||||
| type | [ValueSourceType](#valuesourcetype) | | Yes |
|
||||
| value | string | | No |
|
||||
|
||||
#### SubscriptionQuery
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
@@ -13792,7 +13831,7 @@ Tag type
|
||||
| video_file_size_limit | integer | | Yes |
|
||||
| workflow_file_upload_limit | integer | | Yes |
|
||||
|
||||
#### UserAction
|
||||
#### UserActionConfig
|
||||
|
||||
User action configuration.
|
||||
|
||||
@@ -13802,6 +13841,15 @@ User action configuration.
|
||||
| id | string | | Yes |
|
||||
| title | string | | Yes |
|
||||
|
||||
#### ValueSourceType
|
||||
|
||||
ValueSourceType records whether the value comes from a static setting
|
||||
in form definiton, or a variable while the workflow is running.
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
| ---- | ---- | ----------- | -------- |
|
||||
| ValueSourceType | string | ValueSourceType records whether the value comes from a static setting in form definiton, or a variable while the workflow is running. | |
|
||||
|
||||
#### WebhookTriggerResponse
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|
||||
@@ -43,7 +43,7 @@ dependencies = [
|
||||
"resend>=2.27.0,<3.0.0",
|
||||
# Emerging: newer and fast-moving, use compatible pins
|
||||
"fastopenapi[flask]~=0.7.0",
|
||||
"graphon~=0.3.1",
|
||||
"graphon~=0.4.0",
|
||||
"httpx-sse~=0.4.0",
|
||||
"json-repair~=0.59.4",
|
||||
]
|
||||
|
||||
@@ -29,7 +29,11 @@ from core.workflow.node_factory import (
|
||||
get_node_type_classes_mapping,
|
||||
is_start_node_type,
|
||||
)
|
||||
from core.workflow.node_runtime import DifyHumanInputNodeRuntime, apply_dify_debug_email_recipient
|
||||
from core.workflow.node_runtime import (
|
||||
DifyFileReferenceFactory,
|
||||
DifyHumanInputNodeRuntime,
|
||||
apply_dify_debug_email_recipient,
|
||||
)
|
||||
from core.workflow.system_variables import build_bootstrap_variables, build_system_variables, default_system_variables
|
||||
from core.workflow.variable_pool_initializer import add_node_inputs_to_pool, add_variables_to_pool
|
||||
from core.workflow.workflow_entry import WorkflowEntry
|
||||
@@ -1259,6 +1263,7 @@ class WorkflowService:
|
||||
data=node_data,
|
||||
graph_init_params=graph_init_params,
|
||||
graph_runtime_state=graph_runtime_state,
|
||||
file_reference_factory=DifyFileReferenceFactory(graph_init_params.run_context),
|
||||
runtime=DifyHumanInputNodeRuntime(run_context),
|
||||
)
|
||||
return node
|
||||
|
||||
@@ -60,14 +60,14 @@ def init_tool_node(config: dict):
|
||||
|
||||
graph = Graph.init(graph_config=graph_config, node_factory=node_factory, root_node_id="start")
|
||||
|
||||
tool_file_manager_factory = MagicMock(spec=ToolFileManagerProtocol)
|
||||
tool_file_manager = MagicMock(spec=ToolFileManagerProtocol)
|
||||
|
||||
node = ToolNode(
|
||||
node_id=str(uuid.uuid4()),
|
||||
data=ToolNodeData.model_validate(config["data"]),
|
||||
graph_init_params=init_params,
|
||||
graph_runtime_state=graph_runtime_state,
|
||||
tool_file_manager_factory=tool_file_manager_factory,
|
||||
tool_file_manager=tool_file_manager,
|
||||
runtime=DifyToolNodeRuntime(init_params.run_context),
|
||||
)
|
||||
return node
|
||||
|
||||
@@ -17,7 +17,7 @@ from core.workflow.human_input_adapter import (
|
||||
MemberRecipient,
|
||||
WebAppDeliveryMethod,
|
||||
)
|
||||
from graphon.nodes.human_input.entities import FormDefinition, HumanInputNodeData, UserAction
|
||||
from graphon.nodes.human_input.entities import FormDefinition, HumanInputNodeData, UserActionConfig
|
||||
from models.account import (
|
||||
Account,
|
||||
AccountStatus,
|
||||
@@ -69,7 +69,7 @@ def _build_form_params(delivery_methods: list[DeliveryChannelConfig]) -> FormCre
|
||||
title="Human Approval",
|
||||
delivery_methods=delivery_methods,
|
||||
form_content="<p>Approve?</p>",
|
||||
user_actions=[UserAction(id="approve", title="Approve")],
|
||||
user_actions=[UserActionConfig(id="approve", title="Approve")],
|
||||
)
|
||||
return FormCreateParams(
|
||||
workflow_execution_id=str(uuid4()),
|
||||
@@ -185,7 +185,7 @@ class TestHumanInputFormRepositoryImplWithContainers:
|
||||
title="Human Approval",
|
||||
form_content="<p>Approve?</p>",
|
||||
inputs=[],
|
||||
user_actions=[UserAction(id="approve", title="Approve")],
|
||||
user_actions=[UserActionConfig(id="approve", title="Approve")],
|
||||
),
|
||||
rendered_content="<p>Approve?</p>",
|
||||
delivery_methods=[],
|
||||
@@ -220,7 +220,7 @@ class TestHumanInputFormRepositoryImplWithContainers:
|
||||
title="Human Approval",
|
||||
form_content="<p>Approve?</p>",
|
||||
inputs=[],
|
||||
user_actions=[UserAction(id="approve", title="Approve")],
|
||||
user_actions=[UserActionConfig(id="approve", title="Approve")],
|
||||
delivery_methods=[WebAppDeliveryMethod()],
|
||||
),
|
||||
rendered_content="<p>Approve?</p>",
|
||||
|
||||
@@ -13,7 +13,7 @@ from core.app.workflow.layers import PersistenceWorkflowInfo, WorkflowPersistenc
|
||||
from core.repositories.human_input_repository import HumanInputFormEntity, HumanInputFormRepository
|
||||
from core.repositories.sqlalchemy_workflow_execution_repository import SQLAlchemyWorkflowExecutionRepository
|
||||
from core.repositories.sqlalchemy_workflow_node_execution_repository import SQLAlchemyWorkflowNodeExecutionRepository
|
||||
from core.workflow.node_runtime import DifyHumanInputNodeRuntime
|
||||
from core.workflow.node_runtime import DifyFileReferenceFactory, DifyHumanInputNodeRuntime
|
||||
from core.workflow.system_variables import build_system_variables
|
||||
from graphon.enums import WorkflowType
|
||||
from graphon.graph import Graph
|
||||
@@ -21,7 +21,7 @@ from graphon.graph_engine import GraphEngine
|
||||
from graphon.graph_engine.command_channels import InMemoryChannel
|
||||
from graphon.nodes.end.end_node import EndNode
|
||||
from graphon.nodes.end.entities import EndNodeData
|
||||
from graphon.nodes.human_input.entities import HumanInputNodeData, UserAction
|
||||
from graphon.nodes.human_input.entities import HumanInputNodeData, UserActionConfig
|
||||
from graphon.nodes.human_input.enums import HumanInputFormStatus
|
||||
from graphon.nodes.human_input.human_input_node import HumanInputNode
|
||||
from graphon.nodes.start.entities import StartNodeData
|
||||
@@ -112,7 +112,7 @@ def _build_graph(
|
||||
form_content="Awaiting human input",
|
||||
inputs=[],
|
||||
user_actions=[
|
||||
UserAction(id="continue", title="Continue"),
|
||||
UserActionConfig(id="continue", title="Continue"),
|
||||
],
|
||||
)
|
||||
human_node = HumanInputNode(
|
||||
@@ -121,6 +121,7 @@ def _build_graph(
|
||||
graph_init_params=params,
|
||||
graph_runtime_state=runtime_state,
|
||||
form_repository=form_repository,
|
||||
file_reference_factory=DifyFileReferenceFactory(params.run_context),
|
||||
runtime=DifyHumanInputNodeRuntime(params.run_context),
|
||||
)
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ from datetime import timedelta
|
||||
from decimal import Decimal
|
||||
from uuid import uuid4
|
||||
|
||||
from graphon.nodes.human_input.entities import FormDefinition, UserAction
|
||||
from graphon.nodes.human_input.entities import FormDefinition, UserActionConfig
|
||||
from libs.datetime_utils import naive_utc_now
|
||||
from models.account import Account, Tenant, TenantAccountJoin
|
||||
from models.enums import ConversationFromSource, InvokeFrom
|
||||
@@ -116,7 +116,7 @@ def create_human_input_message_fixture(db_session) -> HumanInputMessageFixture:
|
||||
form_definition = FormDefinition(
|
||||
form_content="content",
|
||||
inputs=[],
|
||||
user_actions=[UserAction(id=action_id, title=action_text)],
|
||||
user_actions=[UserActionConfig(id=action_id, title=action_text)],
|
||||
rendered_content="Rendered block",
|
||||
expiration_time=naive_utc_now() + timedelta(days=1),
|
||||
node_title=node_title,
|
||||
|
||||
@@ -17,7 +17,7 @@ from extensions.ext_storage import storage
|
||||
from graphon.entities import WorkflowExecution
|
||||
from graphon.entities.pause_reason import HumanInputRequired, PauseReasonType
|
||||
from graphon.enums import WorkflowExecutionStatus
|
||||
from graphon.nodes.human_input.entities import FormDefinition, FormInput, UserAction
|
||||
from graphon.nodes.human_input.entities import FormDefinition, ParagraphInputConfig, UserActionConfig
|
||||
from graphon.nodes.human_input.enums import FormInputType, HumanInputFormStatus
|
||||
from libs.datetime_utils import naive_utc_now
|
||||
from models.enums import CreatorUserRole, WorkflowRunTriggeredFrom
|
||||
@@ -642,8 +642,8 @@ class TestBuildHumanInputRequiredReason:
|
||||
expiration_time = naive_utc_now()
|
||||
form_definition = FormDefinition(
|
||||
form_content="content",
|
||||
inputs=[FormInput(type=FormInputType.TEXT_INPUT, output_variable_name="name")],
|
||||
user_actions=[UserAction(id="approve", title="Approve")],
|
||||
inputs=[ParagraphInputConfig(type=FormInputType.PARAGRAPH, output_variable_name="name")],
|
||||
user_actions=[UserActionConfig(id="approve", title="Approve")],
|
||||
rendered_content="rendered",
|
||||
expiration_time=expiration_time,
|
||||
default_values={"name": "Alice"},
|
||||
@@ -754,8 +754,8 @@ class TestBuildHumanInputRequiredReason:
|
||||
expiration_time = naive_utc_now()
|
||||
form_definition = FormDefinition(
|
||||
form_content="content",
|
||||
inputs=[FormInput(type=FormInputType.TEXT_INPUT, output_variable_name="name")],
|
||||
user_actions=[UserAction(id="approve", title="Approve")],
|
||||
inputs=[ParagraphInputConfig(type=FormInputType.PARAGRAPH, output_variable_name="name")],
|
||||
user_actions=[UserActionConfig(id="approve", title="Approve")],
|
||||
rendered_content="rendered",
|
||||
expiration_time=expiration_time,
|
||||
default_values={"name": "Alice"},
|
||||
|
||||
@@ -15,7 +15,7 @@ import pytest
|
||||
from sqlalchemy import Engine, delete, select
|
||||
from sqlalchemy.orm import Session, sessionmaker
|
||||
|
||||
from graphon.nodes.human_input.entities import FormDefinition, UserAction
|
||||
from graphon.nodes.human_input.entities import FormDefinition, UserActionConfig
|
||||
from graphon.nodes.human_input.enums import HumanInputFormStatus
|
||||
from libs.datetime_utils import naive_utc_now
|
||||
from models.account import Account, Tenant, TenantAccountJoin, TenantAccountRole
|
||||
@@ -179,7 +179,7 @@ def _create_submitted_form(
|
||||
form_definition = FormDefinition(
|
||||
form_content="content",
|
||||
inputs=[],
|
||||
user_actions=[UserAction(id=action_id, title=action_title)],
|
||||
user_actions=[UserActionConfig(id=action_id, title=action_title)],
|
||||
rendered_content="rendered",
|
||||
expiration_time=expiration_time,
|
||||
node_title=node_title,
|
||||
@@ -212,7 +212,7 @@ def _create_waiting_form(
|
||||
form_definition = FormDefinition(
|
||||
form_content="content",
|
||||
inputs=[],
|
||||
user_actions=[UserAction(id="approve", title="Approve")],
|
||||
user_actions=[UserActionConfig(id="approve", title="Approve")],
|
||||
rendered_content="rendered",
|
||||
expiration_time=expiration_time,
|
||||
default_values=default_values or {"name": "John"},
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
"""Unit tests for the Markdown API docs generator."""
|
||||
|
||||
import importlib.util
|
||||
import json
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
@@ -101,3 +102,195 @@ def test_generate_markdown_docs_only_removes_generated_specs_from_separate_swagg
|
||||
|
||||
assert existing_file.read_text(encoding="utf-8") == "keep me"
|
||||
assert not list(swagger_dir.glob("*.json"))
|
||||
|
||||
|
||||
def test_patch_union_schema_markdown_fills_converter_blank_schema_types(tmp_path):
|
||||
module = _load_generate_swagger_markdown_docs_module()
|
||||
spec_path = tmp_path / "console-swagger.json"
|
||||
spec_path.write_text(
|
||||
json.dumps(
|
||||
{
|
||||
"definitions": {
|
||||
"FormInputConfig": {
|
||||
"oneOf": [
|
||||
{"$ref": "#/definitions/ParagraphInputConfig"},
|
||||
{"$ref": "#/definitions/SelectInputConfig"},
|
||||
{"$ref": "#/definitions/FileInputConfig"},
|
||||
],
|
||||
},
|
||||
"ParagraphInputConfig": {
|
||||
"properties": {
|
||||
"default": {
|
||||
"anyOf": [
|
||||
{"$ref": "#/definitions/StringSource"},
|
||||
{"type": "null"},
|
||||
],
|
||||
},
|
||||
"output_variable_name": {"type": "string"},
|
||||
},
|
||||
},
|
||||
"SelectInputConfig": {
|
||||
"properties": {
|
||||
"option_source": {"$ref": "#/definitions/StringListSource"},
|
||||
},
|
||||
},
|
||||
"FileInputConfig": {
|
||||
"properties": {
|
||||
"allowed_file_types": {
|
||||
"type": "array",
|
||||
"items": {"$ref": "#/definitions/FileType"},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
),
|
||||
encoding="utf-8",
|
||||
)
|
||||
markdown = """#### FormInputConfig
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
| ---- | ---- | ----------- | -------- |
|
||||
| FormInputConfig | | | |
|
||||
|
||||
#### ParagraphInputConfig
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
| ---- | ---- | ----------- | -------- |
|
||||
| default | | | No |
|
||||
| output_variable_name | string | | Yes |
|
||||
|
||||
#### SelectInputConfig
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
| ---- | ---- | ----------- | -------- |
|
||||
| option_source | | | Yes |
|
||||
|
||||
#### FileInputConfig
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
| ---- | ---- | ----------- | -------- |
|
||||
| allowed_file_types | | | No |
|
||||
"""
|
||||
|
||||
patched = module._patch_union_schema_markdown(markdown, spec_path)
|
||||
|
||||
assert (
|
||||
"| FormInputConfig | "
|
||||
"[ParagraphInputConfig](#paragraphinputconfig)<br>"
|
||||
"[SelectInputConfig](#selectinputconfig)<br>"
|
||||
"[FileInputConfig](#fileinputconfig) | | |"
|
||||
) in patched
|
||||
assert "| default | [StringSource](#stringsource) | | No |" in patched
|
||||
assert "| output_variable_name | string | | Yes |" in patched
|
||||
assert "| option_source | [StringListSource](#stringlistsource) | | Yes |" in patched
|
||||
assert "| allowed_file_types | [ [FileType](#filetype) ] | | No |" in patched
|
||||
|
||||
|
||||
def test_patch_union_schema_markdown_ignores_specs_without_definitions(tmp_path):
|
||||
module = _load_generate_swagger_markdown_docs_module()
|
||||
spec_path = tmp_path / "console-swagger.json"
|
||||
spec_path.write_text("{}", encoding="utf-8")
|
||||
|
||||
assert module._patch_union_schema_markdown("unchanged", spec_path) == "unchanged"
|
||||
|
||||
|
||||
def test_patch_union_schema_markdown_ignores_unrenderable_shapes(tmp_path):
|
||||
module = _load_generate_swagger_markdown_docs_module()
|
||||
spec_path = tmp_path / "console-swagger.json"
|
||||
spec_path.write_text(
|
||||
json.dumps(
|
||||
{
|
||||
"definitions": {
|
||||
"NotAMapping": [],
|
||||
"BrokenUnion": {
|
||||
"oneOf": [
|
||||
{},
|
||||
{"$ref": "#/definitions/Missing"},
|
||||
{"$ref": "#/definitions/NoPropertyMapping"},
|
||||
],
|
||||
},
|
||||
"NoPropertyMapping": {"properties": []},
|
||||
}
|
||||
}
|
||||
),
|
||||
encoding="utf-8",
|
||||
)
|
||||
|
||||
assert module._definition_ref_name(None) is None
|
||||
assert module._schema_markdown_type(None) == ""
|
||||
assert module._schema_markdown_type({"anyOf": [{"type": "null"}]}) == ""
|
||||
assert module._replace_schema_table_type("unchanged", "Definition", "field", "") == "unchanged"
|
||||
assert (
|
||||
module._replace_schema_table_type(
|
||||
"#### Definition\n#### Next\n| field | | | No |",
|
||||
"Definition",
|
||||
"field",
|
||||
"string",
|
||||
)
|
||||
== "#### Definition\n#### Next\n| field | | | No |"
|
||||
)
|
||||
assert (
|
||||
module._replace_schema_table_type("#### Definition\n| field |", "Definition", "field", "string")
|
||||
== "#### Definition\n| field |"
|
||||
)
|
||||
|
||||
assert module._patch_union_schema_markdown("#### BrokenUnion\n", spec_path) == "#### BrokenUnion"
|
||||
|
||||
|
||||
def test_convert_spec_to_markdown_patches_generated_union_tables(tmp_path, monkeypatch):
|
||||
module = _load_generate_swagger_markdown_docs_module()
|
||||
spec_path = tmp_path / "console-swagger.json"
|
||||
output_path = tmp_path / "console-swagger.md"
|
||||
spec_path.write_text(
|
||||
json.dumps(
|
||||
{
|
||||
"definitions": {
|
||||
"FormInputConfig": {
|
||||
"oneOf": [
|
||||
{"$ref": "#/definitions/ParagraphInputConfig"},
|
||||
],
|
||||
},
|
||||
"ParagraphInputConfig": {
|
||||
"properties": {
|
||||
"default": {
|
||||
"anyOf": [
|
||||
{"$ref": "#/definitions/StringSource"},
|
||||
{"type": "null"},
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
),
|
||||
encoding="utf-8",
|
||||
)
|
||||
|
||||
def run_converter(args, **kwargs):
|
||||
assert kwargs["check"] is False
|
||||
markdown_path = Path(args[args.index("-o") + 1])
|
||||
markdown_path.write_text(
|
||||
"""#### FormInputConfig
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
| ---- | ---- | ----------- | -------- |
|
||||
| FormInputConfig | | | |
|
||||
|
||||
#### ParagraphInputConfig
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
| ---- | ---- | ----------- | -------- |
|
||||
| default | | | No |
|
||||
""",
|
||||
encoding="utf-8",
|
||||
)
|
||||
return module.subprocess.CompletedProcess(args=args, returncode=0, stdout="", stderr="")
|
||||
|
||||
monkeypatch.setattr(module.subprocess, "run", run_converter)
|
||||
|
||||
module._convert_spec_to_markdown(spec_path, output_path)
|
||||
|
||||
converted = output_path.read_text(encoding="utf-8")
|
||||
assert "| FormInputConfig | [ParagraphInputConfig](#paragraphinputconfig) | | |" in converted
|
||||
assert "| default | [StringSource](#stringsource) | | No |" in converted
|
||||
|
||||
@@ -12,7 +12,7 @@ from controllers.console.app import workflow_run as workflow_run_module
|
||||
from controllers.web.error import NotFoundError
|
||||
from graphon.entities.pause_reason import HumanInputRequired
|
||||
from graphon.enums import WorkflowExecutionStatus
|
||||
from graphon.nodes.human_input.entities import FormInput, UserAction
|
||||
from graphon.nodes.human_input.entities import ParagraphInputConfig, UserActionConfig
|
||||
from graphon.nodes.human_input.enums import FormInputType
|
||||
from libs import login as login_lib
|
||||
from models.account import Account, AccountStatus, TenantAccountRole
|
||||
@@ -63,8 +63,8 @@ def test_pause_details_returns_backstage_input_url(app: Flask, monkeypatch: pyte
|
||||
reason = HumanInputRequired(
|
||||
form_id="form-1",
|
||||
form_content="content",
|
||||
inputs=[FormInput(type=FormInputType.TEXT_INPUT, output_variable_name="name")],
|
||||
actions=[UserAction(id="approve", title="Approve")],
|
||||
inputs=[ParagraphInputConfig(type=FormInputType.PARAGRAPH, output_variable_name="name")],
|
||||
actions=[UserActionConfig(id="approve", title="Approve")],
|
||||
node_id="node-1",
|
||||
node_title="Ask Name",
|
||||
)
|
||||
|
||||
@@ -32,7 +32,7 @@ from core.workflow.system_variables import build_system_variables
|
||||
from graphon.entities import WorkflowStartReason
|
||||
from graphon.entities.pause_reason import HumanInputRequired, PauseReasonType
|
||||
from graphon.enums import WorkflowExecutionStatus, WorkflowNodeExecutionStatus
|
||||
from graphon.nodes.human_input.entities import FormInput, UserAction
|
||||
from graphon.nodes.human_input.entities import ParagraphInputConfig, UserActionConfig
|
||||
from graphon.nodes.human_input.enums import FormInputType
|
||||
from graphon.runtime import GraphRuntimeState, VariablePool
|
||||
from models.account import Account
|
||||
@@ -450,7 +450,7 @@ class TestHitlServiceApi:
|
||||
node_title="Approval",
|
||||
form_content="Need approval",
|
||||
inputs=[],
|
||||
actions=[UserAction(id="approve", title="Approve")],
|
||||
actions=[UserActionConfig(id="approve", title="Approve")],
|
||||
display_in_ui=True,
|
||||
form_token="token-1",
|
||||
resolved_default_values={},
|
||||
@@ -591,9 +591,9 @@ class TestHitlServiceApi:
|
||||
form_id="form-1",
|
||||
form_content="Rendered",
|
||||
inputs=[
|
||||
FormInput(type=FormInputType.TEXT_INPUT, output_variable_name="field", default=None),
|
||||
ParagraphInputConfig(type=FormInputType.PARAGRAPH, output_variable_name="field", default=None),
|
||||
],
|
||||
actions=[UserAction(id="approve", title="Approve")],
|
||||
actions=[UserActionConfig(id="approve", title="Approve")],
|
||||
display_in_ui=True,
|
||||
node_id="node-id",
|
||||
node_title="Human Step",
|
||||
|
||||
@@ -51,7 +51,7 @@ from core.base.tts.app_generator_tts_publisher import AudioTrunk
|
||||
from core.workflow.system_variables import build_system_variables
|
||||
from graphon.entities.pause_reason import PauseReasonType
|
||||
from graphon.enums import BuiltinNodeTypes
|
||||
from graphon.nodes.human_input.entities import UserAction
|
||||
from graphon.nodes.human_input.entities import UserActionConfig
|
||||
from graphon.runtime import GraphRuntimeState, VariablePool
|
||||
from libs.datetime_utils import naive_utc_now
|
||||
from models.enums import MessageStatus
|
||||
@@ -150,7 +150,7 @@ class TestAdvancedChatGenerateTaskPipeline:
|
||||
node_title="Approval",
|
||||
form_content="Need approval",
|
||||
inputs=[],
|
||||
actions=[UserAction(id="approve", title="Approve")],
|
||||
actions=[UserActionConfig(id="approve", title="Approve")],
|
||||
display_in_ui=True,
|
||||
form_token="token-1",
|
||||
resolved_default_values={},
|
||||
|
||||
@@ -14,7 +14,7 @@ from core.workflow.system_variables import build_system_variables
|
||||
from graphon.entities import WorkflowStartReason
|
||||
from graphon.entities.pause_reason import HumanInputRequired
|
||||
from graphon.graph_events import GraphRunPausedEvent
|
||||
from graphon.nodes.human_input.entities import FormInput, UserAction
|
||||
from graphon.nodes.human_input.entities import ParagraphInputConfig, UserActionConfig
|
||||
from graphon.nodes.human_input.enums import FormInputType
|
||||
from models.account import Account
|
||||
from models.human_input import RecipientType
|
||||
@@ -157,9 +157,9 @@ def test_queue_workflow_paused_event_to_stream_responses(monkeypatch: pytest.Mon
|
||||
form_id="form-1",
|
||||
form_content="Rendered",
|
||||
inputs=[
|
||||
FormInput(type=FormInputType.TEXT_INPUT, output_variable_name="field", default=None),
|
||||
ParagraphInputConfig(type=FormInputType.PARAGRAPH, output_variable_name="field", default=None),
|
||||
],
|
||||
actions=[UserAction(id="approve", title="Approve")],
|
||||
actions=[UserActionConfig(id="approve", title="Approve")],
|
||||
node_id="node-id",
|
||||
node_title="Human Step",
|
||||
)
|
||||
|
||||
@@ -4,7 +4,7 @@ from core.entities.execution_extra_content import (
|
||||
HumanInputFormDefinition,
|
||||
HumanInputFormSubmissionData,
|
||||
)
|
||||
from graphon.nodes.human_input.entities import FormInput, UserAction
|
||||
from graphon.nodes.human_input.entities import ParagraphInputConfig, UserActionConfig
|
||||
from graphon.nodes.human_input.enums import FormInputType
|
||||
from models.execution_extra_content import ExecutionContentType
|
||||
|
||||
@@ -16,8 +16,8 @@ def test_human_input_content_defaults_and_domain_alias() -> None:
|
||||
node_id="node-1",
|
||||
node_title="Human Input",
|
||||
form_content="Please confirm",
|
||||
inputs=[FormInput(type=FormInputType.TEXT_INPUT, output_variable_name="answer")],
|
||||
actions=[UserAction(id="confirm", title="Confirm")],
|
||||
inputs=[ParagraphInputConfig(type=FormInputType.PARAGRAPH, output_variable_name="answer")],
|
||||
actions=[UserActionConfig(id="confirm", title="Confirm")],
|
||||
resolved_default_values={"answer": "yes"},
|
||||
expiration_time=1_700_000_000,
|
||||
)
|
||||
|
||||
@@ -23,7 +23,7 @@ from core.workflow.human_input_adapter import (
|
||||
)
|
||||
from graphon.nodes.human_input.entities import (
|
||||
FormDefinition,
|
||||
UserAction,
|
||||
UserActionConfig,
|
||||
)
|
||||
from graphon.nodes.human_input.enums import HumanInputFormKind, HumanInputFormStatus
|
||||
from libs.datetime_utils import naive_utc_now
|
||||
@@ -272,7 +272,7 @@ def _make_form_definition() -> str:
|
||||
return FormDefinition(
|
||||
form_content="hello",
|
||||
inputs=[],
|
||||
user_actions=[UserAction(id="submit", title="Submit")],
|
||||
user_actions=[UserActionConfig(id="submit", title="Submit")],
|
||||
rendered_content="<p>hello</p>",
|
||||
expiration_time=naive_utc_now(),
|
||||
).model_dump_json()
|
||||
|
||||
@@ -29,7 +29,7 @@ from core.workflow.human_input_adapter import (
|
||||
MemberRecipient,
|
||||
WebAppDeliveryMethod,
|
||||
)
|
||||
from graphon.nodes.human_input.entities import HumanInputNodeData, UserAction
|
||||
from graphon.nodes.human_input.entities import HumanInputNodeData, UserActionConfig
|
||||
from graphon.nodes.human_input.enums import HumanInputFormKind, HumanInputFormStatus
|
||||
from libs.datetime_utils import naive_utc_now
|
||||
from models.human_input import HumanInputFormRecipient, RecipientType
|
||||
@@ -467,7 +467,7 @@ def test_create_form_adds_console_and_backstage_recipients(monkeypatch: pytest.M
|
||||
delivery_methods=[],
|
||||
form_content="hello",
|
||||
inputs=[],
|
||||
user_actions=[UserAction(id="submit", title="Submit")],
|
||||
user_actions=[UserActionConfig(id="submit", title="Submit")],
|
||||
)
|
||||
params = FormCreateParams(
|
||||
workflow_execution_id=None,
|
||||
|
||||
@@ -81,11 +81,11 @@ class MockNodeMixin:
|
||||
if isinstance(self, TemplateTransformNode):
|
||||
kwargs.setdefault("jinja2_template_renderer", _TestJinja2Renderer())
|
||||
|
||||
# Provide default tool_file_manager_factory for ToolNode subclasses
|
||||
# Provide default ToolNode dependencies for ToolNode subclasses.
|
||||
from graphon.nodes.tool import ToolNode as _ToolNode # local import to avoid cycles
|
||||
|
||||
if isinstance(self, _ToolNode):
|
||||
kwargs.setdefault("tool_file_manager_factory", MagicMock(spec=ToolFileManagerProtocol))
|
||||
kwargs.setdefault("tool_file_manager", MagicMock(spec=ToolFileManagerProtocol))
|
||||
kwargs.setdefault("runtime", DifyToolNodeRuntime(graph_init_params.run_context))
|
||||
|
||||
if isinstance(self, AgentNode):
|
||||
|
||||
@@ -9,7 +9,7 @@ from core.repositories.human_input_repository import (
|
||||
HumanInputFormEntity,
|
||||
HumanInputFormRepository,
|
||||
)
|
||||
from core.workflow.node_runtime import DifyHumanInputNodeRuntime
|
||||
from core.workflow.node_runtime import DifyFileReferenceFactory, DifyHumanInputNodeRuntime
|
||||
from core.workflow.system_variables import build_system_variables
|
||||
from graphon.entities import WorkflowStartReason
|
||||
from graphon.graph import Graph
|
||||
@@ -24,7 +24,7 @@ from graphon.graph_events import (
|
||||
from graphon.nodes.base.entities import OutputVariableEntity
|
||||
from graphon.nodes.end.end_node import EndNode
|
||||
from graphon.nodes.end.entities import EndNodeData
|
||||
from graphon.nodes.human_input.entities import HumanInputNodeData, UserAction
|
||||
from graphon.nodes.human_input.entities import HumanInputNodeData, UserActionConfig
|
||||
from graphon.nodes.human_input.enums import HumanInputFormStatus
|
||||
from graphon.nodes.human_input.human_input_node import HumanInputNode
|
||||
from graphon.nodes.start.entities import StartNodeData
|
||||
@@ -149,7 +149,7 @@ def _build_graph(runtime_state: GraphRuntimeState, repo: HumanInputFormRepositor
|
||||
title="Human Input",
|
||||
form_content="Human input required",
|
||||
inputs=[],
|
||||
user_actions=[UserAction(id="approve", title="Approve")],
|
||||
user_actions=[UserActionConfig(id="approve", title="Approve")],
|
||||
)
|
||||
|
||||
human_a_config = {"id": "human_a", "data": human_data.model_dump()}
|
||||
@@ -159,6 +159,7 @@ def _build_graph(runtime_state: GraphRuntimeState, repo: HumanInputFormRepositor
|
||||
graph_init_params=graph_init_params,
|
||||
graph_runtime_state=runtime_state,
|
||||
form_repository=repo,
|
||||
file_reference_factory=DifyFileReferenceFactory(graph_init_params.run_context),
|
||||
runtime=DifyHumanInputNodeRuntime(graph_init_params.run_context),
|
||||
)
|
||||
|
||||
@@ -169,6 +170,7 @@ def _build_graph(runtime_state: GraphRuntimeState, repo: HumanInputFormRepositor
|
||||
graph_init_params=graph_init_params,
|
||||
graph_runtime_state=runtime_state,
|
||||
form_repository=repo,
|
||||
file_reference_factory=DifyFileReferenceFactory(graph_init_params.run_context),
|
||||
runtime=DifyHumanInputNodeRuntime(graph_init_params.run_context),
|
||||
)
|
||||
|
||||
|
||||
@@ -30,23 +30,23 @@ from core.workflow.human_input_adapter import (
|
||||
WebAppDeliveryMethod,
|
||||
_WebAppDeliveryConfig,
|
||||
)
|
||||
from core.workflow.node_runtime import DifyHumanInputNodeRuntime
|
||||
from core.workflow.node_runtime import DifyFileReferenceFactory, DifyHumanInputNodeRuntime
|
||||
from core.workflow.system_variables import build_system_variables
|
||||
from graphon.entities import GraphInitParams
|
||||
from graphon.node_events import PauseRequestedEvent
|
||||
from graphon.node_events.node import StreamCompletedEvent
|
||||
from graphon.nodes.human_input.entities import (
|
||||
FormInput,
|
||||
FormInputDefault,
|
||||
HumanInputNodeData,
|
||||
UserAction,
|
||||
ParagraphInputConfig,
|
||||
StringSource,
|
||||
UserActionConfig,
|
||||
)
|
||||
from graphon.nodes.human_input.enums import (
|
||||
ButtonStyle,
|
||||
FormInputType,
|
||||
HumanInputFormStatus,
|
||||
PlaceholderType,
|
||||
TimeoutUnit,
|
||||
ValueSourceType,
|
||||
)
|
||||
from graphon.nodes.human_input.human_input_node import HumanInputNode
|
||||
from graphon.runtime import GraphRuntimeState, VariablePool
|
||||
@@ -152,6 +152,7 @@ def _build_human_input_node(
|
||||
data=typed_node_data,
|
||||
graph_init_params=graph_init_params,
|
||||
graph_runtime_state=graph_runtime_state,
|
||||
file_reference_factory=DifyFileReferenceFactory(graph_init_params.run_context),
|
||||
runtime=runtime,
|
||||
)
|
||||
|
||||
@@ -190,32 +191,36 @@ class TestDeliveryMethod:
|
||||
assert len(delivery_method.config.recipients.items) == 2
|
||||
|
||||
|
||||
class TestFormInput:
|
||||
"""Test FormInput entity."""
|
||||
class TestParagraphInputConfig:
|
||||
"""Test ParagraphInputConfig entity."""
|
||||
|
||||
def test_text_input_with_constant_default(self):
|
||||
"""Test text input with constant default value."""
|
||||
default = FormInputDefault(type=PlaceholderType.CONSTANT, value="Enter your response here...")
|
||||
def test_paragraph_input_with_constant_default(self):
|
||||
"""Test paragraph input with constant default value."""
|
||||
default = StringSource(type=ValueSourceType.CONSTANT, value="Enter your response here...")
|
||||
|
||||
form_input = FormInput(type=FormInputType.TEXT_INPUT, output_variable_name="user_input", default=default)
|
||||
form_input = ParagraphInputConfig(
|
||||
type=FormInputType.PARAGRAPH, output_variable_name="user_input", default=default
|
||||
)
|
||||
|
||||
assert form_input.type == FormInputType.TEXT_INPUT
|
||||
assert form_input.type == FormInputType.PARAGRAPH
|
||||
assert form_input.output_variable_name == "user_input"
|
||||
assert form_input.default.type == PlaceholderType.CONSTANT
|
||||
assert form_input.default.type == ValueSourceType.CONSTANT
|
||||
assert form_input.default.value == "Enter your response here..."
|
||||
|
||||
def test_text_input_with_variable_default(self):
|
||||
"""Test text input with variable default value."""
|
||||
default = FormInputDefault(type=PlaceholderType.VARIABLE, selector=["node_123", "output_var"])
|
||||
def test_paragraph_input_with_variable_default(self):
|
||||
"""Test paragraph input with variable default value."""
|
||||
default = StringSource(type=ValueSourceType.VARIABLE, selector=["node_123", "output_var"])
|
||||
|
||||
form_input = FormInput(type=FormInputType.TEXT_INPUT, output_variable_name="user_input", default=default)
|
||||
form_input = ParagraphInputConfig(
|
||||
type=FormInputType.PARAGRAPH, output_variable_name="user_input", default=default
|
||||
)
|
||||
|
||||
assert form_input.default.type == PlaceholderType.VARIABLE
|
||||
assert form_input.default.type == ValueSourceType.VARIABLE
|
||||
assert form_input.default.selector == ["node_123", "output_var"]
|
||||
|
||||
def test_form_input_without_default(self):
|
||||
"""Test form input without default value."""
|
||||
form_input = FormInput(type=FormInputType.PARAGRAPH, output_variable_name="description")
|
||||
form_input = ParagraphInputConfig(type=FormInputType.PARAGRAPH, output_variable_name="description")
|
||||
|
||||
assert form_input.type == FormInputType.PARAGRAPH
|
||||
assert form_input.output_variable_name == "description"
|
||||
@@ -223,11 +228,11 @@ class TestFormInput:
|
||||
|
||||
|
||||
class TestUserAction:
|
||||
"""Test UserAction entity."""
|
||||
"""Test UserActionConfig entity."""
|
||||
|
||||
def test_user_action_creation(self):
|
||||
"""Test user action creation."""
|
||||
action = UserAction(id="approve", title="Approve", button_style=ButtonStyle.PRIMARY)
|
||||
action = UserActionConfig(id="approve", title="Approve", button_style=ButtonStyle.PRIMARY)
|
||||
|
||||
assert action.id == "approve"
|
||||
assert action.title == "Approve"
|
||||
@@ -235,13 +240,13 @@ class TestUserAction:
|
||||
|
||||
def test_user_action_default_button_style(self):
|
||||
"""Test user action with default button style."""
|
||||
action = UserAction(id="cancel", title="Cancel")
|
||||
action = UserActionConfig(id="cancel", title="Cancel")
|
||||
|
||||
assert action.button_style == ButtonStyle.DEFAULT
|
||||
|
||||
def test_user_action_length_boundaries(self):
|
||||
"""Test user action id and title length boundaries."""
|
||||
action = UserAction(id="a" * 20, title="b" * 100)
|
||||
action = UserActionConfig(id="a" * 20, title="b" * 100)
|
||||
|
||||
assert action.id == "a" * 20
|
||||
assert action.title == "b" * 100
|
||||
@@ -259,7 +264,7 @@ class TestUserAction:
|
||||
data[field_name] = value
|
||||
|
||||
with pytest.raises(ValidationError) as exc_info:
|
||||
UserAction.model_validate(data)
|
||||
UserActionConfig.model_validate(data)
|
||||
|
||||
errors = exc_info.value.errors()
|
||||
assert any(error["loc"] == (field_name,) and error["type"] == "string_too_long" for error in errors)
|
||||
@@ -273,14 +278,14 @@ class TestHumanInputNodeData:
|
||||
delivery_methods = [WebAppDeliveryMethod(enabled=True, config=_WebAppDeliveryConfig())]
|
||||
|
||||
inputs = [
|
||||
FormInput(
|
||||
type=FormInputType.TEXT_INPUT,
|
||||
ParagraphInputConfig(
|
||||
type=FormInputType.PARAGRAPH,
|
||||
output_variable_name="content",
|
||||
default=FormInputDefault(type=PlaceholderType.CONSTANT, value="Enter content..."),
|
||||
default=StringSource(type=ValueSourceType.CONSTANT, value="Enter content..."),
|
||||
)
|
||||
]
|
||||
|
||||
user_actions = [UserAction(id="submit", title="Submit", button_style=ButtonStyle.PRIMARY)]
|
||||
user_actions = [UserActionConfig(id="submit", title="Submit", button_style=ButtonStyle.PRIMARY)]
|
||||
|
||||
node_data = HumanInputNodeData(
|
||||
title="Human Input Test",
|
||||
@@ -338,8 +343,8 @@ class TestHumanInputNodeData:
|
||||
def test_duplicate_input_output_variable_name_raises_validation_error(self):
|
||||
"""Duplicate form input output_variable_name should raise validation error."""
|
||||
duplicate_inputs = [
|
||||
FormInput(type=FormInputType.TEXT_INPUT, output_variable_name="content"),
|
||||
FormInput(type=FormInputType.TEXT_INPUT, output_variable_name="content"),
|
||||
ParagraphInputConfig(type=FormInputType.PARAGRAPH, output_variable_name="content"),
|
||||
ParagraphInputConfig(type=FormInputType.PARAGRAPH, output_variable_name="content"),
|
||||
]
|
||||
|
||||
with pytest.raises(ValidationError, match="duplicated output_variable_name 'content'"):
|
||||
@@ -348,8 +353,8 @@ class TestHumanInputNodeData:
|
||||
def test_duplicate_user_action_ids_raise_validation_error(self):
|
||||
"""Duplicate user action ids should raise validation error."""
|
||||
duplicate_actions = [
|
||||
UserAction(id="submit", title="Submit"),
|
||||
UserAction(id="submit", title="Submit Again"),
|
||||
UserActionConfig(id="submit", title="Submit"),
|
||||
UserActionConfig(id="submit", title="Submit Again"),
|
||||
]
|
||||
|
||||
with pytest.raises(ValidationError, match="duplicated user action id 'submit'"):
|
||||
@@ -458,18 +463,18 @@ class TestHumanInputNodeVariableResolution:
|
||||
title="Human Input",
|
||||
form_content="Provide your name",
|
||||
inputs=[
|
||||
FormInput(
|
||||
type=FormInputType.TEXT_INPUT,
|
||||
ParagraphInputConfig(
|
||||
type=FormInputType.PARAGRAPH,
|
||||
output_variable_name="user_name",
|
||||
default=FormInputDefault(type=PlaceholderType.VARIABLE, selector=["start", "name"]),
|
||||
default=StringSource(type=ValueSourceType.VARIABLE, selector=["start", "name"]),
|
||||
),
|
||||
FormInput(
|
||||
type=FormInputType.TEXT_INPUT,
|
||||
ParagraphInputConfig(
|
||||
type=FormInputType.PARAGRAPH,
|
||||
output_variable_name="user_email",
|
||||
default=FormInputDefault(type=PlaceholderType.CONSTANT, value="foo@example.com"),
|
||||
default=StringSource(type=ValueSourceType.CONSTANT, value="foo@example.com"),
|
||||
),
|
||||
],
|
||||
user_actions=[UserAction(id="submit", title="Submit")],
|
||||
user_actions=[UserActionConfig(id="submit", title="Submit")],
|
||||
)
|
||||
config = {"id": "human", "data": node_data.model_dump()}
|
||||
|
||||
@@ -534,7 +539,7 @@ class TestHumanInputNodeVariableResolution:
|
||||
title="Human Input",
|
||||
form_content="Provide your name",
|
||||
inputs=[],
|
||||
user_actions=[UserAction(id="submit", title="Submit")],
|
||||
user_actions=[UserActionConfig(id="submit", title="Submit")],
|
||||
)
|
||||
config = {"id": "human", "data": node_data.model_dump()}
|
||||
|
||||
@@ -661,7 +666,7 @@ class TestHumanInputNodeVariableResolution:
|
||||
title="Human Input",
|
||||
form_content="Provide your name",
|
||||
inputs=[],
|
||||
user_actions=[UserAction(id="submit", title="Submit")],
|
||||
user_actions=[UserActionConfig(id="submit", title="Submit")],
|
||||
delivery_methods=[
|
||||
EmailDeliveryMethod(
|
||||
enabled=True,
|
||||
@@ -721,7 +726,7 @@ class TestValidation:
|
||||
def test_invalid_form_input_type(self):
|
||||
"""Test validation with invalid form input type."""
|
||||
with pytest.raises(ValidationError):
|
||||
FormInput(
|
||||
ParagraphInputConfig(
|
||||
type="invalid-type", # Invalid type
|
||||
output_variable_name="test",
|
||||
)
|
||||
@@ -729,7 +734,7 @@ class TestValidation:
|
||||
def test_invalid_button_style(self):
|
||||
"""Test validation with invalid button style."""
|
||||
with pytest.raises(ValidationError):
|
||||
UserAction(
|
||||
UserActionConfig(
|
||||
id="test",
|
||||
title="Test",
|
||||
button_style="invalid-style", # Invalid style
|
||||
@@ -778,12 +783,12 @@ class TestHumanInputNodeRenderedContent:
|
||||
title="Human Input",
|
||||
form_content="Name: {{#$output.name#}}",
|
||||
inputs=[
|
||||
FormInput(
|
||||
type=FormInputType.TEXT_INPUT,
|
||||
ParagraphInputConfig(
|
||||
type=FormInputType.PARAGRAPH,
|
||||
output_variable_name="name",
|
||||
)
|
||||
],
|
||||
user_actions=[UserAction(id="approve", title="Approve")],
|
||||
user_actions=[UserActionConfig(id="approve", title="Approve")],
|
||||
)
|
||||
config = {"id": "human", "data": node_data.model_dump()}
|
||||
|
||||
@@ -810,4 +815,4 @@ class TestHumanInputNodeRenderedContent:
|
||||
last_event = events[-1]
|
||||
assert isinstance(last_event, StreamCompletedEvent)
|
||||
node_run_result = last_event.node_run_result
|
||||
assert node_run_result.outputs["__rendered_content"] == "Name: Alice"
|
||||
assert node_run_result.outputs["__rendered_content"].to_object() == "Name: Alice"
|
||||
|
||||
@@ -2,7 +2,7 @@ import datetime
|
||||
from types import SimpleNamespace
|
||||
|
||||
from core.app.entities.app_invoke_entities import DIFY_RUN_CONTEXT_KEY, InvokeFrom, UserFrom
|
||||
from core.workflow.node_runtime import DifyHumanInputNodeRuntime
|
||||
from core.workflow.node_runtime import DifyFileReferenceFactory, DifyHumanInputNodeRuntime
|
||||
from core.workflow.system_variables import default_system_variables
|
||||
from graphon.entities import GraphInitParams
|
||||
from graphon.enums import BuiltinNodeTypes
|
||||
@@ -44,6 +44,7 @@ def _create_human_input_node(
|
||||
graph_init_params=graph_init_params,
|
||||
graph_runtime_state=graph_runtime_state,
|
||||
form_repository=repo,
|
||||
file_reference_factory=DifyFileReferenceFactory(graph_init_params.run_context),
|
||||
runtime=DifyHumanInputNodeRuntime(graph_init_params.run_context),
|
||||
)
|
||||
|
||||
@@ -81,7 +82,7 @@ def _build_node(form_content: str = "Please enter your name:\n\n{{#$output.name#
|
||||
"form_content": form_content,
|
||||
"inputs": [
|
||||
{
|
||||
"type": "text_input",
|
||||
"type": "paragraph",
|
||||
"output_variable_name": "name",
|
||||
"default": {"type": "constant", "value": ""},
|
||||
}
|
||||
@@ -148,7 +149,7 @@ def _build_timeout_node() -> HumanInputNode:
|
||||
"form_content": "Please enter your name:\n\n{{#$output.name#}}",
|
||||
"inputs": [
|
||||
{
|
||||
"type": "text_input",
|
||||
"type": "paragraph",
|
||||
"output_variable_name": "name",
|
||||
"default": {"type": "constant", "value": ""},
|
||||
}
|
||||
|
||||
@@ -111,8 +111,8 @@ def tool_node(monkeypatch) -> ToolNode:
|
||||
|
||||
config = graph_config["nodes"][0]
|
||||
|
||||
# Provide a stub ToolFileManager to satisfy the updated ToolNode constructor
|
||||
tool_file_manager_factory = MagicMock(spec=ToolFileManagerProtocol)
|
||||
# Provide a stub ToolFileManager to satisfy the ToolNode constructor.
|
||||
tool_file_manager = MagicMock(spec=ToolFileManagerProtocol)
|
||||
runtime = _StubToolRuntime()
|
||||
|
||||
node = ToolNode(
|
||||
@@ -120,7 +120,7 @@ def tool_node(monkeypatch) -> ToolNode:
|
||||
data=ToolNodeData.model_validate(config["data"]),
|
||||
graph_init_params=init_params,
|
||||
graph_runtime_state=graph_runtime_state,
|
||||
tool_file_manager_factory=tool_file_manager_factory,
|
||||
tool_file_manager=tool_file_manager,
|
||||
runtime=runtime,
|
||||
)
|
||||
return node
|
||||
@@ -215,7 +215,7 @@ def test_image_link_messages_use_tool_file_id_metadata(tool_node: ToolNode):
|
||||
size=123,
|
||||
storage_key="file-key",
|
||||
)
|
||||
tool_node._tool_file_manager_factory.get_file_generator_by_tool_file_id.return_value = (
|
||||
tool_node._tool_file_manager.get_file_generator_by_tool_file_id.return_value = (
|
||||
None,
|
||||
SimpleNamespace(mime_type="application/pdf"),
|
||||
)
|
||||
@@ -228,7 +228,7 @@ def test_image_link_messages_use_tool_file_id_metadata(tool_node: ToolNode):
|
||||
|
||||
events, _ = _run_transform(tool_node, message)
|
||||
|
||||
tool_node._tool_file_manager_factory.get_file_generator_by_tool_file_id.assert_called_once_with("file-id")
|
||||
tool_node._tool_file_manager.get_file_generator_by_tool_file_id.assert_called_once_with("file-id")
|
||||
completed_events = [event for event in events if isinstance(event, StreamCompletedEvent)]
|
||||
assert len(completed_events) == 1
|
||||
files_segment = completed_events[0].node_run_result.outputs["files"]
|
||||
|
||||
@@ -452,7 +452,7 @@ class TestDifyNodeFactoryCreateNode:
|
||||
factory._jinja2_template_renderer = sentinel.jinja2_template_renderer
|
||||
factory._template_transform_max_output_length = 2048
|
||||
factory._http_request_http_client = sentinel.http_client
|
||||
factory._bound_tool_file_manager_factory = sentinel.tool_file_manager_factory
|
||||
factory._bound_tool_file_manager_factory = MagicMock(return_value=sentinel.tool_file_manager)
|
||||
factory._file_reference_factory = sentinel.file_reference_factory
|
||||
factory._prompt_message_serializer = sentinel.prompt_message_serializer
|
||||
factory._retriever_attachment_loader = sentinel.retriever_attachment_loader
|
||||
@@ -540,6 +540,7 @@ class TestDifyNodeFactoryCreateNode:
|
||||
(BuiltinNodeTypes.TEMPLATE_TRANSFORM, "TemplateTransformNode"),
|
||||
(BuiltinNodeTypes.HTTP_REQUEST, "HttpRequestNode"),
|
||||
(BuiltinNodeTypes.HUMAN_INPUT, "HumanInputNode"),
|
||||
(BuiltinNodeTypes.TOOL, "ToolNode"),
|
||||
(KNOWLEDGE_INDEX_NODE_TYPE, "KnowledgeIndexNode"),
|
||||
(BuiltinNodeTypes.DATASOURCE, "DatasourceNode"),
|
||||
(BuiltinNodeTypes.KNOWLEDGE_RETRIEVAL, "KnowledgeRetrievalNode"),
|
||||
@@ -580,13 +581,19 @@ class TestDifyNodeFactoryCreateNode:
|
||||
elif constructor_name == "HttpRequestNode":
|
||||
assert kwargs["http_request_config"] is sentinel.http_request_config
|
||||
assert kwargs["http_client"] is sentinel.http_client
|
||||
assert kwargs["tool_file_manager_factory"] is sentinel.tool_file_manager_factory
|
||||
assert kwargs["tool_file_manager_factory"] is factory._bound_tool_file_manager_factory
|
||||
assert kwargs["file_manager"] is sentinel.file_manager
|
||||
assert kwargs["file_reference_factory"] is sentinel.file_reference_factory
|
||||
factory._bound_tool_file_manager_factory.assert_not_called()
|
||||
elif constructor_name == "HumanInputNode":
|
||||
assert kwargs["form_repository"] is form_repository
|
||||
assert kwargs["file_reference_factory"] is sentinel.file_reference_factory
|
||||
assert kwargs["runtime"] is factory._human_input_runtime
|
||||
factory._human_input_runtime.build_form_repository.assert_called_once_with()
|
||||
elif constructor_name == "ToolNode":
|
||||
assert kwargs["tool_file_manager"] is sentinel.tool_file_manager
|
||||
assert kwargs["runtime"] is sentinel.tool_runtime
|
||||
factory._bound_tool_file_manager_factory.assert_called_once_with()
|
||||
elif constructor_name == "DocumentExtractorNode":
|
||||
assert kwargs["unstructured_api_config"] is sentinel.unstructured_api_config
|
||||
assert kwargs["http_client"] is sentinel.http_client
|
||||
|
||||
@@ -4,7 +4,7 @@ from dataclasses import dataclass, field
|
||||
from datetime import datetime, timedelta
|
||||
from typing import Any
|
||||
|
||||
from graphon.nodes.human_input.entities import FormInput
|
||||
from graphon.nodes.human_input.entities import ParagraphInputConfig
|
||||
from graphon.nodes.human_input.enums import TimeoutUnit
|
||||
from libs.datetime_utils import naive_utc_now
|
||||
|
||||
@@ -45,7 +45,7 @@ class HumanInputForm:
|
||||
tenant_id: str
|
||||
app_id: str | None
|
||||
form_content: str
|
||||
inputs: list[FormInput]
|
||||
inputs: list[ParagraphInputConfig]
|
||||
user_actions: list[dict[str, Any]]
|
||||
timeout: int
|
||||
timeout_unit: TimeoutUnit
|
||||
|
||||
@@ -7,8 +7,8 @@ from datetime import timedelta
|
||||
import pytest
|
||||
|
||||
from graphon.nodes.human_input.entities import (
|
||||
FormInput,
|
||||
UserAction,
|
||||
ParagraphInputConfig,
|
||||
UserActionConfig,
|
||||
)
|
||||
from graphon.nodes.human_input.enums import (
|
||||
FormInputType,
|
||||
@@ -50,8 +50,8 @@ class TestFormService:
|
||||
"tenant_id": "tenant-abc",
|
||||
"app_id": "app-def",
|
||||
"form_content": "# Test Form\n\nInput: {{#$output.input#}}",
|
||||
"inputs": [FormInput(type=FormInputType.TEXT_INPUT, output_variable_name="input", default=None)],
|
||||
"user_actions": [UserAction(id="submit", title="Submit")],
|
||||
"inputs": [ParagraphInputConfig(type=FormInputType.PARAGRAPH, output_variable_name="input", default=None)],
|
||||
"user_actions": [UserActionConfig(id="submit", title="Submit")],
|
||||
"timeout": 1,
|
||||
"timeout_unit": TimeoutUnit.HOUR,
|
||||
"form_token": "token-xyz",
|
||||
@@ -304,8 +304,10 @@ class TestFormValidation:
|
||||
"tenant_id": "tenant-abc",
|
||||
"app_id": "app-def",
|
||||
"form_content": "Test form",
|
||||
"inputs": [FormInput(type=FormInputType.TEXT_INPUT, output_variable_name="required_input", default=None)],
|
||||
"user_actions": [UserAction(id="submit", title="Submit")],
|
||||
"inputs": [
|
||||
ParagraphInputConfig(type=FormInputType.PARAGRAPH, output_variable_name="required_input", default=None)
|
||||
],
|
||||
"user_actions": [UserActionConfig(id="submit", title="Submit")],
|
||||
"timeout": 1,
|
||||
"timeout_unit": TimeoutUnit.HOUR,
|
||||
}
|
||||
|
||||
@@ -7,8 +7,8 @@ from datetime import datetime, timedelta
|
||||
import pytest
|
||||
|
||||
from graphon.nodes.human_input.entities import (
|
||||
FormInput,
|
||||
UserAction,
|
||||
ParagraphInputConfig,
|
||||
UserActionConfig,
|
||||
)
|
||||
from graphon.nodes.human_input.enums import (
|
||||
FormInputType,
|
||||
@@ -32,8 +32,8 @@ class TestHumanInputForm:
|
||||
"tenant_id": "tenant-abc",
|
||||
"app_id": "app-def",
|
||||
"form_content": "# Test Form\n\nInput: {{#$output.input#}}",
|
||||
"inputs": [FormInput(type=FormInputType.TEXT_INPUT, output_variable_name="input", default=None)],
|
||||
"user_actions": [UserAction(id="submit", title="Submit")],
|
||||
"inputs": [ParagraphInputConfig(type=FormInputType.PARAGRAPH, output_variable_name="input", default=None)],
|
||||
"user_actions": [UserActionConfig(id="submit", title="Submit")],
|
||||
"timeout": 2,
|
||||
"timeout_unit": TimeoutUnit.HOUR,
|
||||
"form_token": "token-xyz",
|
||||
@@ -132,7 +132,7 @@ class TestHumanInputForm:
|
||||
assert "site" not in response
|
||||
assert response["form_content"] == "# Test Form\n\nInput: {{#$output.input#}}"
|
||||
assert len(response["inputs"]) == 1
|
||||
assert response["inputs"][0]["type"] == "text-input"
|
||||
assert response["inputs"][0]["type"] == "paragraph"
|
||||
assert response["inputs"][0]["output_variable_name"] == "input"
|
||||
|
||||
def test_form_to_response_dict_with_site_info(self, sample_form_data):
|
||||
|
||||
@@ -3,7 +3,7 @@ from __future__ import annotations
|
||||
from datetime import UTC, datetime
|
||||
from types import SimpleNamespace
|
||||
|
||||
from graphon.nodes.human_input.entities import FormDefinition, FormInput, UserAction
|
||||
from graphon.nodes.human_input.entities import FormDefinition, ParagraphInputConfig, UserActionConfig
|
||||
from graphon.nodes.human_input.enums import FormInputType
|
||||
from models.human_input import RecipientType
|
||||
from repositories.sqlalchemy_api_workflow_run_repository import _build_human_input_required_reason
|
||||
@@ -13,8 +13,8 @@ def _build_form_model() -> SimpleNamespace:
|
||||
expiration_time = datetime(2024, 1, 1, tzinfo=UTC)
|
||||
definition = FormDefinition(
|
||||
form_content="content",
|
||||
inputs=[FormInput(type=FormInputType.TEXT_INPUT, output_variable_name="name")],
|
||||
user_actions=[UserAction(id="approve", title="Approve")],
|
||||
inputs=[ParagraphInputConfig(type=FormInputType.PARAGRAPH, output_variable_name="name")],
|
||||
user_actions=[UserActionConfig(id="approve", title="Approve")],
|
||||
rendered_content="rendered",
|
||||
expiration_time=expiration_time,
|
||||
default_values={"name": "Alice"},
|
||||
|
||||
@@ -12,8 +12,8 @@ from core.repositories.human_input_repository import (
|
||||
)
|
||||
from graphon.nodes.human_input.entities import (
|
||||
FormDefinition,
|
||||
FormInput,
|
||||
UserAction,
|
||||
ParagraphInputConfig,
|
||||
UserActionConfig,
|
||||
)
|
||||
from graphon.nodes.human_input.enums import FormInputType, HumanInputFormKind, HumanInputFormStatus
|
||||
from libs.datetime_utils import naive_utc_now
|
||||
@@ -51,7 +51,7 @@ def sample_form_record():
|
||||
definition=FormDefinition(
|
||||
form_content="hello",
|
||||
inputs=[],
|
||||
user_actions=[UserAction(id="submit", title="Submit")],
|
||||
user_actions=[UserActionConfig(id="submit", title="Submit")],
|
||||
rendered_content="<p>hello</p>",
|
||||
expiration_time=naive_utc_now() + timedelta(hours=1),
|
||||
),
|
||||
@@ -280,7 +280,7 @@ def test_submit_form_by_token_missing_inputs(sample_form_record, mock_session_fa
|
||||
|
||||
definition_with_input = FormDefinition(
|
||||
form_content="hello",
|
||||
inputs=[FormInput(type=FormInputType.TEXT_INPUT, output_variable_name="content")],
|
||||
inputs=[ParagraphInputConfig(type=FormInputType.PARAGRAPH, output_variable_name="content")],
|
||||
user_actions=sample_form_record.definition.user_actions,
|
||||
rendered_content="<p>hello</p>",
|
||||
expiration_time=sample_form_record.expiration_time,
|
||||
|
||||
@@ -2833,6 +2833,7 @@ class TestWorkflowServiceFreeNodeExecution:
|
||||
return_value=sentinel.adapted_node_data,
|
||||
) as mock_adapt_node_data,
|
||||
patch("services.workflow_service.build_dify_run_context") as mock_build_dify_run_context,
|
||||
patch("services.workflow_service.DifyFileReferenceFactory") as mock_file_reference_factory_cls,
|
||||
patch("services.workflow_service.DifyHumanInputNodeRuntime") as mock_runtime_cls,
|
||||
patch("services.workflow_service.HumanInputNode") as mock_node_cls,
|
||||
):
|
||||
@@ -2851,10 +2852,14 @@ class TestWorkflowServiceFreeNodeExecution:
|
||||
mock_runtime_cls.assert_called_once_with(mock_build_dify_run_context.return_value)
|
||||
mock_adapt_node_data.assert_called_once_with(node_config["data"])
|
||||
mock_node_cls.validate_node_data.assert_called_once_with(sentinel.adapted_node_data)
|
||||
mock_file_reference_factory_cls.assert_called_once_with(
|
||||
mock_graph_init_context_cls.return_value.to_graph_init_params.return_value.run_context
|
||||
)
|
||||
mock_node_cls.assert_called_once_with(
|
||||
node_id="n-1",
|
||||
data=sentinel.node_data,
|
||||
graph_init_params=mock_graph_init_context_cls.return_value.to_graph_init_params.return_value,
|
||||
graph_runtime_state=ANY,
|
||||
file_reference_factory=mock_file_reference_factory_cls.return_value,
|
||||
runtime=mock_runtime_cls.return_value,
|
||||
)
|
||||
|
||||
8
api/uv.lock
generated
8
api/uv.lock
generated
@@ -1628,7 +1628,7 @@ requires-dist = [
|
||||
{ name = "gmpy2", specifier = ">=2.3.0" },
|
||||
{ name = "google-api-python-client", specifier = ">=2.196.0" },
|
||||
{ name = "google-cloud-aiplatform", specifier = ">=1.151.0,<2.0.0" },
|
||||
{ name = "graphon", specifier = "~=0.3.1" },
|
||||
{ name = "graphon", specifier = "~=0.4.0" },
|
||||
{ name = "gunicorn", specifier = ">=26.0.0" },
|
||||
{ name = "httpx", extras = ["socks"], specifier = ">=0.28.1,<1.0.0" },
|
||||
{ name = "httpx-sse", specifier = "~=0.4.0" },
|
||||
@@ -2984,7 +2984,7 @@ httpx = [
|
||||
|
||||
[[package]]
|
||||
name = "graphon"
|
||||
version = "0.3.1"
|
||||
version = "0.4.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "charset-normalizer" },
|
||||
@@ -3005,9 +3005,9 @@ dependencies = [
|
||||
{ name = "unstructured", extra = ["docx", "epub", "md", "ppt", "pptx"] },
|
||||
{ name = "webvtt-py" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/5a/ef/43217842e84160acca64a95858f1689389a50e04a53fc94f2aa836b4eaf7/graphon-0.3.1.tar.gz", hash = "sha256:49971baed1eb16c8e1983f755e659902e4f117a68dc62fad19e91472950b937d", size = 242210, upload-time = "2026-05-07T06:58:21.879Z" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/76/24/eb1e7983404dcac84816b76ea450e1bb97023e55e00c699d609340bc361e/graphon-0.4.0.tar.gz", hash = "sha256:afb0c7a58f89e09cfa585296429b4d08cd0df80b9ac54d550f88e7d76ec48ee0", size = 261812, upload-time = "2026-05-13T11:48:39.198Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/62/37/bef16ed3d6da7446b36769fa388f4dc79f95337ffa16d6dfc3177152507e/graphon-0.3.1-py3-none-any.whl", hash = "sha256:e6422c7e3f1ce7d2185979c17e08201816ca25d46d400ebdd035c95d501c04fe", size = 349368, upload-time = "2026-05-07T06:58:20.217Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/b7/de/bad6b3fd1e4b4defc16e6ea106e55c44725a159f1d191a99877bce1c9931/graphon-0.4.0-py3-none-any.whl", hash = "sha256:b33f95886da823d5b1b53d663a4f5f8fa383c37740f3bd19297b8d140fcb804c", size = 372711, upload-time = "2026-05-13T11:48:37.712Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
||||
@@ -92,7 +92,7 @@ export type AccountInterfaceLanguagePayload = {
|
||||
}
|
||||
|
||||
export type AccountInterfaceThemePayload = {
|
||||
interface_theme: 'light' | 'dark'
|
||||
interface_theme: 'dark' | 'light'
|
||||
}
|
||||
|
||||
export type AccountNamePayload = {
|
||||
|
||||
@@ -131,7 +131,7 @@ export const zAccountInterfaceLanguagePayload = z.object({
|
||||
* AccountInterfaceThemePayload
|
||||
*/
|
||||
export const zAccountInterfaceThemePayload = z.object({
|
||||
interface_theme: z.enum(['light', 'dark']),
|
||||
interface_theme: z.enum(['dark', 'light']),
|
||||
})
|
||||
|
||||
/**
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -17,7 +17,7 @@ export type CreateAppPayload = {
|
||||
icon?: string | null
|
||||
icon_background?: string | null
|
||||
icon_type?: IconType
|
||||
mode: 'chat' | 'agent-chat' | 'advanced-chat' | 'workflow' | 'completion'
|
||||
mode: 'advanced-chat' | 'agent-chat' | 'chat' | 'completion' | 'workflow'
|
||||
name: string
|
||||
}
|
||||
|
||||
@@ -68,6 +68,10 @@ export type CheckDependenciesResult = {
|
||||
leaked_dependencies?: Array<PluginDependency>
|
||||
}
|
||||
|
||||
export type WorkflowOnlineUsersPayload = {
|
||||
app_ids?: Array<string>
|
||||
}
|
||||
|
||||
export type AppDetailWithSite = {
|
||||
access_mode?: string | null
|
||||
api_base_url?: string | null
|
||||
@@ -104,12 +108,19 @@ export type UpdateAppPayload = {
|
||||
use_icon_as_answer_icon?: boolean | null
|
||||
}
|
||||
|
||||
export type AdvancedChatWorkflowRunPagination = {
|
||||
[key: string]: unknown
|
||||
export type AdvancedChatWorkflowRunPaginationResponse = {
|
||||
data: Array<AdvancedChatWorkflowRunForListResponse>
|
||||
has_more: boolean
|
||||
limit: number
|
||||
}
|
||||
|
||||
export type WorkflowRunCount = {
|
||||
[key: string]: unknown
|
||||
export type WorkflowRunCountResponse = {
|
||||
failed: number
|
||||
partial_succeeded: number
|
||||
running: number
|
||||
stopped: number
|
||||
succeeded: number
|
||||
total: number
|
||||
}
|
||||
|
||||
export type HumanInputFormPreviewPayload = {
|
||||
@@ -309,7 +320,7 @@ export type AppExportResponse = {
|
||||
export type MessageFeedbackPayload = {
|
||||
content?: string | null
|
||||
message_id: string
|
||||
rating?: 'like' | 'dislike' | null
|
||||
rating?: 'dislike' | 'like' | null
|
||||
}
|
||||
|
||||
export type AppIconPayload = {
|
||||
@@ -415,7 +426,7 @@ export type AppSiteUpdatePayload = {
|
||||
copyright?: string | null
|
||||
custom_disclaimer?: string | null
|
||||
customize_domain?: string | null
|
||||
customize_token_strategy?: 'must' | 'allow' | 'not_allow' | null
|
||||
customize_token_strategy?: 'allow' | 'must' | 'not_allow' | null
|
||||
default_language?: string | null
|
||||
description?: string | null
|
||||
icon?: string | null
|
||||
@@ -510,24 +521,63 @@ export type WorkflowArchivedLogPaginationResponse = {
|
||||
total: number
|
||||
}
|
||||
|
||||
export type WorkflowRunPagination = {
|
||||
[key: string]: unknown
|
||||
export type WorkflowRunPaginationResponse = {
|
||||
data: Array<WorkflowRunForListResponse>
|
||||
has_more: boolean
|
||||
limit: number
|
||||
}
|
||||
|
||||
export type WorkflowRunDetail = {
|
||||
[key: string]: unknown
|
||||
export type WorkflowRunDetailResponse = {
|
||||
created_at?: number | null
|
||||
created_by_account?: SimpleAccount
|
||||
created_by_end_user?: SimpleEndUser
|
||||
created_by_role?: string | null
|
||||
elapsed_time?: number | null
|
||||
error?: string | null
|
||||
exceptions_count?: number | null
|
||||
finished_at?: number | null
|
||||
graph: unknown
|
||||
id: string
|
||||
inputs: unknown
|
||||
outputs: unknown
|
||||
status?: string | null
|
||||
total_steps?: number | null
|
||||
total_tokens?: number | null
|
||||
version?: string | null
|
||||
}
|
||||
|
||||
export type WorkflowRunExport = {
|
||||
[key: string]: unknown
|
||||
export type WorkflowRunExportResponse = {
|
||||
presigned_url?: string | null
|
||||
presigned_url_expires_at?: string | null
|
||||
status: string
|
||||
}
|
||||
|
||||
export type WorkflowRunNodeExecutionList = {
|
||||
[key: string]: unknown
|
||||
export type WorkflowRunNodeExecutionListResponse = {
|
||||
data: Array<WorkflowRunNodeExecutionResponse>
|
||||
}
|
||||
|
||||
export type WorkflowCommentBasic = {
|
||||
[key: string]: unknown
|
||||
content?: string
|
||||
created_at?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
created_by?: string
|
||||
created_by_account?: AnonymousInlineModel6Fec07Cd0D85
|
||||
id?: string
|
||||
mention_count?: number
|
||||
participants?: Array<AnonymousInlineModel6Fec07Cd0D85>
|
||||
position_x?: number
|
||||
position_y?: number
|
||||
reply_count?: number
|
||||
resolved?: boolean
|
||||
resolved_at?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
resolved_by?: string
|
||||
resolved_by_account?: AnonymousInlineModel6Fec07Cd0D85
|
||||
updated_at?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
}
|
||||
|
||||
export type WorkflowCommentCreatePayload = {
|
||||
@@ -538,7 +588,10 @@ export type WorkflowCommentCreatePayload = {
|
||||
}
|
||||
|
||||
export type WorkflowCommentCreate = {
|
||||
[key: string]: unknown
|
||||
created_at?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
id?: string
|
||||
}
|
||||
|
||||
export type WorkflowCommentMentionUsersPayload = {
|
||||
@@ -546,7 +599,26 @@ export type WorkflowCommentMentionUsersPayload = {
|
||||
}
|
||||
|
||||
export type WorkflowCommentDetail = {
|
||||
[key: string]: unknown
|
||||
content?: string
|
||||
created_at?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
created_by?: string
|
||||
created_by_account?: AnonymousInlineModel6Fec07Cd0D85
|
||||
id?: string
|
||||
mentions?: Array<AnonymousInlineModelF7Ff64Cce858>
|
||||
position_x?: number
|
||||
position_y?: number
|
||||
replies?: Array<AnonymousInlineModel55C39C6A4B9e>
|
||||
resolved?: boolean
|
||||
resolved_at?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
resolved_by?: string
|
||||
resolved_by_account?: AnonymousInlineModel6Fec07Cd0D85
|
||||
updated_at?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
}
|
||||
|
||||
export type WorkflowCommentUpdatePayload = {
|
||||
@@ -557,7 +629,10 @@ export type WorkflowCommentUpdatePayload = {
|
||||
}
|
||||
|
||||
export type WorkflowCommentUpdate = {
|
||||
[key: string]: unknown
|
||||
id?: string
|
||||
updated_at?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
}
|
||||
|
||||
export type WorkflowCommentReplyPayload = {
|
||||
@@ -566,23 +641,61 @@ export type WorkflowCommentReplyPayload = {
|
||||
}
|
||||
|
||||
export type WorkflowCommentReplyCreate = {
|
||||
[key: string]: unknown
|
||||
created_at?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
id?: string
|
||||
}
|
||||
|
||||
export type WorkflowCommentReplyUpdate = {
|
||||
[key: string]: unknown
|
||||
id?: string
|
||||
updated_at?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
}
|
||||
|
||||
export type WorkflowCommentResolve = {
|
||||
[key: string]: unknown
|
||||
id?: string
|
||||
resolved?: boolean
|
||||
resolved_at?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
resolved_by?: string
|
||||
}
|
||||
|
||||
export type WorkflowPagination = {
|
||||
[key: string]: unknown
|
||||
has_more?: boolean
|
||||
items?: Array<Workflow>
|
||||
limit?: number
|
||||
page?: number
|
||||
}
|
||||
|
||||
export type Workflow = {
|
||||
[key: string]: unknown
|
||||
conversation_variables?: Array<ConversationVariable>
|
||||
created_at?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
created_by?: SimpleAccount
|
||||
environment_variables?: Array<{
|
||||
[key: string]: unknown
|
||||
}>
|
||||
features?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
graph?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
hash?: string
|
||||
id?: string
|
||||
marked_comment?: string
|
||||
marked_name?: string
|
||||
rag_pipeline_variables?: Array<PipelineVariable>
|
||||
tool_published?: boolean
|
||||
updated_at?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
updated_by?: SimpleAccount
|
||||
version?: string
|
||||
}
|
||||
|
||||
export type SyncDraftWorkflowPayload = {
|
||||
@@ -602,11 +715,13 @@ export type SyncDraftWorkflowPayload = {
|
||||
}
|
||||
|
||||
export type SyncDraftWorkflowResponse = {
|
||||
[key: string]: unknown
|
||||
hash?: string
|
||||
result?: string
|
||||
updated_at?: string
|
||||
}
|
||||
|
||||
export type WorkflowDraftVariableList = {
|
||||
[key: string]: unknown
|
||||
items?: Array<WorkflowDraftVariable>
|
||||
}
|
||||
|
||||
export type ConversationVariableUpdatePayload = {
|
||||
@@ -634,8 +749,29 @@ export type HumanInputDeliveryTestPayload = {
|
||||
}
|
||||
}
|
||||
|
||||
export type WorkflowRunNodeExecution = {
|
||||
[key: string]: unknown
|
||||
export type WorkflowRunNodeExecutionResponse = {
|
||||
created_at?: number | null
|
||||
created_by_account?: SimpleAccount
|
||||
created_by_end_user?: SimpleEndUser
|
||||
created_by_role?: string | null
|
||||
elapsed_time?: number | null
|
||||
error?: string | null
|
||||
execution_metadata?: unknown
|
||||
extras?: unknown
|
||||
finished_at?: number | null
|
||||
id: string
|
||||
index?: number | null
|
||||
inputs?: unknown
|
||||
inputs_truncated?: boolean | null
|
||||
node_id?: string | null
|
||||
node_type?: string | null
|
||||
outputs?: unknown
|
||||
outputs_truncated?: boolean | null
|
||||
predecessor_node_id?: string | null
|
||||
process_data?: unknown
|
||||
process_data_truncated?: boolean | null
|
||||
status?: string | null
|
||||
title?: string | null
|
||||
}
|
||||
|
||||
export type DraftWorkflowNodeRunPayload = {
|
||||
@@ -660,7 +796,7 @@ export type DraftWorkflowRunPayload = {
|
||||
}
|
||||
|
||||
export type DraftWorkflowTriggerRunRequest = {
|
||||
[key: string]: unknown
|
||||
node_id: string
|
||||
}
|
||||
|
||||
export type DraftWorkflowTriggerRunAllPayload = {
|
||||
@@ -668,11 +804,28 @@ export type DraftWorkflowTriggerRunAllPayload = {
|
||||
}
|
||||
|
||||
export type WorkflowDraftVariableListWithoutValue = {
|
||||
[key: string]: unknown
|
||||
items?: Array<WorkflowDraftVariableWithoutValue>
|
||||
total?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
}
|
||||
|
||||
export type WorkflowDraftVariable = {
|
||||
[key: string]: unknown
|
||||
description?: string
|
||||
edited?: boolean
|
||||
full_content?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
id?: string
|
||||
is_truncated?: boolean
|
||||
name?: string
|
||||
selector?: Array<string>
|
||||
type?: string
|
||||
value?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
value_type?: string
|
||||
visible?: boolean
|
||||
}
|
||||
|
||||
export type WorkflowDraftVariableUpdatePayload = {
|
||||
@@ -734,33 +887,15 @@ export type AppPartial = {
|
||||
workflow?: WorkflowPartial
|
||||
}
|
||||
|
||||
export type IconType = 'image' | 'emoji' | 'link'
|
||||
export type IconType = 'emoji' | 'image' | 'link'
|
||||
|
||||
export type ModelConfig = {
|
||||
agent_mode_dict?: JsonValue
|
||||
annotation_reply_dict?: JsonValue
|
||||
chat_prompt_config_dict?: JsonValue
|
||||
completion_prompt_config_dict?: JsonValue
|
||||
created_at?: number | null
|
||||
created_by?: string | null
|
||||
dataset_configs_dict?: JsonValue
|
||||
dataset_query_variable?: string | null
|
||||
external_data_tools_list?: JsonValue
|
||||
file_upload_dict?: JsonValue
|
||||
model_dict?: JsonValue
|
||||
more_like_this_dict?: JsonValue
|
||||
opening_statement?: string | null
|
||||
pre_prompt?: string | null
|
||||
prompt_type?: string | null
|
||||
retriever_resource_dict?: JsonValue
|
||||
sensitive_word_avoidance_dict?: JsonValue
|
||||
speech_to_text_dict?: JsonValue
|
||||
suggested_questions_after_answer_dict?: JsonValue
|
||||
suggested_questions_list?: JsonValue
|
||||
text_to_speech_dict?: JsonValue
|
||||
updated_at?: number | null
|
||||
updated_by?: string | null
|
||||
user_input_form_list?: JsonValue
|
||||
completion_params?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
mode: LlmMode
|
||||
name: string
|
||||
provider: string
|
||||
}
|
||||
|
||||
export type Tag = {
|
||||
@@ -779,7 +914,7 @@ export type WorkflowPartial = {
|
||||
updated_by?: string | null
|
||||
}
|
||||
|
||||
export type ImportStatus = 'completed' | 'completed-with-warnings' | 'pending' | 'failed'
|
||||
export type ImportStatus = 'completed' | 'completed-with-warnings' | 'failed' | 'pending'
|
||||
|
||||
export type PluginDependency = {
|
||||
current_identifier?: string | null
|
||||
@@ -818,6 +953,22 @@ export type Site = {
|
||||
use_icon_as_answer_icon?: boolean | null
|
||||
}
|
||||
|
||||
export type AdvancedChatWorkflowRunForListResponse = {
|
||||
conversation_id?: string | null
|
||||
created_at?: number | null
|
||||
created_by_account?: SimpleAccount
|
||||
elapsed_time?: number | null
|
||||
exceptions_count?: number | null
|
||||
finished_at?: number | null
|
||||
id: string
|
||||
message_id?: string | null
|
||||
retry_index?: number | null
|
||||
status?: string | null
|
||||
total_steps?: number | null
|
||||
total_tokens?: number | null
|
||||
version?: string | null
|
||||
}
|
||||
|
||||
export type AnnotationHitHistory = {
|
||||
annotation_content?: string | null
|
||||
annotation_question?: string | null
|
||||
@@ -967,7 +1118,7 @@ export type MessageFile = {
|
||||
url?: string | null
|
||||
}
|
||||
|
||||
export type AppMcpServerStatus = 'normal' | 'active' | 'inactive'
|
||||
export type AppMcpServerStatus = 'active' | 'inactive' | 'normal'
|
||||
|
||||
export type WorkflowAppLogPartialResponse = {
|
||||
created_at?: number | null
|
||||
@@ -989,6 +1140,42 @@ export type WorkflowArchivedLogPartialResponse = {
|
||||
workflow_run?: WorkflowRunForArchivedLogResponse
|
||||
}
|
||||
|
||||
export type WorkflowRunForListResponse = {
|
||||
created_at?: number | null
|
||||
created_by_account?: SimpleAccount
|
||||
elapsed_time?: number | null
|
||||
exceptions_count?: number | null
|
||||
finished_at?: number | null
|
||||
id: string
|
||||
retry_index?: number | null
|
||||
status?: string | null
|
||||
total_steps?: number | null
|
||||
total_tokens?: number | null
|
||||
version?: string | null
|
||||
}
|
||||
|
||||
export type SimpleAccount = {
|
||||
email: string
|
||||
id: string
|
||||
name: string
|
||||
}
|
||||
|
||||
export type SimpleEndUser = {
|
||||
id: string
|
||||
is_anonymous: boolean
|
||||
session_id?: string | null
|
||||
type: string
|
||||
}
|
||||
|
||||
export type AnonymousInlineModel6Fec07Cd0D85 = {
|
||||
avatar_url?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
email?: string
|
||||
id?: string
|
||||
name?: string
|
||||
}
|
||||
|
||||
export type AccountWithRole = {
|
||||
avatar?: string | null
|
||||
created_at?: number | null
|
||||
@@ -1001,6 +1188,63 @@ export type AccountWithRole = {
|
||||
status: string
|
||||
}
|
||||
|
||||
export type AnonymousInlineModelF7Ff64Cce858 = {
|
||||
mentioned_user_account?: AnonymousInlineModel6Fec07Cd0D85
|
||||
mentioned_user_id?: string
|
||||
reply_id?: string
|
||||
}
|
||||
|
||||
export type AnonymousInlineModel55C39C6A4B9e = {
|
||||
content?: string
|
||||
created_at?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
created_by?: string
|
||||
created_by_account?: AnonymousInlineModel6Fec07Cd0D85
|
||||
id?: string
|
||||
}
|
||||
|
||||
export type ConversationVariable = {
|
||||
description?: string
|
||||
id?: string
|
||||
name?: string
|
||||
value?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
value_type?: string
|
||||
}
|
||||
|
||||
export type PipelineVariable = {
|
||||
allow_file_extension?: Array<string>
|
||||
allow_file_upload_methods?: Array<string>
|
||||
allowed_file_types?: Array<string>
|
||||
belong_to_node_id?: string
|
||||
default_value?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
label?: string
|
||||
max_length?: number
|
||||
options?: Array<string>
|
||||
placeholder?: string
|
||||
required?: boolean
|
||||
tooltips?: string
|
||||
type?: string
|
||||
unit?: string
|
||||
variable?: string
|
||||
}
|
||||
|
||||
export type WorkflowDraftVariableWithoutValue = {
|
||||
description?: string
|
||||
edited?: boolean
|
||||
id?: string
|
||||
is_truncated?: boolean
|
||||
name?: string
|
||||
selector?: Array<string>
|
||||
type?: string
|
||||
value_type?: string
|
||||
visible?: boolean
|
||||
}
|
||||
|
||||
export type ModelConfigPartial = {
|
||||
created_at?: number | null
|
||||
created_by?: string | null
|
||||
@@ -1010,6 +1254,8 @@ export type ModelConfigPartial = {
|
||||
updated_by?: string | null
|
||||
}
|
||||
|
||||
export type LlmMode = 'chat' | 'completion'
|
||||
|
||||
export type Type = 'github' | 'marketplace' | 'package'
|
||||
|
||||
export type Github = {
|
||||
@@ -1050,20 +1296,14 @@ export type SimpleMessageDetail = {
|
||||
query: string
|
||||
}
|
||||
|
||||
export type SimpleAccount = {
|
||||
email: string
|
||||
id: string
|
||||
name: string
|
||||
}
|
||||
|
||||
export type HumanInputFormDefinition = {
|
||||
actions?: Array<UserAction>
|
||||
actions?: Array<UserActionConfig>
|
||||
display_in_ui?: boolean
|
||||
expiration_time: number
|
||||
form_content: string
|
||||
form_id: string
|
||||
form_token?: string | null
|
||||
inputs?: Array<FormInput>
|
||||
inputs?: Array<FormInputConfig>
|
||||
node_id: string
|
||||
node_title: string
|
||||
resolved_default_values?: {
|
||||
@@ -1081,13 +1321,6 @@ export type HumanInputFormSubmissionData = {
|
||||
|
||||
export type ExecutionContentType = 'human_input'
|
||||
|
||||
export type SimpleEndUser = {
|
||||
id: string
|
||||
is_anonymous: boolean
|
||||
session_id?: string | null
|
||||
type: string
|
||||
}
|
||||
|
||||
export type WorkflowRunForLogResponse = {
|
||||
created_at?: number | null
|
||||
elapsed_time?: number | null
|
||||
@@ -1110,29 +1343,66 @@ export type WorkflowRunForArchivedLogResponse = {
|
||||
triggered_from?: string | null
|
||||
}
|
||||
|
||||
export type UserAction = {
|
||||
export type UserActionConfig = {
|
||||
button_style?: ButtonStyle
|
||||
id: string
|
||||
title: string
|
||||
}
|
||||
|
||||
export type FormInput = {
|
||||
default?: FormInputDefault
|
||||
export type FormInputConfig
|
||||
= | ParagraphInputConfig
|
||||
| SelectInputConfig
|
||||
| FileInputConfig
|
||||
| FileListInputConfig
|
||||
|
||||
export type ButtonStyle = 'accent' | 'default' | 'ghost' | 'primary'
|
||||
|
||||
export type ParagraphInputConfig = {
|
||||
default?: StringSource
|
||||
output_variable_name: string
|
||||
type: FormInputType
|
||||
type?: string
|
||||
}
|
||||
|
||||
export type ButtonStyle = 'primary' | 'default' | 'accent' | 'ghost'
|
||||
export type SelectInputConfig = {
|
||||
option_source: StringListSource
|
||||
output_variable_name: string
|
||||
type?: string
|
||||
}
|
||||
|
||||
export type FormInputDefault = {
|
||||
export type FileInputConfig = {
|
||||
allowed_file_extensions?: Array<string>
|
||||
allowed_file_types?: Array<FileType>
|
||||
allowed_file_upload_methods?: Array<FileTransferMethod>
|
||||
output_variable_name: string
|
||||
type?: string
|
||||
}
|
||||
|
||||
export type FileListInputConfig = {
|
||||
allowed_file_extensions?: Array<string>
|
||||
allowed_file_types?: Array<FileType>
|
||||
allowed_file_upload_methods?: Array<FileTransferMethod>
|
||||
number_limits?: number
|
||||
output_variable_name: string
|
||||
type?: string
|
||||
}
|
||||
|
||||
export type StringSource = {
|
||||
selector?: Array<string>
|
||||
type: PlaceholderType
|
||||
type: ValueSourceType
|
||||
value?: string
|
||||
}
|
||||
|
||||
export type FormInputType = 'text_input' | 'paragraph'
|
||||
export type StringListSource = {
|
||||
selector?: Array<string>
|
||||
type: ValueSourceType
|
||||
value?: Array<string>
|
||||
}
|
||||
|
||||
export type PlaceholderType = 'variable' | 'constant'
|
||||
export type FileType = 'audio' | 'custom' | 'document' | 'image' | 'video'
|
||||
|
||||
export type FileTransferMethod = 'datasource_file' | 'local_file' | 'remote_url' | 'tool_file'
|
||||
|
||||
export type ValueSourceType = 'constant' | 'variable'
|
||||
|
||||
export type GetAppsData = {
|
||||
body?: never
|
||||
@@ -1140,7 +1410,7 @@ export type GetAppsData = {
|
||||
query?: {
|
||||
is_created_by_me?: boolean | null
|
||||
limit?: number
|
||||
mode?: 'completion' | 'chat' | 'advanced-chat' | 'workflow' | 'agent-chat' | 'channel' | 'all'
|
||||
mode?: 'advanced-chat' | 'agent-chat' | 'all' | 'channel' | 'chat' | 'completion' | 'workflow'
|
||||
name?: string | null
|
||||
page?: number
|
||||
tag_ids?: Array<string> | null
|
||||
@@ -1237,23 +1507,21 @@ export type PostAppsImportsByImportIdConfirmResponses = {
|
||||
export type PostAppsImportsByImportIdConfirmResponse
|
||||
= PostAppsImportsByImportIdConfirmResponses[keyof PostAppsImportsByImportIdConfirmResponses]
|
||||
|
||||
export type GetAppsWorkflowsOnlineUsersData = {
|
||||
body?: never
|
||||
export type PostAppsWorkflowsOnlineUsersData = {
|
||||
body: WorkflowOnlineUsersPayload
|
||||
path?: never
|
||||
query: {
|
||||
app_ids: string
|
||||
}
|
||||
query?: never
|
||||
url: '/apps/workflows/online-users'
|
||||
}
|
||||
|
||||
export type GetAppsWorkflowsOnlineUsersResponses = {
|
||||
export type PostAppsWorkflowsOnlineUsersResponses = {
|
||||
200: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
}
|
||||
|
||||
export type GetAppsWorkflowsOnlineUsersResponse
|
||||
= GetAppsWorkflowsOnlineUsersResponses[keyof GetAppsWorkflowsOnlineUsersResponses]
|
||||
export type PostAppsWorkflowsOnlineUsersResponse
|
||||
= PostAppsWorkflowsOnlineUsersResponses[keyof PostAppsWorkflowsOnlineUsersResponses]
|
||||
|
||||
export type DeleteAppsByAppIdData = {
|
||||
body?: never
|
||||
@@ -1327,16 +1595,16 @@ export type GetAppsByAppIdAdvancedChatWorkflowRunsData = {
|
||||
app_id: string
|
||||
}
|
||||
query?: {
|
||||
triggered_from?: 'debugging' | 'app-run' | null
|
||||
status?: 'running' | 'succeeded' | 'failed' | 'stopped' | 'partial-succeeded' | null
|
||||
last_id?: string | null
|
||||
last_id?: string
|
||||
limit?: number
|
||||
status?: 'failed' | 'partial-succeeded' | 'running' | 'stopped' | 'succeeded'
|
||||
triggered_from?: 'app-run' | 'debugging'
|
||||
}
|
||||
url: '/apps/{app_id}/advanced-chat/workflow-runs'
|
||||
}
|
||||
|
||||
export type GetAppsByAppIdAdvancedChatWorkflowRunsResponses = {
|
||||
200: AdvancedChatWorkflowRunPagination
|
||||
200: AdvancedChatWorkflowRunPaginationResponse
|
||||
}
|
||||
|
||||
export type GetAppsByAppIdAdvancedChatWorkflowRunsResponse
|
||||
@@ -1348,15 +1616,15 @@ export type GetAppsByAppIdAdvancedChatWorkflowRunsCountData = {
|
||||
app_id: string
|
||||
}
|
||||
query?: {
|
||||
triggered_from?: 'debugging' | 'app-run' | null
|
||||
time_range?: string | null
|
||||
status?: 'running' | 'succeeded' | 'failed' | 'stopped' | 'partial-succeeded' | null
|
||||
status?: 'failed' | 'partial-succeeded' | 'running' | 'stopped' | 'succeeded'
|
||||
time_range?: string
|
||||
triggered_from?: 'app-run' | 'debugging'
|
||||
}
|
||||
url: '/apps/{app_id}/advanced-chat/workflow-runs/count'
|
||||
}
|
||||
|
||||
export type GetAppsByAppIdAdvancedChatWorkflowRunsCountResponses = {
|
||||
200: WorkflowRunCount
|
||||
200: WorkflowRunCountResponse
|
||||
}
|
||||
|
||||
export type GetAppsByAppIdAdvancedChatWorkflowRunsCountResponse
|
||||
@@ -1525,8 +1793,8 @@ export type GetAppsByAppIdAgentLogsResponse
|
||||
export type PostAppsByAppIdAnnotationReplyByActionData = {
|
||||
body: AnnotationReplyPayload
|
||||
path: {
|
||||
app_id: string
|
||||
action: string
|
||||
app_id: string
|
||||
}
|
||||
query?: never
|
||||
url: '/apps/{app_id}/annotation-reply/{action}'
|
||||
@@ -1553,8 +1821,8 @@ export type PostAppsByAppIdAnnotationReplyByActionResponse
|
||||
export type GetAppsByAppIdAnnotationReplyByActionStatusByJobIdData = {
|
||||
body?: never
|
||||
path: {
|
||||
app_id: string
|
||||
action: string
|
||||
app_id: string
|
||||
job_id: string
|
||||
}
|
||||
query?: never
|
||||
@@ -1609,8 +1877,8 @@ export type GetAppsByAppIdAnnotationSettingResponse
|
||||
export type PostAppsByAppIdAnnotationSettingsByAnnotationSettingIdData = {
|
||||
body: AnnotationSettingUpdatePayload
|
||||
path: {
|
||||
app_id: string
|
||||
annotation_setting_id: string
|
||||
app_id: string
|
||||
}
|
||||
query?: never
|
||||
url: '/apps/{app_id}/annotation-settings/{annotation_setting_id}'
|
||||
@@ -1835,8 +2103,8 @@ export type DeleteAppsByAppIdAnnotationsByAnnotationIdResponse
|
||||
export type PostAppsByAppIdAnnotationsByAnnotationIdData = {
|
||||
body: UpdateAnnotationPayload
|
||||
path: {
|
||||
app_id: string
|
||||
annotation_id: string
|
||||
app_id: string
|
||||
}
|
||||
query?: never
|
||||
url: '/apps/{app_id}/annotations/{annotation_id}'
|
||||
@@ -1864,12 +2132,12 @@ export type PostAppsByAppIdAnnotationsByAnnotationIdResponse
|
||||
export type GetAppsByAppIdAnnotationsByAnnotationIdHitHistoriesData = {
|
||||
body?: never
|
||||
path: {
|
||||
app_id: string
|
||||
annotation_id: string
|
||||
app_id: string
|
||||
}
|
||||
query?: {
|
||||
page?: number
|
||||
limit?: number
|
||||
page?: number
|
||||
}
|
||||
url: '/apps/{app_id}/annotations/{annotation_id}/hit-histories'
|
||||
}
|
||||
@@ -1949,12 +2217,12 @@ export type GetAppsByAppIdChatConversationsData = {
|
||||
app_id: string
|
||||
}
|
||||
query?: {
|
||||
annotation_status?: 'annotated' | 'not_annotated' | 'all'
|
||||
annotation_status?: 'all' | 'annotated' | 'not_annotated'
|
||||
end?: string | null
|
||||
keyword?: string | null
|
||||
limit?: number
|
||||
page?: number
|
||||
sort_by?: 'created_at' | '-created_at' | 'updated_at' | '-updated_at'
|
||||
sort_by?: '-created_at' | '-updated_at' | 'created_at' | 'updated_at'
|
||||
start?: string | null
|
||||
}
|
||||
url: '/apps/{app_id}/chat-conversations'
|
||||
@@ -2116,7 +2384,7 @@ export type GetAppsByAppIdCompletionConversationsData = {
|
||||
app_id: string
|
||||
}
|
||||
query?: {
|
||||
annotation_status?: 'annotated' | 'not_annotated' | 'all'
|
||||
annotation_status?: 'all' | 'annotated' | 'not_annotated'
|
||||
end?: string | null
|
||||
keyword?: string | null
|
||||
limit?: number
|
||||
@@ -2388,9 +2656,9 @@ export type GetAppsByAppIdFeedbacksExportData = {
|
||||
query?: {
|
||||
end_date?: string | null
|
||||
format?: 'csv' | 'json'
|
||||
from_source?: 'user' | 'admin' | null
|
||||
from_source?: 'admin' | 'user' | null
|
||||
has_comment?: boolean | null
|
||||
rating?: 'like' | 'dislike' | null
|
||||
rating?: 'dislike' | 'like' | null
|
||||
start_date?: string | null
|
||||
}
|
||||
url: '/apps/{app_id}/feedbacks/export'
|
||||
@@ -3149,16 +3417,16 @@ export type GetAppsByAppIdWorkflowRunsData = {
|
||||
app_id: string
|
||||
}
|
||||
query?: {
|
||||
triggered_from?: 'debugging' | 'app-run' | null
|
||||
status?: 'running' | 'succeeded' | 'failed' | 'stopped' | 'partial-succeeded' | null
|
||||
last_id?: string | null
|
||||
last_id?: string
|
||||
limit?: number
|
||||
status?: 'failed' | 'partial-succeeded' | 'running' | 'stopped' | 'succeeded'
|
||||
triggered_from?: 'app-run' | 'debugging'
|
||||
}
|
||||
url: '/apps/{app_id}/workflow-runs'
|
||||
}
|
||||
|
||||
export type GetAppsByAppIdWorkflowRunsResponses = {
|
||||
200: WorkflowRunPagination
|
||||
200: WorkflowRunPaginationResponse
|
||||
}
|
||||
|
||||
export type GetAppsByAppIdWorkflowRunsResponse
|
||||
@@ -3170,15 +3438,15 @@ export type GetAppsByAppIdWorkflowRunsCountData = {
|
||||
app_id: string
|
||||
}
|
||||
query?: {
|
||||
triggered_from?: 'debugging' | 'app-run' | null
|
||||
time_range?: string | null
|
||||
status?: 'running' | 'succeeded' | 'failed' | 'stopped' | 'partial-succeeded' | null
|
||||
status?: 'failed' | 'partial-succeeded' | 'running' | 'stopped' | 'succeeded'
|
||||
time_range?: string
|
||||
triggered_from?: 'app-run' | 'debugging'
|
||||
}
|
||||
url: '/apps/{app_id}/workflow-runs/count'
|
||||
}
|
||||
|
||||
export type GetAppsByAppIdWorkflowRunsCountResponses = {
|
||||
200: WorkflowRunCount
|
||||
200: WorkflowRunCountResponse
|
||||
}
|
||||
|
||||
export type GetAppsByAppIdWorkflowRunsCountResponse
|
||||
@@ -3235,7 +3503,7 @@ export type GetAppsByAppIdWorkflowRunsByRunIdError
|
||||
= GetAppsByAppIdWorkflowRunsByRunIdErrors[keyof GetAppsByAppIdWorkflowRunsByRunIdErrors]
|
||||
|
||||
export type GetAppsByAppIdWorkflowRunsByRunIdResponses = {
|
||||
200: WorkflowRunDetail
|
||||
200: WorkflowRunDetailResponse
|
||||
}
|
||||
|
||||
export type GetAppsByAppIdWorkflowRunsByRunIdResponse
|
||||
@@ -3252,7 +3520,7 @@ export type GetAppsByAppIdWorkflowRunsByRunIdExportData = {
|
||||
}
|
||||
|
||||
export type GetAppsByAppIdWorkflowRunsByRunIdExportResponses = {
|
||||
200: WorkflowRunExport
|
||||
200: WorkflowRunExportResponse
|
||||
}
|
||||
|
||||
export type GetAppsByAppIdWorkflowRunsByRunIdExportResponse
|
||||
@@ -3278,7 +3546,7 @@ export type GetAppsByAppIdWorkflowRunsByRunIdNodeExecutionsError
|
||||
= GetAppsByAppIdWorkflowRunsByRunIdNodeExecutionsErrors[keyof GetAppsByAppIdWorkflowRunsByRunIdNodeExecutionsErrors]
|
||||
|
||||
export type GetAppsByAppIdWorkflowRunsByRunIdNodeExecutionsResponses = {
|
||||
200: WorkflowRunNodeExecutionList
|
||||
200: WorkflowRunNodeExecutionListResponse
|
||||
}
|
||||
|
||||
export type GetAppsByAppIdWorkflowRunsByRunIdNodeExecutionsResponse
|
||||
@@ -3911,7 +4179,7 @@ export type GetAppsByAppIdWorkflowsDraftNodesByNodeIdLastRunError
|
||||
= GetAppsByAppIdWorkflowsDraftNodesByNodeIdLastRunErrors[keyof GetAppsByAppIdWorkflowsDraftNodesByNodeIdLastRunErrors]
|
||||
|
||||
export type GetAppsByAppIdWorkflowsDraftNodesByNodeIdLastRunResponses = {
|
||||
200: WorkflowRunNodeExecution
|
||||
200: WorkflowRunNodeExecutionResponse
|
||||
}
|
||||
|
||||
export type GetAppsByAppIdWorkflowsDraftNodesByNodeIdLastRunResponse
|
||||
@@ -3940,7 +4208,7 @@ export type PostAppsByAppIdWorkflowsDraftNodesByNodeIdRunError
|
||||
= PostAppsByAppIdWorkflowsDraftNodesByNodeIdRunErrors[keyof PostAppsByAppIdWorkflowsDraftNodesByNodeIdRunErrors]
|
||||
|
||||
export type PostAppsByAppIdWorkflowsDraftNodesByNodeIdRunResponses = {
|
||||
200: WorkflowRunNodeExecution
|
||||
200: WorkflowRunNodeExecutionResponse
|
||||
}
|
||||
|
||||
export type PostAppsByAppIdWorkflowsDraftNodesByNodeIdRunResponse
|
||||
@@ -3980,8 +4248,8 @@ export type PostAppsByAppIdWorkflowsDraftNodesByNodeIdTriggerRunResponse
|
||||
export type DeleteAppsByAppIdWorkflowsDraftNodesByNodeIdVariablesData = {
|
||||
body?: never
|
||||
path: {
|
||||
node_id: string
|
||||
app_id: string
|
||||
node_id: string
|
||||
}
|
||||
query?: never
|
||||
url: '/apps/{app_id}/workflows/draft/nodes/{node_id}/variables'
|
||||
@@ -4140,8 +4408,8 @@ export type GetAppsByAppIdWorkflowsDraftVariablesData = {
|
||||
app_id: string
|
||||
}
|
||||
query?: {
|
||||
page?: number
|
||||
limit?: number
|
||||
page?: number
|
||||
}
|
||||
url: '/apps/{app_id}/workflows/draft/variables'
|
||||
}
|
||||
@@ -4156,8 +4424,8 @@ export type GetAppsByAppIdWorkflowsDraftVariablesResponse
|
||||
export type DeleteAppsByAppIdWorkflowsDraftVariablesByVariableIdData = {
|
||||
body?: never
|
||||
path: {
|
||||
variable_id: string
|
||||
app_id: string
|
||||
variable_id: string
|
||||
}
|
||||
query?: never
|
||||
url: '/apps/{app_id}/workflows/draft/variables/{variable_id}'
|
||||
@@ -4210,8 +4478,8 @@ export type GetAppsByAppIdWorkflowsDraftVariablesByVariableIdResponse
|
||||
export type PatchAppsByAppIdWorkflowsDraftVariablesByVariableIdData = {
|
||||
body: WorkflowDraftVariableUpdatePayload
|
||||
path: {
|
||||
variable_id: string
|
||||
app_id: string
|
||||
variable_id: string
|
||||
}
|
||||
query?: never
|
||||
url: '/apps/{app_id}/workflows/draft/variables/{variable_id}'
|
||||
@@ -4328,8 +4596,8 @@ export type GetAppsByAppIdWorkflowsTriggersWebhookResponse
|
||||
export type DeleteAppsByAppIdWorkflowsByWorkflowIdData = {
|
||||
body?: never
|
||||
path: {
|
||||
workflow_id: string
|
||||
app_id: string
|
||||
workflow_id: string
|
||||
}
|
||||
query?: never
|
||||
url: '/apps/{app_id}/workflows/{workflow_id}'
|
||||
@@ -4448,8 +4716,8 @@ export type PostAppsByResourceIdApiKeysResponse
|
||||
export type DeleteAppsByResourceIdApiKeysByApiKeyIdData = {
|
||||
body?: never
|
||||
path: {
|
||||
resource_id: string
|
||||
api_key_id: string
|
||||
resource_id: string
|
||||
}
|
||||
query?: never
|
||||
url: '/apps/{resource_id}/api-keys/{api_key_id}'
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -39,8 +39,8 @@ export type PatchDataSourceIntegratesResponse
|
||||
export type GetDataSourceIntegratesByBindingIdByActionData = {
|
||||
body?: never
|
||||
path: {
|
||||
binding_id: string
|
||||
action: string
|
||||
binding_id: string
|
||||
}
|
||||
query?: never
|
||||
url: '/data-source/integrates/{binding_id}/{action}'
|
||||
@@ -58,8 +58,8 @@ export type GetDataSourceIntegratesByBindingIdByActionResponse
|
||||
export type PatchDataSourceIntegratesByBindingIdByActionData = {
|
||||
body?: never
|
||||
path: {
|
||||
binding_id: string
|
||||
action: string
|
||||
binding_id: string
|
||||
}
|
||||
query?: never
|
||||
url: '/data-source/integrates/{binding_id}/{action}'
|
||||
|
||||
@@ -13,8 +13,8 @@ export const zGetDataSourceIntegratesResponse = z.record(z.string(), z.unknown()
|
||||
export const zPatchDataSourceIntegratesResponse = z.record(z.string(), z.unknown())
|
||||
|
||||
export const zGetDataSourceIntegratesByBindingIdByActionPath = z.object({
|
||||
binding_id: z.string(),
|
||||
action: z.string(),
|
||||
binding_id: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
@@ -23,8 +23,8 @@ export const zGetDataSourceIntegratesByBindingIdByActionPath = z.object({
|
||||
export const zGetDataSourceIntegratesByBindingIdByActionResponse = z.record(z.string(), z.unknown())
|
||||
|
||||
export const zPatchDataSourceIntegratesByBindingIdByActionPath = z.object({
|
||||
binding_id: z.string(),
|
||||
action: z.string(),
|
||||
binding_id: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
|
||||
@@ -41,7 +41,45 @@ export type ExternalDatasetCreatePayload = {
|
||||
}
|
||||
|
||||
export type DatasetDetail = {
|
||||
[key: string]: unknown
|
||||
app_count?: number
|
||||
author_name?: string
|
||||
built_in_field_enabled?: boolean
|
||||
chunk_structure?: string
|
||||
created_at?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
created_by?: string
|
||||
data_source_type?: string
|
||||
description?: string
|
||||
doc_form?: string
|
||||
doc_metadata?: Array<DatasetDocMetadata>
|
||||
document_count?: number
|
||||
embedding_available?: boolean
|
||||
embedding_model?: string
|
||||
embedding_model_provider?: string
|
||||
enable_api?: boolean
|
||||
external_knowledge_info?: ExternalKnowledgeInfo
|
||||
external_retrieval_model?: ExternalRetrievalModel
|
||||
icon_info?: DatasetIconInfo
|
||||
id?: string
|
||||
indexing_technique?: string
|
||||
is_multimodal?: boolean
|
||||
is_published?: boolean
|
||||
name?: string
|
||||
permission?: string
|
||||
pipeline_id?: string
|
||||
provider?: string
|
||||
retrieval_model_dict?: DatasetRetrievalModel
|
||||
runtime_mode?: string
|
||||
summary_index_setting?: AnonymousInlineModelB1954337D565
|
||||
tags?: Array<Tag>
|
||||
total_available_documents?: number
|
||||
total_documents?: number
|
||||
updated_at?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
updated_by?: string
|
||||
word_count?: number
|
||||
}
|
||||
|
||||
export type ExternalKnowledgeApiPayload = {
|
||||
@@ -71,7 +109,7 @@ export type KnowledgeConfig = {
|
||||
duplicate?: boolean
|
||||
embedding_model?: string | null
|
||||
embedding_model_provider?: string | null
|
||||
indexing_technique: 'high_quality' | 'economy'
|
||||
indexing_technique: 'economy' | 'high_quality'
|
||||
is_multimodal?: boolean
|
||||
name?: string | null
|
||||
original_document_id?: string | null
|
||||
@@ -224,7 +262,7 @@ export type HitTestingResponse = {
|
||||
|
||||
export type MetadataArgs = {
|
||||
name: string
|
||||
type: 'string' | 'number' | 'time'
|
||||
type: 'number' | 'string' | 'time'
|
||||
}
|
||||
|
||||
export type MetadataUpdatePayload = {
|
||||
@@ -232,18 +270,77 @@ export type MetadataUpdatePayload = {
|
||||
}
|
||||
|
||||
export type DatasetQueryDetail = {
|
||||
[key: string]: unknown
|
||||
created_at?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
created_by?: string
|
||||
created_by_role?: string
|
||||
id?: string
|
||||
queries?: DatasetContent
|
||||
source?: string
|
||||
source_app_id?: string
|
||||
}
|
||||
|
||||
export type RelatedAppList = {
|
||||
[key: string]: unknown
|
||||
data?: Array<AppDetailKernel>
|
||||
total?: number
|
||||
}
|
||||
|
||||
export type DocumentRetryPayload = {
|
||||
document_ids: Array<string>
|
||||
}
|
||||
|
||||
export type DatasetPermissionEnum = 'only_me' | 'all_team_members' | 'partial_members'
|
||||
export type DatasetPermissionEnum = 'all_team_members' | 'only_me' | 'partial_members'
|
||||
|
||||
export type DatasetDocMetadata = {
|
||||
id?: string
|
||||
name?: string
|
||||
type?: string
|
||||
}
|
||||
|
||||
export type ExternalKnowledgeInfo = {
|
||||
external_knowledge_api_endpoint?: string
|
||||
external_knowledge_api_id?: string
|
||||
external_knowledge_api_name?: string
|
||||
external_knowledge_id?: string
|
||||
}
|
||||
|
||||
export type ExternalRetrievalModel = {
|
||||
score_threshold?: number
|
||||
score_threshold_enabled?: boolean
|
||||
top_k?: number
|
||||
}
|
||||
|
||||
export type DatasetIconInfo = {
|
||||
icon?: string
|
||||
icon_background?: string
|
||||
icon_type?: string
|
||||
icon_url?: string
|
||||
}
|
||||
|
||||
export type DatasetRetrievalModel = {
|
||||
reranking_enable?: boolean
|
||||
reranking_mode?: string
|
||||
reranking_model?: DatasetRerankingModel
|
||||
score_threshold?: number
|
||||
score_threshold_enabled?: boolean
|
||||
search_method?: string
|
||||
top_k?: number
|
||||
weights?: DatasetWeightedScore
|
||||
}
|
||||
|
||||
export type AnonymousInlineModelB1954337D565 = {
|
||||
enable?: boolean
|
||||
model_name?: string
|
||||
model_provider_name?: string
|
||||
summary_prompt?: string
|
||||
}
|
||||
|
||||
export type Tag = {
|
||||
id: string
|
||||
name: string
|
||||
type: string
|
||||
}
|
||||
|
||||
export type DataSource = {
|
||||
info_list: InfoList
|
||||
@@ -299,8 +396,38 @@ export type HitTestingRecord = {
|
||||
tsne_position?: unknown
|
||||
}
|
||||
|
||||
export type DatasetContent = {
|
||||
content?: string
|
||||
content_type?: string
|
||||
file_info?: DatasetFileInfo
|
||||
}
|
||||
|
||||
export type AppDetailKernel = {
|
||||
description?: string
|
||||
icon?: string
|
||||
icon_background?: string
|
||||
icon_type?: string
|
||||
icon_url?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
id?: string
|
||||
mode?: string
|
||||
name?: string
|
||||
}
|
||||
|
||||
export type DatasetRerankingModel = {
|
||||
reranking_model_name?: string
|
||||
reranking_provider_name?: string
|
||||
}
|
||||
|
||||
export type DatasetWeightedScore = {
|
||||
keyword_setting?: DatasetKeywordSetting
|
||||
vector_setting?: DatasetVectorSetting
|
||||
weight_type?: string
|
||||
}
|
||||
|
||||
export type InfoList = {
|
||||
data_source_type: 'upload_file' | 'notion_import' | 'website_crawl'
|
||||
data_source_type: 'notion_import' | 'upload_file' | 'website_crawl'
|
||||
file_info_list?: FileInfo
|
||||
notion_info_list?: Array<NotionInfo> | null
|
||||
website_info_list?: WebsiteInfo
|
||||
@@ -324,15 +451,15 @@ export type RerankingModel = {
|
||||
}
|
||||
|
||||
export type RetrievalMethod
|
||||
= | 'semantic_search'
|
||||
| 'full_text_search'
|
||||
= | 'full_text_search'
|
||||
| 'hybrid_search'
|
||||
| 'keyword_search'
|
||||
| 'semantic_search'
|
||||
|
||||
export type WeightModel = {
|
||||
keyword_setting?: WeightKeywordSetting
|
||||
vector_setting?: WeightVectorSetting
|
||||
weight_type?: 'semantic_first' | 'keyword_first' | 'customized' | null
|
||||
weight_type?: 'customized' | 'keyword_first' | 'semantic_first' | null
|
||||
}
|
||||
|
||||
export type MetadataDetail = {
|
||||
@@ -383,6 +510,25 @@ export type HitTestingSegment = {
|
||||
word_count?: number | null
|
||||
}
|
||||
|
||||
export type DatasetFileInfo = {
|
||||
extension?: string
|
||||
id?: string
|
||||
mime_type?: string
|
||||
name?: string
|
||||
size?: number
|
||||
source_url?: string
|
||||
}
|
||||
|
||||
export type DatasetKeywordSetting = {
|
||||
keyword_weight?: number
|
||||
}
|
||||
|
||||
export type DatasetVectorSetting = {
|
||||
embedding_model_name?: string
|
||||
embedding_provider_name?: string
|
||||
vector_weight?: number
|
||||
}
|
||||
|
||||
export type FileInfo = {
|
||||
file_ids: Array<string>
|
||||
}
|
||||
@@ -413,24 +559,24 @@ export type Segmentation = {
|
||||
|
||||
export type Condition = {
|
||||
comparison_operator:
|
||||
| '<'
|
||||
| '='
|
||||
| '>'
|
||||
| 'after'
|
||||
| 'before'
|
||||
| 'contains'
|
||||
| 'not contains'
|
||||
| 'start with'
|
||||
| 'empty'
|
||||
| 'end with'
|
||||
| 'in'
|
||||
| 'is'
|
||||
| 'is not'
|
||||
| 'empty'
|
||||
| 'not contains'
|
||||
| 'not empty'
|
||||
| 'in'
|
||||
| 'not in'
|
||||
| '='
|
||||
| 'start with'
|
||||
| '≠'
|
||||
| '>'
|
||||
| '<'
|
||||
| '≥'
|
||||
| '≤'
|
||||
| 'before'
|
||||
| 'after'
|
||||
| '≥'
|
||||
name: string
|
||||
value?: unknown
|
||||
}
|
||||
@@ -470,12 +616,12 @@ export type GetDatasetsData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: {
|
||||
page?: string
|
||||
limit?: string
|
||||
ids?: string
|
||||
keyword?: string
|
||||
tag_ids?: string
|
||||
include_all?: string
|
||||
keyword?: string
|
||||
limit?: string
|
||||
page?: string
|
||||
tag_ids?: string
|
||||
}
|
||||
url: '/datasets'
|
||||
}
|
||||
@@ -646,9 +792,9 @@ export type GetDatasetsExternalKnowledgeApiData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: {
|
||||
page?: string
|
||||
limit?: string
|
||||
keyword?: string
|
||||
limit?: string
|
||||
page?: string
|
||||
}
|
||||
url: '/datasets/external-knowledge-api'
|
||||
}
|
||||
@@ -1019,8 +1165,8 @@ export type GetDatasetsByDatasetIdAutoDisableLogsResponse
|
||||
export type GetDatasetsByDatasetIdBatchByBatchIndexingEstimateData = {
|
||||
body?: never
|
||||
path: {
|
||||
dataset_id: string
|
||||
batch: string
|
||||
dataset_id: string
|
||||
}
|
||||
query?: never
|
||||
url: '/datasets/{dataset_id}/batch/{batch}/indexing-estimate'
|
||||
@@ -1038,8 +1184,8 @@ export type GetDatasetsByDatasetIdBatchByBatchIndexingEstimateResponse
|
||||
export type GetDatasetsByDatasetIdBatchByBatchIndexingStatusData = {
|
||||
body?: never
|
||||
path: {
|
||||
dataset_id: string
|
||||
batch: string
|
||||
dataset_id: string
|
||||
}
|
||||
query?: never
|
||||
url: '/datasets/{dataset_id}/batch/{batch}/indexing-status'
|
||||
@@ -1078,11 +1224,11 @@ export type GetDatasetsByDatasetIdDocumentsData = {
|
||||
dataset_id: string
|
||||
}
|
||||
query?: {
|
||||
page?: string
|
||||
limit?: string
|
||||
keyword?: string
|
||||
sort?: string
|
||||
fetch?: string
|
||||
keyword?: string
|
||||
limit?: string
|
||||
page?: string
|
||||
sort?: string
|
||||
status?: string
|
||||
}
|
||||
url: '/datasets/{dataset_id}/documents'
|
||||
@@ -1185,8 +1331,8 @@ export type PostDatasetsByDatasetIdDocumentsMetadataResponse
|
||||
export type PatchDatasetsByDatasetIdDocumentsStatusByActionBatchData = {
|
||||
body?: never
|
||||
path: {
|
||||
dataset_id: string
|
||||
action: string
|
||||
dataset_id: string
|
||||
}
|
||||
query?: never
|
||||
url: '/datasets/{dataset_id}/documents/status/{action}/batch'
|
||||
@@ -1204,8 +1350,8 @@ export type PatchDatasetsByDatasetIdDocumentsStatusByActionBatchResponse
|
||||
export type DeleteDatasetsByDatasetIdDocumentsByDocumentIdData = {
|
||||
body?: never
|
||||
path: {
|
||||
document_id: string
|
||||
dataset_id: string
|
||||
document_id: string
|
||||
}
|
||||
query?: never
|
||||
url: '/datasets/{dataset_id}/documents/{document_id}'
|
||||
@@ -1438,9 +1584,9 @@ export type PatchDatasetsByDatasetIdDocumentsByDocumentIdProcessingResumeRespons
|
||||
export type PatchDatasetsByDatasetIdDocumentsByDocumentIdProcessingByActionData = {
|
||||
body?: never
|
||||
path: {
|
||||
action: string
|
||||
dataset_id: string
|
||||
document_id: string
|
||||
action: string
|
||||
}
|
||||
query?: never
|
||||
url: '/datasets/{dataset_id}/documents/{document_id}/processing/{action}'
|
||||
@@ -1506,9 +1652,9 @@ export type PostDatasetsByDatasetIdDocumentsByDocumentIdSegmentResponse
|
||||
export type PatchDatasetsByDatasetIdDocumentsByDocumentIdSegmentByActionData = {
|
||||
body?: never
|
||||
path: {
|
||||
action: string
|
||||
dataset_id: string
|
||||
document_id: string
|
||||
action: string
|
||||
}
|
||||
query?: never
|
||||
url: '/datasets/{dataset_id}/documents/{document_id}/segment/{action}'
|
||||
@@ -1703,10 +1849,10 @@ export type DeleteDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChi
|
||||
= {
|
||||
body?: never
|
||||
path: {
|
||||
child_chunk_id: string
|
||||
dataset_id: string
|
||||
document_id: string
|
||||
segment_id: string
|
||||
child_chunk_id: string
|
||||
}
|
||||
query?: never
|
||||
url: '/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}/child_chunks/{child_chunk_id}'
|
||||
@@ -1726,10 +1872,10 @@ export type PatchDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChil
|
||||
= {
|
||||
body: ChildChunkUpdatePayload
|
||||
path: {
|
||||
child_chunk_id: string
|
||||
dataset_id: string
|
||||
document_id: string
|
||||
segment_id: string
|
||||
child_chunk_id: string
|
||||
}
|
||||
query?: never
|
||||
url: '/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}/child_chunks/{child_chunk_id}'
|
||||
@@ -1934,8 +2080,8 @@ export type PostDatasetsByDatasetIdMetadataResponse
|
||||
export type PostDatasetsByDatasetIdMetadataBuiltInByActionData = {
|
||||
body?: never
|
||||
path: {
|
||||
dataset_id: string
|
||||
action: string
|
||||
dataset_id: string
|
||||
}
|
||||
query?: never
|
||||
url: '/datasets/{dataset_id}/metadata/built-in/{action}'
|
||||
@@ -2148,8 +2294,8 @@ export type PostDatasetsByResourceIdApiKeysResponse
|
||||
export type DeleteDatasetsByResourceIdApiKeysByApiKeyIdData = {
|
||||
body?: never
|
||||
path: {
|
||||
resource_id: string
|
||||
api_key_id: string
|
||||
resource_id: string
|
||||
}
|
||||
query?: never
|
||||
url: '/datasets/{resource_id}/api-keys/{api_key_id}'
|
||||
|
||||
@@ -38,8 +38,6 @@ export const zExternalDatasetCreatePayload = z.object({
|
||||
name: z.string().min(1).max(100),
|
||||
})
|
||||
|
||||
export const zDatasetDetail = z.record(z.string(), z.unknown())
|
||||
|
||||
/**
|
||||
* ExternalKnowledgeApiPayload
|
||||
*/
|
||||
@@ -151,7 +149,7 @@ export const zExternalHitTestingPayload = z.object({
|
||||
*/
|
||||
export const zMetadataArgs = z.object({
|
||||
name: z.string(),
|
||||
type: z.enum(['string', 'number', 'time']),
|
||||
type: z.enum(['number', 'string', 'time']),
|
||||
})
|
||||
|
||||
/**
|
||||
@@ -161,10 +159,6 @@ export const zMetadataUpdatePayload = z.object({
|
||||
name: z.string(),
|
||||
})
|
||||
|
||||
export const zDatasetQueryDetail = z.record(z.string(), z.unknown())
|
||||
|
||||
export const zRelatedAppList = z.record(z.string(), z.unknown())
|
||||
|
||||
/**
|
||||
* DocumentRetryPayload
|
||||
*/
|
||||
@@ -175,7 +169,7 @@ export const zDocumentRetryPayload = z.object({
|
||||
/**
|
||||
* DatasetPermissionEnum
|
||||
*/
|
||||
export const zDatasetPermissionEnum = z.enum(['only_me', 'all_team_members', 'partial_members'])
|
||||
export const zDatasetPermissionEnum = z.enum(['all_team_members', 'only_me', 'partial_members'])
|
||||
|
||||
/**
|
||||
* DatasetCreatePayload
|
||||
@@ -210,6 +204,48 @@ export const zDatasetUpdatePayload = z.object({
|
||||
summary_index_setting: z.record(z.string(), z.unknown()).nullish(),
|
||||
})
|
||||
|
||||
export const zDatasetDocMetadata = z.object({
|
||||
id: z.string().optional(),
|
||||
name: z.string().optional(),
|
||||
type: z.string().optional(),
|
||||
})
|
||||
|
||||
export const zExternalKnowledgeInfo = z.object({
|
||||
external_knowledge_api_endpoint: z.string().optional(),
|
||||
external_knowledge_api_id: z.string().optional(),
|
||||
external_knowledge_api_name: z.string().optional(),
|
||||
external_knowledge_id: z.string().optional(),
|
||||
})
|
||||
|
||||
export const zExternalRetrievalModel = z.object({
|
||||
score_threshold: z.number().optional(),
|
||||
score_threshold_enabled: z.boolean().optional(),
|
||||
top_k: z.int().optional(),
|
||||
})
|
||||
|
||||
export const zDatasetIconInfo = z.object({
|
||||
icon: z.string().optional(),
|
||||
icon_background: z.string().optional(),
|
||||
icon_type: z.string().optional(),
|
||||
icon_url: z.string().optional(),
|
||||
})
|
||||
|
||||
export const zAnonymousInlineModelB1954337D565 = z.object({
|
||||
enable: z.boolean().optional(),
|
||||
model_name: z.string().optional(),
|
||||
model_provider_name: z.string().optional(),
|
||||
summary_prompt: z.string().optional(),
|
||||
})
|
||||
|
||||
/**
|
||||
* Tag
|
||||
*/
|
||||
export const zTag = z.object({
|
||||
id: z.string(),
|
||||
name: z.string(),
|
||||
type: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* DatasetResponse
|
||||
*/
|
||||
@@ -273,6 +309,27 @@ export const zDatasetAndDocumentResponse = z.object({
|
||||
documents: z.array(zDocumentResponse),
|
||||
})
|
||||
|
||||
export const zAppDetailKernel = z.object({
|
||||
description: z.string().optional(),
|
||||
icon: z.string().optional(),
|
||||
icon_background: z.string().optional(),
|
||||
icon_type: z.string().optional(),
|
||||
icon_url: z.record(z.string(), z.unknown()).optional(),
|
||||
id: z.string().optional(),
|
||||
mode: z.string().optional(),
|
||||
name: z.string().optional(),
|
||||
})
|
||||
|
||||
export const zRelatedAppList = z.object({
|
||||
data: z.array(zAppDetailKernel).optional(),
|
||||
total: z.int().optional(),
|
||||
})
|
||||
|
||||
export const zDatasetRerankingModel = z.object({
|
||||
reranking_model_name: z.string().optional(),
|
||||
reranking_provider_name: z.string().optional(),
|
||||
})
|
||||
|
||||
/**
|
||||
* RerankingModel
|
||||
*/
|
||||
@@ -285,10 +342,10 @@ export const zRerankingModel = z.object({
|
||||
* RetrievalMethod
|
||||
*/
|
||||
export const zRetrievalMethod = z.enum([
|
||||
'semantic_search',
|
||||
'full_text_search',
|
||||
'hybrid_search',
|
||||
'keyword_search',
|
||||
'semantic_search',
|
||||
])
|
||||
|
||||
/**
|
||||
@@ -340,6 +397,96 @@ export const zHitTestingFile = z.object({
|
||||
source_url: z.string().nullish(),
|
||||
})
|
||||
|
||||
export const zDatasetFileInfo = z.object({
|
||||
extension: z.string().optional(),
|
||||
id: z.string().optional(),
|
||||
mime_type: z.string().optional(),
|
||||
name: z.string().optional(),
|
||||
size: z.int().optional(),
|
||||
source_url: z.string().optional(),
|
||||
})
|
||||
|
||||
export const zDatasetContent = z.object({
|
||||
content: z.string().optional(),
|
||||
content_type: z.string().optional(),
|
||||
file_info: zDatasetFileInfo.optional(),
|
||||
})
|
||||
|
||||
export const zDatasetQueryDetail = z.object({
|
||||
created_at: z.record(z.string(), z.unknown()).optional(),
|
||||
created_by: z.string().optional(),
|
||||
created_by_role: z.string().optional(),
|
||||
id: z.string().optional(),
|
||||
queries: zDatasetContent.optional(),
|
||||
source: z.string().optional(),
|
||||
source_app_id: z.string().optional(),
|
||||
})
|
||||
|
||||
export const zDatasetKeywordSetting = z.object({
|
||||
keyword_weight: z.number().optional(),
|
||||
})
|
||||
|
||||
export const zDatasetVectorSetting = z.object({
|
||||
embedding_model_name: z.string().optional(),
|
||||
embedding_provider_name: z.string().optional(),
|
||||
vector_weight: z.number().optional(),
|
||||
})
|
||||
|
||||
export const zDatasetWeightedScore = z.object({
|
||||
keyword_setting: zDatasetKeywordSetting.optional(),
|
||||
vector_setting: zDatasetVectorSetting.optional(),
|
||||
weight_type: z.string().optional(),
|
||||
})
|
||||
|
||||
export const zDatasetRetrievalModel = z.object({
|
||||
reranking_enable: z.boolean().optional(),
|
||||
reranking_mode: z.string().optional(),
|
||||
reranking_model: zDatasetRerankingModel.optional(),
|
||||
score_threshold: z.number().optional(),
|
||||
score_threshold_enabled: z.boolean().optional(),
|
||||
search_method: z.string().optional(),
|
||||
top_k: z.int().optional(),
|
||||
weights: zDatasetWeightedScore.optional(),
|
||||
})
|
||||
|
||||
export const zDatasetDetail = z.object({
|
||||
app_count: z.int().optional(),
|
||||
author_name: z.string().optional(),
|
||||
built_in_field_enabled: z.boolean().optional(),
|
||||
chunk_structure: z.string().optional(),
|
||||
created_at: z.record(z.string(), z.unknown()).optional(),
|
||||
created_by: z.string().optional(),
|
||||
data_source_type: z.string().optional(),
|
||||
description: z.string().optional(),
|
||||
doc_form: z.string().optional(),
|
||||
doc_metadata: z.array(zDatasetDocMetadata).optional(),
|
||||
document_count: z.int().optional(),
|
||||
embedding_available: z.boolean().optional(),
|
||||
embedding_model: z.string().optional(),
|
||||
embedding_model_provider: z.string().optional(),
|
||||
enable_api: z.boolean().optional(),
|
||||
external_knowledge_info: zExternalKnowledgeInfo.optional(),
|
||||
external_retrieval_model: zExternalRetrievalModel.optional(),
|
||||
icon_info: zDatasetIconInfo.optional(),
|
||||
id: z.string().optional(),
|
||||
indexing_technique: z.string().optional(),
|
||||
is_multimodal: z.boolean().optional(),
|
||||
is_published: z.boolean().optional(),
|
||||
name: z.string().optional(),
|
||||
permission: z.string().optional(),
|
||||
pipeline_id: z.string().optional(),
|
||||
provider: z.string().optional(),
|
||||
retrieval_model_dict: zDatasetRetrievalModel.optional(),
|
||||
runtime_mode: z.string().optional(),
|
||||
summary_index_setting: zAnonymousInlineModelB1954337D565.optional(),
|
||||
tags: z.array(zTag).optional(),
|
||||
total_available_documents: z.int().optional(),
|
||||
total_documents: z.int().optional(),
|
||||
updated_at: z.record(z.string(), z.unknown()).optional(),
|
||||
updated_by: z.string().optional(),
|
||||
word_count: z.int().optional(),
|
||||
})
|
||||
|
||||
/**
|
||||
* FileInfo
|
||||
*/
|
||||
@@ -399,24 +546,24 @@ export const zProcessRule = z.object({
|
||||
*/
|
||||
export const zCondition = z.object({
|
||||
comparison_operator: z.enum([
|
||||
'<',
|
||||
'=',
|
||||
'>',
|
||||
'after',
|
||||
'before',
|
||||
'contains',
|
||||
'not contains',
|
||||
'start with',
|
||||
'empty',
|
||||
'end with',
|
||||
'in',
|
||||
'is',
|
||||
'is not',
|
||||
'empty',
|
||||
'not contains',
|
||||
'not empty',
|
||||
'in',
|
||||
'not in',
|
||||
'=',
|
||||
'start with',
|
||||
'≠',
|
||||
'>',
|
||||
'<',
|
||||
'≥',
|
||||
'≤',
|
||||
'before',
|
||||
'after',
|
||||
'≥',
|
||||
]),
|
||||
name: z.string(),
|
||||
value: z.unknown().optional(),
|
||||
@@ -454,7 +601,7 @@ export const zWeightVectorSetting = z.object({
|
||||
export const zWeightModel = z.object({
|
||||
keyword_setting: zWeightKeywordSetting.optional(),
|
||||
vector_setting: zWeightVectorSetting.optional(),
|
||||
weight_type: z.enum(['semantic_first', 'keyword_first', 'customized']).nullish(),
|
||||
weight_type: z.enum(['customized', 'keyword_first', 'semantic_first']).nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
@@ -574,7 +721,7 @@ export const zNotionInfo = z.object({
|
||||
* InfoList
|
||||
*/
|
||||
export const zInfoList = z.object({
|
||||
data_source_type: z.enum(['upload_file', 'notion_import', 'website_crawl']),
|
||||
data_source_type: z.enum(['notion_import', 'upload_file', 'website_crawl']),
|
||||
file_info_list: zFileInfo.optional(),
|
||||
notion_info_list: z.array(zNotionInfo).nullish(),
|
||||
website_info_list: zWebsiteInfo.optional(),
|
||||
@@ -597,7 +744,7 @@ export const zKnowledgeConfig = z.object({
|
||||
duplicate: z.boolean().optional().default(true),
|
||||
embedding_model: z.string().nullish(),
|
||||
embedding_model_provider: z.string().nullish(),
|
||||
indexing_technique: z.enum(['high_quality', 'economy']),
|
||||
indexing_technique: z.enum(['economy', 'high_quality']),
|
||||
is_multimodal: z.boolean().optional().default(false),
|
||||
name: z.string().nullish(),
|
||||
original_document_id: z.string().nullish(),
|
||||
@@ -607,12 +754,12 @@ export const zKnowledgeConfig = z.object({
|
||||
})
|
||||
|
||||
export const zGetDatasetsQuery = z.object({
|
||||
page: z.string().optional(),
|
||||
limit: z.string().optional(),
|
||||
ids: z.string().optional(),
|
||||
keyword: z.string().optional(),
|
||||
tag_ids: z.string().optional(),
|
||||
include_all: z.string().optional(),
|
||||
keyword: z.string().optional(),
|
||||
limit: z.string().optional(),
|
||||
page: z.string().optional(),
|
||||
tag_ids: z.string().optional(),
|
||||
})
|
||||
|
||||
/**
|
||||
@@ -679,9 +826,9 @@ export const zPostDatasetsExternalBody = zExternalDatasetCreatePayload
|
||||
export const zPostDatasetsExternalResponse = zDatasetDetail
|
||||
|
||||
export const zGetDatasetsExternalKnowledgeApiQuery = z.object({
|
||||
page: z.string().optional(),
|
||||
limit: z.string().optional(),
|
||||
keyword: z.string().optional(),
|
||||
limit: z.string().optional(),
|
||||
page: z.string().optional(),
|
||||
})
|
||||
|
||||
/**
|
||||
@@ -850,8 +997,8 @@ export const zGetDatasetsByDatasetIdAutoDisableLogsPath = z.object({
|
||||
export const zGetDatasetsByDatasetIdAutoDisableLogsResponse = z.record(z.string(), z.unknown())
|
||||
|
||||
export const zGetDatasetsByDatasetIdBatchByBatchIndexingEstimatePath = z.object({
|
||||
dataset_id: z.string(),
|
||||
batch: z.string(),
|
||||
dataset_id: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
@@ -863,8 +1010,8 @@ export const zGetDatasetsByDatasetIdBatchByBatchIndexingEstimateResponse = z.rec
|
||||
)
|
||||
|
||||
export const zGetDatasetsByDatasetIdBatchByBatchIndexingStatusPath = z.object({
|
||||
dataset_id: z.string(),
|
||||
batch: z.string(),
|
||||
dataset_id: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
@@ -889,11 +1036,11 @@ export const zGetDatasetsByDatasetIdDocumentsPath = z.object({
|
||||
})
|
||||
|
||||
export const zGetDatasetsByDatasetIdDocumentsQuery = z.object({
|
||||
page: z.string().optional(),
|
||||
limit: z.string().optional(),
|
||||
keyword: z.string().optional(),
|
||||
sort: z.string().optional(),
|
||||
fetch: z.string().optional(),
|
||||
keyword: z.string().optional(),
|
||||
limit: z.string().optional(),
|
||||
page: z.string().optional(),
|
||||
sort: z.string().optional(),
|
||||
status: z.string().optional(),
|
||||
})
|
||||
|
||||
@@ -953,8 +1100,8 @@ export const zPostDatasetsByDatasetIdDocumentsMetadataPath = z.object({
|
||||
export const zPostDatasetsByDatasetIdDocumentsMetadataResponse = z.record(z.string(), z.unknown())
|
||||
|
||||
export const zPatchDatasetsByDatasetIdDocumentsStatusByActionBatchPath = z.object({
|
||||
dataset_id: z.string(),
|
||||
action: z.string(),
|
||||
dataset_id: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
@@ -966,8 +1113,8 @@ export const zPatchDatasetsByDatasetIdDocumentsStatusByActionBatchResponse = z.r
|
||||
)
|
||||
|
||||
export const zDeleteDatasetsByDatasetIdDocumentsByDocumentIdPath = z.object({
|
||||
document_id: z.string(),
|
||||
dataset_id: z.string(),
|
||||
document_id: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
@@ -1103,9 +1250,9 @@ export const zPatchDatasetsByDatasetIdDocumentsByDocumentIdProcessingResumeRespo
|
||||
)
|
||||
|
||||
export const zPatchDatasetsByDatasetIdDocumentsByDocumentIdProcessingByActionPath = z.object({
|
||||
action: z.string(),
|
||||
dataset_id: z.string(),
|
||||
document_id: z.string(),
|
||||
action: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
@@ -1144,9 +1291,9 @@ export const zPostDatasetsByDatasetIdDocumentsByDocumentIdSegmentResponse = z.re
|
||||
)
|
||||
|
||||
export const zPatchDatasetsByDatasetIdDocumentsByDocumentIdSegmentByActionPath = z.object({
|
||||
action: z.string(),
|
||||
dataset_id: z.string(),
|
||||
document_id: z.string(),
|
||||
action: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
@@ -1287,10 +1434,10 @@ export const zPostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChi
|
||||
|
||||
export const zDeleteDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksByChildChunkIdPath
|
||||
= z.object({
|
||||
child_chunk_id: z.string(),
|
||||
dataset_id: z.string(),
|
||||
document_id: z.string(),
|
||||
segment_id: z.string(),
|
||||
child_chunk_id: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
@@ -1304,10 +1451,10 @@ export const zPatchDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdCh
|
||||
|
||||
export const zPatchDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksByChildChunkIdPath
|
||||
= z.object({
|
||||
child_chunk_id: z.string(),
|
||||
dataset_id: z.string(),
|
||||
document_id: z.string(),
|
||||
segment_id: z.string(),
|
||||
child_chunk_id: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
@@ -1403,8 +1550,8 @@ export const zPostDatasetsByDatasetIdMetadataPath = z.object({
|
||||
export const zPostDatasetsByDatasetIdMetadataResponse = z.record(z.string(), z.unknown())
|
||||
|
||||
export const zPostDatasetsByDatasetIdMetadataBuiltInByActionPath = z.object({
|
||||
dataset_id: z.string(),
|
||||
action: z.string(),
|
||||
dataset_id: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
@@ -1518,8 +1665,8 @@ export const zPostDatasetsByResourceIdApiKeysPath = z.object({
|
||||
export const zPostDatasetsByResourceIdApiKeysResponse = zApiKeyItem
|
||||
|
||||
export const zDeleteDatasetsByResourceIdApiKeysByApiKeyIdPath = z.object({
|
||||
resource_id: z.string(),
|
||||
api_key_id: z.string(),
|
||||
resource_id: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
|
||||
@@ -13,7 +13,7 @@ export type RecommendedAppResponse = {
|
||||
app?: RecommendedAppInfoResponse
|
||||
app_id: string
|
||||
can_trial?: boolean | null
|
||||
category?: string | null
|
||||
categories?: Array<string>
|
||||
copyright?: string | null
|
||||
custom_disclaimer?: string | null
|
||||
description?: string | null
|
||||
@@ -35,7 +35,7 @@ export type GetExploreAppsData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: {
|
||||
language?: string | null
|
||||
language?: string
|
||||
}
|
||||
url: '/explore/apps'
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ export const zRecommendedAppResponse = z.object({
|
||||
app: zRecommendedAppInfoResponse.optional(),
|
||||
app_id: z.string(),
|
||||
can_trial: z.boolean().nullish(),
|
||||
category: z.string().nullish(),
|
||||
categories: z.array(z.string()).optional(),
|
||||
copyright: z.string().nullish(),
|
||||
custom_disclaimer: z.string().nullish(),
|
||||
description: z.string().nullish(),
|
||||
@@ -39,7 +39,7 @@ export const zRecommendedAppListResponse = z.object({
|
||||
})
|
||||
|
||||
export const zGetExploreAppsQuery = z.object({
|
||||
language: z.string().nullish(),
|
||||
language: z.string().optional(),
|
||||
})
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,7 +5,9 @@ export type ClientOptions = {
|
||||
}
|
||||
|
||||
export type FeatureResponse = {
|
||||
[key: string]: unknown
|
||||
features?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
}
|
||||
|
||||
export type GetFeaturesData = {
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
|
||||
import * as z from 'zod'
|
||||
|
||||
export const zFeatureResponse = z.record(z.string(), z.unknown())
|
||||
export const zFeatureResponse = z.object({
|
||||
features: z.record(z.string(), z.unknown()).optional(),
|
||||
})
|
||||
|
||||
/**
|
||||
* Success
|
||||
|
||||
@@ -43,7 +43,7 @@ export type ConversationRenamePayload = {
|
||||
export type MessageFeedbackPayload = {
|
||||
content?: string | null
|
||||
message_id: string
|
||||
rating?: 'like' | 'dislike' | null
|
||||
rating?: 'dislike' | 'like' | null
|
||||
}
|
||||
|
||||
export type SavedMessageCreatePayload = {
|
||||
@@ -267,8 +267,8 @@ export type GetInstalledAppsByInstalledAppIdConversationsResponse
|
||||
export type DeleteInstalledAppsByInstalledAppIdConversationsByCIdData = {
|
||||
body?: never
|
||||
path: {
|
||||
installed_app_id: string
|
||||
c_id: string
|
||||
installed_app_id: string
|
||||
}
|
||||
query?: never
|
||||
url: '/installed-apps/{installed_app_id}/conversations/{c_id}'
|
||||
@@ -286,8 +286,8 @@ export type DeleteInstalledAppsByInstalledAppIdConversationsByCIdResponse
|
||||
export type PostInstalledAppsByInstalledAppIdConversationsByCIdNameData = {
|
||||
body: ConversationRenamePayload
|
||||
path: {
|
||||
installed_app_id: string
|
||||
c_id: string
|
||||
installed_app_id: string
|
||||
}
|
||||
query?: never
|
||||
url: '/installed-apps/{installed_app_id}/conversations/{c_id}/name'
|
||||
@@ -305,8 +305,8 @@ export type PostInstalledAppsByInstalledAppIdConversationsByCIdNameResponse
|
||||
export type PatchInstalledAppsByInstalledAppIdConversationsByCIdPinData = {
|
||||
body?: never
|
||||
path: {
|
||||
installed_app_id: string
|
||||
c_id: string
|
||||
installed_app_id: string
|
||||
}
|
||||
query?: never
|
||||
url: '/installed-apps/{installed_app_id}/conversations/{c_id}/pin'
|
||||
@@ -324,8 +324,8 @@ export type PatchInstalledAppsByInstalledAppIdConversationsByCIdPinResponse
|
||||
export type PatchInstalledAppsByInstalledAppIdConversationsByCIdUnpinData = {
|
||||
body?: never
|
||||
path: {
|
||||
installed_app_id: string
|
||||
c_id: string
|
||||
installed_app_id: string
|
||||
}
|
||||
query?: never
|
||||
url: '/installed-apps/{installed_app_id}/conversations/{c_id}/unpin'
|
||||
|
||||
@@ -41,7 +41,7 @@ export const zConversationRenamePayload = z.object({
|
||||
export const zMessageFeedbackPayload = z.object({
|
||||
content: z.string().nullish(),
|
||||
message_id: z.string(),
|
||||
rating: z.enum(['like', 'dislike']).nullish(),
|
||||
rating: z.enum(['dislike', 'like']).nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
@@ -216,8 +216,8 @@ export const zGetInstalledAppsByInstalledAppIdConversationsResponse = z.record(
|
||||
)
|
||||
|
||||
export const zDeleteInstalledAppsByInstalledAppIdConversationsByCIdPath = z.object({
|
||||
installed_app_id: z.string(),
|
||||
c_id: z.string(),
|
||||
installed_app_id: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
@@ -232,8 +232,8 @@ export const zPostInstalledAppsByInstalledAppIdConversationsByCIdNameBody
|
||||
= zConversationRenamePayload
|
||||
|
||||
export const zPostInstalledAppsByInstalledAppIdConversationsByCIdNamePath = z.object({
|
||||
installed_app_id: z.string(),
|
||||
c_id: z.string(),
|
||||
installed_app_id: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
@@ -245,8 +245,8 @@ export const zPostInstalledAppsByInstalledAppIdConversationsByCIdNameResponse =
|
||||
)
|
||||
|
||||
export const zPatchInstalledAppsByInstalledAppIdConversationsByCIdPinPath = z.object({
|
||||
installed_app_id: z.string(),
|
||||
c_id: z.string(),
|
||||
installed_app_id: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
@@ -258,8 +258,8 @@ export const zPatchInstalledAppsByInstalledAppIdConversationsByCIdPinResponse =
|
||||
)
|
||||
|
||||
export const zPatchInstalledAppsByInstalledAppIdConversationsByCIdUnpinPath = z.object({
|
||||
installed_app_id: z.string(),
|
||||
c_id: z.string(),
|
||||
installed_app_id: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
|
||||
@@ -19,33 +19,15 @@ export type InstructionTemplatePayload = {
|
||||
}
|
||||
|
||||
export type ModelConfig = {
|
||||
agent_mode_dict?: JsonValue
|
||||
annotation_reply_dict?: JsonValue
|
||||
chat_prompt_config_dict?: JsonValue
|
||||
completion_prompt_config_dict?: JsonValue
|
||||
created_at?: number | null
|
||||
created_by?: string | null
|
||||
dataset_configs_dict?: JsonValue
|
||||
dataset_query_variable?: string | null
|
||||
external_data_tools_list?: JsonValue
|
||||
file_upload_dict?: JsonValue
|
||||
model_dict?: JsonValue
|
||||
more_like_this_dict?: JsonValue
|
||||
opening_statement?: string | null
|
||||
pre_prompt?: string | null
|
||||
prompt_type?: string | null
|
||||
retriever_resource_dict?: JsonValue
|
||||
sensitive_word_avoidance_dict?: JsonValue
|
||||
speech_to_text_dict?: JsonValue
|
||||
suggested_questions_after_answer_dict?: JsonValue
|
||||
suggested_questions_list?: JsonValue
|
||||
text_to_speech_dict?: JsonValue
|
||||
updated_at?: number | null
|
||||
updated_by?: string | null
|
||||
user_input_form_list?: JsonValue
|
||||
completion_params?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
mode: LlmMode
|
||||
name: string
|
||||
provider: string
|
||||
}
|
||||
|
||||
export type JsonValue = unknown
|
||||
export type LlmMode = 'chat' | 'completion'
|
||||
|
||||
export type PostInstructionGenerateData = {
|
||||
body: InstructionGeneratePayload
|
||||
|
||||
@@ -9,36 +9,21 @@ export const zInstructionTemplatePayload = z.object({
|
||||
type: z.string(),
|
||||
})
|
||||
|
||||
export const zJsonValue = z.unknown()
|
||||
/**
|
||||
* LLMMode
|
||||
*
|
||||
* Enum class for large language model mode.
|
||||
*/
|
||||
export const zLlmMode = z.enum(['chat', 'completion'])
|
||||
|
||||
/**
|
||||
* ModelConfig
|
||||
*/
|
||||
export const zModelConfig = z.object({
|
||||
agent_mode_dict: zJsonValue.optional(),
|
||||
annotation_reply_dict: zJsonValue.optional(),
|
||||
chat_prompt_config_dict: zJsonValue.optional(),
|
||||
completion_prompt_config_dict: zJsonValue.optional(),
|
||||
created_at: z.int().nullish(),
|
||||
created_by: z.string().nullish(),
|
||||
dataset_configs_dict: zJsonValue.optional(),
|
||||
dataset_query_variable: z.string().nullish(),
|
||||
external_data_tools_list: zJsonValue.optional(),
|
||||
file_upload_dict: zJsonValue.optional(),
|
||||
model_dict: zJsonValue.optional(),
|
||||
more_like_this_dict: zJsonValue.optional(),
|
||||
opening_statement: z.string().nullish(),
|
||||
pre_prompt: z.string().nullish(),
|
||||
prompt_type: z.string().nullish(),
|
||||
retriever_resource_dict: zJsonValue.optional(),
|
||||
sensitive_word_avoidance_dict: zJsonValue.optional(),
|
||||
speech_to_text_dict: zJsonValue.optional(),
|
||||
suggested_questions_after_answer_dict: zJsonValue.optional(),
|
||||
suggested_questions_list: zJsonValue.optional(),
|
||||
text_to_speech_dict: zJsonValue.optional(),
|
||||
updated_at: z.int().nullish(),
|
||||
updated_by: z.string().nullish(),
|
||||
user_input_form_list: zJsonValue.optional(),
|
||||
completion_params: z.record(z.string(), z.unknown()).optional(),
|
||||
mode: zLlmMode,
|
||||
name: z.string(),
|
||||
provider: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
|
||||
@@ -134,8 +134,8 @@ export type GetOauthDataSourceByProviderResponse
|
||||
export type GetOauthDataSourceByProviderByBindingIdSyncData = {
|
||||
body?: never
|
||||
path: {
|
||||
provider: string
|
||||
binding_id: string
|
||||
provider: string
|
||||
}
|
||||
query?: never
|
||||
url: '/oauth/data-source/{provider}/{binding_id}/sync'
|
||||
|
||||
@@ -74,8 +74,8 @@ export const zGetOauthDataSourceByProviderPath = z.object({
|
||||
export const zGetOauthDataSourceByProviderResponse = zOAuthDataSourceResponse
|
||||
|
||||
export const zGetOauthDataSourceByProviderByBindingIdSyncPath = z.object({
|
||||
provider: z.string(),
|
||||
binding_id: z.string(),
|
||||
provider: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
|
||||
@@ -28,6 +28,35 @@ export type Payload = {
|
||||
name: string
|
||||
}
|
||||
|
||||
export type WorkflowRunPaginationResponse = {
|
||||
data: Array<WorkflowRunForListResponse>
|
||||
has_more: boolean
|
||||
limit: number
|
||||
}
|
||||
|
||||
export type WorkflowRunDetailResponse = {
|
||||
created_at?: number | null
|
||||
created_by_account?: SimpleAccount
|
||||
created_by_end_user?: SimpleEndUser
|
||||
created_by_role?: string | null
|
||||
elapsed_time?: number | null
|
||||
error?: string | null
|
||||
exceptions_count?: number | null
|
||||
finished_at?: number | null
|
||||
graph: unknown
|
||||
id: string
|
||||
inputs: unknown
|
||||
outputs: unknown
|
||||
status?: string | null
|
||||
total_steps?: number | null
|
||||
total_tokens?: number | null
|
||||
version?: string | null
|
||||
}
|
||||
|
||||
export type WorkflowRunNodeExecutionListResponse = {
|
||||
data: Array<WorkflowRunNodeExecutionResponse>
|
||||
}
|
||||
|
||||
export type DatasourceNodeRunPayload = {
|
||||
credential_id?: string | null
|
||||
datasource_type: string
|
||||
@@ -45,6 +74,31 @@ export type DatasourceVariablesPayload = {
|
||||
start_node_title: string
|
||||
}
|
||||
|
||||
export type WorkflowRunNodeExecutionResponse = {
|
||||
created_at?: number | null
|
||||
created_by_account?: SimpleAccount
|
||||
created_by_end_user?: SimpleEndUser
|
||||
created_by_role?: string | null
|
||||
elapsed_time?: number | null
|
||||
error?: string | null
|
||||
execution_metadata?: unknown
|
||||
extras?: unknown
|
||||
finished_at?: number | null
|
||||
id: string
|
||||
index?: number | null
|
||||
inputs?: unknown
|
||||
inputs_truncated?: boolean | null
|
||||
node_id?: string | null
|
||||
node_type?: string | null
|
||||
outputs?: unknown
|
||||
outputs_truncated?: boolean | null
|
||||
predecessor_node_id?: string | null
|
||||
process_data?: unknown
|
||||
process_data_truncated?: boolean | null
|
||||
status?: string | null
|
||||
title?: string | null
|
||||
}
|
||||
|
||||
export type NodeRunPayload = {
|
||||
inputs?: {
|
||||
[key: string]: unknown
|
||||
@@ -86,10 +140,37 @@ export type PublishedWorkflowRunPayload = {
|
||||
}
|
||||
is_preview?: boolean
|
||||
original_document_id?: string | null
|
||||
response_mode?: 'streaming' | 'blocking'
|
||||
response_mode?: 'blocking' | 'streaming'
|
||||
start_node_id: string
|
||||
}
|
||||
|
||||
export type WorkflowRunForListResponse = {
|
||||
created_at?: number | null
|
||||
created_by_account?: SimpleAccount
|
||||
elapsed_time?: number | null
|
||||
exceptions_count?: number | null
|
||||
finished_at?: number | null
|
||||
id: string
|
||||
retry_index?: number | null
|
||||
status?: string | null
|
||||
total_steps?: number | null
|
||||
total_tokens?: number | null
|
||||
version?: string | null
|
||||
}
|
||||
|
||||
export type SimpleAccount = {
|
||||
email: string
|
||||
id: string
|
||||
name: string
|
||||
}
|
||||
|
||||
export type SimpleEndUser = {
|
||||
id: string
|
||||
is_anonymous: boolean
|
||||
session_id?: string | null
|
||||
type: string
|
||||
}
|
||||
|
||||
export type DeleteRagPipelineCustomizedTemplatesByTemplateIdData = {
|
||||
body?: never
|
||||
path: {
|
||||
@@ -358,9 +439,7 @@ export type GetRagPipelinesByPipelineIdWorkflowRunsData = {
|
||||
}
|
||||
|
||||
export type GetRagPipelinesByPipelineIdWorkflowRunsResponses = {
|
||||
200: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
200: WorkflowRunPaginationResponse
|
||||
}
|
||||
|
||||
export type GetRagPipelinesByPipelineIdWorkflowRunsResponse
|
||||
@@ -396,9 +475,7 @@ export type GetRagPipelinesByPipelineIdWorkflowRunsByRunIdData = {
|
||||
}
|
||||
|
||||
export type GetRagPipelinesByPipelineIdWorkflowRunsByRunIdResponses = {
|
||||
200: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
200: WorkflowRunDetailResponse
|
||||
}
|
||||
|
||||
export type GetRagPipelinesByPipelineIdWorkflowRunsByRunIdResponse
|
||||
@@ -415,9 +492,7 @@ export type GetRagPipelinesByPipelineIdWorkflowRunsByRunIdNodeExecutionsData = {
|
||||
}
|
||||
|
||||
export type GetRagPipelinesByPipelineIdWorkflowRunsByRunIdNodeExecutionsResponses = {
|
||||
200: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
200: WorkflowRunNodeExecutionListResponse
|
||||
}
|
||||
|
||||
export type GetRagPipelinesByPipelineIdWorkflowRunsByRunIdNodeExecutionsResponse
|
||||
@@ -462,8 +537,8 @@ export type GetRagPipelinesByPipelineIdWorkflowsDefaultWorkflowBlockConfigsRespo
|
||||
export type GetRagPipelinesByPipelineIdWorkflowsDefaultWorkflowBlockConfigsByBlockTypeData = {
|
||||
body?: never
|
||||
path: {
|
||||
pipeline_id: string
|
||||
block_type: string
|
||||
pipeline_id: string
|
||||
}
|
||||
query?: never
|
||||
url: '/rag/pipelines/{pipeline_id}/workflows/default-workflow-block-configs/{block_type}'
|
||||
@@ -517,8 +592,8 @@ export type PostRagPipelinesByPipelineIdWorkflowsDraftResponse
|
||||
export type PostRagPipelinesByPipelineIdWorkflowsDraftDatasourceNodesByNodeIdRunData = {
|
||||
body: DatasourceNodeRunPayload
|
||||
path: {
|
||||
pipeline_id: string
|
||||
node_id: string
|
||||
pipeline_id: string
|
||||
}
|
||||
query?: never
|
||||
url: '/rag/pipelines/{pipeline_id}/workflows/draft/datasource/nodes/{node_id}/run'
|
||||
@@ -543,9 +618,7 @@ export type PostRagPipelinesByPipelineIdWorkflowsDraftDatasourceVariablesInspect
|
||||
}
|
||||
|
||||
export type PostRagPipelinesByPipelineIdWorkflowsDraftDatasourceVariablesInspectResponses = {
|
||||
200: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
200: WorkflowRunNodeExecutionResponse
|
||||
}
|
||||
|
||||
export type PostRagPipelinesByPipelineIdWorkflowsDraftDatasourceVariablesInspectResponse
|
||||
@@ -572,8 +645,8 @@ export type GetRagPipelinesByPipelineIdWorkflowsDraftEnvironmentVariablesRespons
|
||||
export type PostRagPipelinesByPipelineIdWorkflowsDraftIterationNodesByNodeIdRunData = {
|
||||
body: NodeRunPayload
|
||||
path: {
|
||||
pipeline_id: string
|
||||
node_id: string
|
||||
pipeline_id: string
|
||||
}
|
||||
query?: never
|
||||
url: '/rag/pipelines/{pipeline_id}/workflows/draft/iteration/nodes/{node_id}/run'
|
||||
@@ -591,8 +664,8 @@ export type PostRagPipelinesByPipelineIdWorkflowsDraftIterationNodesByNodeIdRunR
|
||||
export type PostRagPipelinesByPipelineIdWorkflowsDraftLoopNodesByNodeIdRunData = {
|
||||
body: NodeRunPayload
|
||||
path: {
|
||||
pipeline_id: string
|
||||
node_id: string
|
||||
pipeline_id: string
|
||||
}
|
||||
query?: never
|
||||
url: '/rag/pipelines/{pipeline_id}/workflows/draft/loop/nodes/{node_id}/run'
|
||||
@@ -610,17 +683,15 @@ export type PostRagPipelinesByPipelineIdWorkflowsDraftLoopNodesByNodeIdRunRespon
|
||||
export type GetRagPipelinesByPipelineIdWorkflowsDraftNodesByNodeIdLastRunData = {
|
||||
body?: never
|
||||
path: {
|
||||
pipeline_id: string
|
||||
node_id: string
|
||||
pipeline_id: string
|
||||
}
|
||||
query?: never
|
||||
url: '/rag/pipelines/{pipeline_id}/workflows/draft/nodes/{node_id}/last-run'
|
||||
}
|
||||
|
||||
export type GetRagPipelinesByPipelineIdWorkflowsDraftNodesByNodeIdLastRunResponses = {
|
||||
200: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
200: WorkflowRunNodeExecutionResponse
|
||||
}
|
||||
|
||||
export type GetRagPipelinesByPipelineIdWorkflowsDraftNodesByNodeIdLastRunResponse
|
||||
@@ -629,17 +700,15 @@ export type GetRagPipelinesByPipelineIdWorkflowsDraftNodesByNodeIdLastRunRespons
|
||||
export type PostRagPipelinesByPipelineIdWorkflowsDraftNodesByNodeIdRunData = {
|
||||
body: NodeRunRequiredPayload
|
||||
path: {
|
||||
pipeline_id: string
|
||||
node_id: string
|
||||
pipeline_id: string
|
||||
}
|
||||
query?: never
|
||||
url: '/rag/pipelines/{pipeline_id}/workflows/draft/nodes/{node_id}/run'
|
||||
}
|
||||
|
||||
export type PostRagPipelinesByPipelineIdWorkflowsDraftNodesByNodeIdRunResponses = {
|
||||
200: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
200: WorkflowRunNodeExecutionResponse
|
||||
}
|
||||
|
||||
export type PostRagPipelinesByPipelineIdWorkflowsDraftNodesByNodeIdRunResponse
|
||||
@@ -648,8 +717,8 @@ export type PostRagPipelinesByPipelineIdWorkflowsDraftNodesByNodeIdRunResponse
|
||||
export type DeleteRagPipelinesByPipelineIdWorkflowsDraftNodesByNodeIdVariablesData = {
|
||||
body?: never
|
||||
path: {
|
||||
pipeline_id: string
|
||||
node_id: string
|
||||
pipeline_id: string
|
||||
}
|
||||
query?: never
|
||||
url: '/rag/pipelines/{pipeline_id}/workflows/draft/nodes/{node_id}/variables'
|
||||
@@ -667,8 +736,8 @@ export type DeleteRagPipelinesByPipelineIdWorkflowsDraftNodesByNodeIdVariablesRe
|
||||
export type GetRagPipelinesByPipelineIdWorkflowsDraftNodesByNodeIdVariablesData = {
|
||||
body?: never
|
||||
path: {
|
||||
pipeline_id: string
|
||||
node_id: string
|
||||
pipeline_id: string
|
||||
}
|
||||
query?: never
|
||||
url: '/rag/pipelines/{pipeline_id}/workflows/draft/nodes/{node_id}/variables'
|
||||
@@ -906,8 +975,8 @@ export type PostRagPipelinesByPipelineIdWorkflowsPublishResponse
|
||||
export type PostRagPipelinesByPipelineIdWorkflowsPublishedDatasourceNodesByNodeIdPreviewData = {
|
||||
body: Parser
|
||||
path: {
|
||||
pipeline_id: string
|
||||
node_id: string
|
||||
pipeline_id: string
|
||||
}
|
||||
query?: never
|
||||
url: '/rag/pipelines/{pipeline_id}/workflows/published/datasource/nodes/{node_id}/preview'
|
||||
@@ -926,8 +995,8 @@ export type PostRagPipelinesByPipelineIdWorkflowsPublishedDatasourceNodesByNodeI
|
||||
export type PostRagPipelinesByPipelineIdWorkflowsPublishedDatasourceNodesByNodeIdRunData = {
|
||||
body: DatasourceNodeRunPayload
|
||||
path: {
|
||||
pipeline_id: string
|
||||
node_id: string
|
||||
pipeline_id: string
|
||||
}
|
||||
query?: never
|
||||
url: '/rag/pipelines/{pipeline_id}/workflows/published/datasource/nodes/{node_id}/run'
|
||||
|
||||
@@ -94,10 +94,112 @@ export const zPublishedWorkflowRunPayload = z.object({
|
||||
inputs: z.record(z.string(), z.unknown()),
|
||||
is_preview: z.boolean().optional().default(false),
|
||||
original_document_id: z.string().nullish(),
|
||||
response_mode: z.enum(['streaming', 'blocking']).optional().default('streaming'),
|
||||
response_mode: z.enum(['blocking', 'streaming']).optional().default('streaming'),
|
||||
start_node_id: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* SimpleAccount
|
||||
*/
|
||||
export const zSimpleAccount = z.object({
|
||||
email: z.string(),
|
||||
id: z.string(),
|
||||
name: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* WorkflowRunForListResponse
|
||||
*/
|
||||
export const zWorkflowRunForListResponse = z.object({
|
||||
created_at: z.int().nullish(),
|
||||
created_by_account: zSimpleAccount.optional(),
|
||||
elapsed_time: z.number().nullish(),
|
||||
exceptions_count: z.int().nullish(),
|
||||
finished_at: z.int().nullish(),
|
||||
id: z.string(),
|
||||
retry_index: z.int().nullish(),
|
||||
status: z.string().nullish(),
|
||||
total_steps: z.int().nullish(),
|
||||
total_tokens: z.int().nullish(),
|
||||
version: z.string().nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* WorkflowRunPaginationResponse
|
||||
*/
|
||||
export const zWorkflowRunPaginationResponse = z.object({
|
||||
data: z.array(zWorkflowRunForListResponse),
|
||||
has_more: z.boolean(),
|
||||
limit: z.int(),
|
||||
})
|
||||
|
||||
/**
|
||||
* SimpleEndUser
|
||||
*/
|
||||
export const zSimpleEndUser = z.object({
|
||||
id: z.string(),
|
||||
is_anonymous: z.boolean(),
|
||||
session_id: z.string().nullish(),
|
||||
type: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* WorkflowRunDetailResponse
|
||||
*/
|
||||
export const zWorkflowRunDetailResponse = z.object({
|
||||
created_at: z.int().nullish(),
|
||||
created_by_account: zSimpleAccount.optional(),
|
||||
created_by_end_user: zSimpleEndUser.optional(),
|
||||
created_by_role: z.string().nullish(),
|
||||
elapsed_time: z.number().nullish(),
|
||||
error: z.string().nullish(),
|
||||
exceptions_count: z.int().nullish(),
|
||||
finished_at: z.int().nullish(),
|
||||
graph: z.unknown(),
|
||||
id: z.string(),
|
||||
inputs: z.unknown(),
|
||||
outputs: z.unknown(),
|
||||
status: z.string().nullish(),
|
||||
total_steps: z.int().nullish(),
|
||||
total_tokens: z.int().nullish(),
|
||||
version: z.string().nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* WorkflowRunNodeExecutionResponse
|
||||
*/
|
||||
export const zWorkflowRunNodeExecutionResponse = z.object({
|
||||
created_at: z.int().nullish(),
|
||||
created_by_account: zSimpleAccount.optional(),
|
||||
created_by_end_user: zSimpleEndUser.optional(),
|
||||
created_by_role: z.string().nullish(),
|
||||
elapsed_time: z.number().nullish(),
|
||||
error: z.string().nullish(),
|
||||
execution_metadata: z.unknown().optional(),
|
||||
extras: z.unknown().optional(),
|
||||
finished_at: z.int().nullish(),
|
||||
id: z.string(),
|
||||
index: z.int().nullish(),
|
||||
inputs: z.unknown().optional(),
|
||||
inputs_truncated: z.boolean().nullish(),
|
||||
node_id: z.string().nullish(),
|
||||
node_type: z.string().nullish(),
|
||||
outputs: z.unknown().optional(),
|
||||
outputs_truncated: z.boolean().nullish(),
|
||||
predecessor_node_id: z.string().nullish(),
|
||||
process_data: z.unknown().optional(),
|
||||
process_data_truncated: z.boolean().nullish(),
|
||||
status: z.string().nullish(),
|
||||
title: z.string().nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* WorkflowRunNodeExecutionListResponse
|
||||
*/
|
||||
export const zWorkflowRunNodeExecutionListResponse = z.object({
|
||||
data: z.array(zWorkflowRunNodeExecutionResponse),
|
||||
})
|
||||
|
||||
export const zDeleteRagPipelineCustomizedTemplatesByTemplateIdPath = z.object({
|
||||
template_id: z.string(),
|
||||
})
|
||||
@@ -238,9 +340,9 @@ export const zGetRagPipelinesByPipelineIdWorkflowRunsPath = z.object({
|
||||
})
|
||||
|
||||
/**
|
||||
* Success
|
||||
* Workflow runs retrieved successfully
|
||||
*/
|
||||
export const zGetRagPipelinesByPipelineIdWorkflowRunsResponse = z.record(z.string(), z.unknown())
|
||||
export const zGetRagPipelinesByPipelineIdWorkflowRunsResponse = zWorkflowRunPaginationResponse
|
||||
|
||||
export const zPostRagPipelinesByPipelineIdWorkflowRunsTasksByTaskIdStopPath = z.object({
|
||||
pipeline_id: z.string(),
|
||||
@@ -261,12 +363,9 @@ export const zGetRagPipelinesByPipelineIdWorkflowRunsByRunIdPath = z.object({
|
||||
})
|
||||
|
||||
/**
|
||||
* Success
|
||||
* Workflow run detail retrieved successfully
|
||||
*/
|
||||
export const zGetRagPipelinesByPipelineIdWorkflowRunsByRunIdResponse = z.record(
|
||||
z.string(),
|
||||
z.unknown(),
|
||||
)
|
||||
export const zGetRagPipelinesByPipelineIdWorkflowRunsByRunIdResponse = zWorkflowRunDetailResponse
|
||||
|
||||
export const zGetRagPipelinesByPipelineIdWorkflowRunsByRunIdNodeExecutionsPath = z.object({
|
||||
pipeline_id: z.string(),
|
||||
@@ -274,12 +373,10 @@ export const zGetRagPipelinesByPipelineIdWorkflowRunsByRunIdNodeExecutionsPath =
|
||||
})
|
||||
|
||||
/**
|
||||
* Success
|
||||
* Node executions retrieved successfully
|
||||
*/
|
||||
export const zGetRagPipelinesByPipelineIdWorkflowRunsByRunIdNodeExecutionsResponse = z.record(
|
||||
z.string(),
|
||||
z.unknown(),
|
||||
)
|
||||
export const zGetRagPipelinesByPipelineIdWorkflowRunsByRunIdNodeExecutionsResponse
|
||||
= zWorkflowRunNodeExecutionListResponse
|
||||
|
||||
export const zGetRagPipelinesByPipelineIdWorkflowsPath = z.object({
|
||||
pipeline_id: z.string(),
|
||||
@@ -304,8 +401,8 @@ export const zGetRagPipelinesByPipelineIdWorkflowsDefaultWorkflowBlockConfigsRes
|
||||
|
||||
export const zGetRagPipelinesByPipelineIdWorkflowsDefaultWorkflowBlockConfigsByBlockTypePath
|
||||
= z.object({
|
||||
pipeline_id: z.string(),
|
||||
block_type: z.string(),
|
||||
pipeline_id: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
@@ -336,8 +433,8 @@ export const zPostRagPipelinesByPipelineIdWorkflowsDraftDatasourceNodesByNodeIdR
|
||||
= zDatasourceNodeRunPayload
|
||||
|
||||
export const zPostRagPipelinesByPipelineIdWorkflowsDraftDatasourceNodesByNodeIdRunPath = z.object({
|
||||
pipeline_id: z.string(),
|
||||
node_id: z.string(),
|
||||
pipeline_id: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
@@ -354,10 +451,10 @@ export const zPostRagPipelinesByPipelineIdWorkflowsDraftDatasourceVariablesInspe
|
||||
})
|
||||
|
||||
/**
|
||||
* Success
|
||||
* Datasource variables set successfully
|
||||
*/
|
||||
export const zPostRagPipelinesByPipelineIdWorkflowsDraftDatasourceVariablesInspectResponse
|
||||
= z.record(z.string(), z.unknown())
|
||||
= zWorkflowRunNodeExecutionResponse
|
||||
|
||||
export const zGetRagPipelinesByPipelineIdWorkflowsDraftEnvironmentVariablesPath = z.object({
|
||||
pipeline_id: z.string(),
|
||||
@@ -375,8 +472,8 @@ export const zPostRagPipelinesByPipelineIdWorkflowsDraftIterationNodesByNodeIdRu
|
||||
= zNodeRunPayload
|
||||
|
||||
export const zPostRagPipelinesByPipelineIdWorkflowsDraftIterationNodesByNodeIdRunPath = z.object({
|
||||
pipeline_id: z.string(),
|
||||
node_id: z.string(),
|
||||
pipeline_id: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
@@ -388,8 +485,8 @@ export const zPostRagPipelinesByPipelineIdWorkflowsDraftIterationNodesByNodeIdRu
|
||||
export const zPostRagPipelinesByPipelineIdWorkflowsDraftLoopNodesByNodeIdRunBody = zNodeRunPayload
|
||||
|
||||
export const zPostRagPipelinesByPipelineIdWorkflowsDraftLoopNodesByNodeIdRunPath = z.object({
|
||||
pipeline_id: z.string(),
|
||||
node_id: z.string(),
|
||||
pipeline_id: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
@@ -401,37 +498,33 @@ export const zPostRagPipelinesByPipelineIdWorkflowsDraftLoopNodesByNodeIdRunResp
|
||||
)
|
||||
|
||||
export const zGetRagPipelinesByPipelineIdWorkflowsDraftNodesByNodeIdLastRunPath = z.object({
|
||||
pipeline_id: z.string(),
|
||||
node_id: z.string(),
|
||||
pipeline_id: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* Success
|
||||
* Node last run retrieved successfully
|
||||
*/
|
||||
export const zGetRagPipelinesByPipelineIdWorkflowsDraftNodesByNodeIdLastRunResponse = z.record(
|
||||
z.string(),
|
||||
z.unknown(),
|
||||
)
|
||||
export const zGetRagPipelinesByPipelineIdWorkflowsDraftNodesByNodeIdLastRunResponse
|
||||
= zWorkflowRunNodeExecutionResponse
|
||||
|
||||
export const zPostRagPipelinesByPipelineIdWorkflowsDraftNodesByNodeIdRunBody
|
||||
= zNodeRunRequiredPayload
|
||||
|
||||
export const zPostRagPipelinesByPipelineIdWorkflowsDraftNodesByNodeIdRunPath = z.object({
|
||||
pipeline_id: z.string(),
|
||||
node_id: z.string(),
|
||||
pipeline_id: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* Success
|
||||
* Node run started successfully
|
||||
*/
|
||||
export const zPostRagPipelinesByPipelineIdWorkflowsDraftNodesByNodeIdRunResponse = z.record(
|
||||
z.string(),
|
||||
z.unknown(),
|
||||
)
|
||||
export const zPostRagPipelinesByPipelineIdWorkflowsDraftNodesByNodeIdRunResponse
|
||||
= zWorkflowRunNodeExecutionResponse
|
||||
|
||||
export const zDeleteRagPipelinesByPipelineIdWorkflowsDraftNodesByNodeIdVariablesPath = z.object({
|
||||
pipeline_id: z.string(),
|
||||
node_id: z.string(),
|
||||
pipeline_id: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
@@ -443,8 +536,8 @@ export const zDeleteRagPipelinesByPipelineIdWorkflowsDraftNodesByNodeIdVariables
|
||||
)
|
||||
|
||||
export const zGetRagPipelinesByPipelineIdWorkflowsDraftNodesByNodeIdVariablesPath = z.object({
|
||||
pipeline_id: z.string(),
|
||||
node_id: z.string(),
|
||||
pipeline_id: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
@@ -608,8 +701,8 @@ export const zPostRagPipelinesByPipelineIdWorkflowsPublishedDatasourceNodesByNod
|
||||
|
||||
export const zPostRagPipelinesByPipelineIdWorkflowsPublishedDatasourceNodesByNodeIdPreviewPath
|
||||
= z.object({
|
||||
pipeline_id: z.string(),
|
||||
node_id: z.string(),
|
||||
pipeline_id: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
@@ -623,8 +716,8 @@ export const zPostRagPipelinesByPipelineIdWorkflowsPublishedDatasourceNodesByNod
|
||||
|
||||
export const zPostRagPipelinesByPipelineIdWorkflowsPublishedDatasourceNodesByNodeIdRunPath
|
||||
= z.object({
|
||||
pipeline_id: z.string(),
|
||||
node_id: z.string(),
|
||||
pipeline_id: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
|
||||
@@ -12,33 +12,15 @@ export type RuleCodeGeneratePayload = {
|
||||
}
|
||||
|
||||
export type ModelConfig = {
|
||||
agent_mode_dict?: JsonValue
|
||||
annotation_reply_dict?: JsonValue
|
||||
chat_prompt_config_dict?: JsonValue
|
||||
completion_prompt_config_dict?: JsonValue
|
||||
created_at?: number | null
|
||||
created_by?: string | null
|
||||
dataset_configs_dict?: JsonValue
|
||||
dataset_query_variable?: string | null
|
||||
external_data_tools_list?: JsonValue
|
||||
file_upload_dict?: JsonValue
|
||||
model_dict?: JsonValue
|
||||
more_like_this_dict?: JsonValue
|
||||
opening_statement?: string | null
|
||||
pre_prompt?: string | null
|
||||
prompt_type?: string | null
|
||||
retriever_resource_dict?: JsonValue
|
||||
sensitive_word_avoidance_dict?: JsonValue
|
||||
speech_to_text_dict?: JsonValue
|
||||
suggested_questions_after_answer_dict?: JsonValue
|
||||
suggested_questions_list?: JsonValue
|
||||
text_to_speech_dict?: JsonValue
|
||||
updated_at?: number | null
|
||||
updated_by?: string | null
|
||||
user_input_form_list?: JsonValue
|
||||
completion_params?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
mode: LlmMode
|
||||
name: string
|
||||
provider: string
|
||||
}
|
||||
|
||||
export type JsonValue = unknown
|
||||
export type LlmMode = 'chat' | 'completion'
|
||||
|
||||
export type PostRuleCodeGenerateData = {
|
||||
body: RuleCodeGeneratePayload
|
||||
|
||||
@@ -2,36 +2,21 @@
|
||||
|
||||
import * as z from 'zod'
|
||||
|
||||
export const zJsonValue = z.unknown()
|
||||
/**
|
||||
* LLMMode
|
||||
*
|
||||
* Enum class for large language model mode.
|
||||
*/
|
||||
export const zLlmMode = z.enum(['chat', 'completion'])
|
||||
|
||||
/**
|
||||
* ModelConfig
|
||||
*/
|
||||
export const zModelConfig = z.object({
|
||||
agent_mode_dict: zJsonValue.optional(),
|
||||
annotation_reply_dict: zJsonValue.optional(),
|
||||
chat_prompt_config_dict: zJsonValue.optional(),
|
||||
completion_prompt_config_dict: zJsonValue.optional(),
|
||||
created_at: z.int().nullish(),
|
||||
created_by: z.string().nullish(),
|
||||
dataset_configs_dict: zJsonValue.optional(),
|
||||
dataset_query_variable: z.string().nullish(),
|
||||
external_data_tools_list: zJsonValue.optional(),
|
||||
file_upload_dict: zJsonValue.optional(),
|
||||
model_dict: zJsonValue.optional(),
|
||||
more_like_this_dict: zJsonValue.optional(),
|
||||
opening_statement: z.string().nullish(),
|
||||
pre_prompt: z.string().nullish(),
|
||||
prompt_type: z.string().nullish(),
|
||||
retriever_resource_dict: zJsonValue.optional(),
|
||||
sensitive_word_avoidance_dict: zJsonValue.optional(),
|
||||
speech_to_text_dict: zJsonValue.optional(),
|
||||
suggested_questions_after_answer_dict: zJsonValue.optional(),
|
||||
suggested_questions_list: zJsonValue.optional(),
|
||||
text_to_speech_dict: zJsonValue.optional(),
|
||||
updated_at: z.int().nullish(),
|
||||
updated_by: z.string().nullish(),
|
||||
user_input_form_list: zJsonValue.optional(),
|
||||
completion_params: z.record(z.string(), z.unknown()).optional(),
|
||||
mode: zLlmMode,
|
||||
name: z.string(),
|
||||
provider: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
|
||||
@@ -11,33 +11,15 @@ export type RuleGeneratePayload = {
|
||||
}
|
||||
|
||||
export type ModelConfig = {
|
||||
agent_mode_dict?: JsonValue
|
||||
annotation_reply_dict?: JsonValue
|
||||
chat_prompt_config_dict?: JsonValue
|
||||
completion_prompt_config_dict?: JsonValue
|
||||
created_at?: number | null
|
||||
created_by?: string | null
|
||||
dataset_configs_dict?: JsonValue
|
||||
dataset_query_variable?: string | null
|
||||
external_data_tools_list?: JsonValue
|
||||
file_upload_dict?: JsonValue
|
||||
model_dict?: JsonValue
|
||||
more_like_this_dict?: JsonValue
|
||||
opening_statement?: string | null
|
||||
pre_prompt?: string | null
|
||||
prompt_type?: string | null
|
||||
retriever_resource_dict?: JsonValue
|
||||
sensitive_word_avoidance_dict?: JsonValue
|
||||
speech_to_text_dict?: JsonValue
|
||||
suggested_questions_after_answer_dict?: JsonValue
|
||||
suggested_questions_list?: JsonValue
|
||||
text_to_speech_dict?: JsonValue
|
||||
updated_at?: number | null
|
||||
updated_by?: string | null
|
||||
user_input_form_list?: JsonValue
|
||||
completion_params?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
mode: LlmMode
|
||||
name: string
|
||||
provider: string
|
||||
}
|
||||
|
||||
export type JsonValue = unknown
|
||||
export type LlmMode = 'chat' | 'completion'
|
||||
|
||||
export type PostRuleGenerateData = {
|
||||
body: RuleGeneratePayload
|
||||
|
||||
@@ -2,36 +2,21 @@
|
||||
|
||||
import * as z from 'zod'
|
||||
|
||||
export const zJsonValue = z.unknown()
|
||||
/**
|
||||
* LLMMode
|
||||
*
|
||||
* Enum class for large language model mode.
|
||||
*/
|
||||
export const zLlmMode = z.enum(['chat', 'completion'])
|
||||
|
||||
/**
|
||||
* ModelConfig
|
||||
*/
|
||||
export const zModelConfig = z.object({
|
||||
agent_mode_dict: zJsonValue.optional(),
|
||||
annotation_reply_dict: zJsonValue.optional(),
|
||||
chat_prompt_config_dict: zJsonValue.optional(),
|
||||
completion_prompt_config_dict: zJsonValue.optional(),
|
||||
created_at: z.int().nullish(),
|
||||
created_by: z.string().nullish(),
|
||||
dataset_configs_dict: zJsonValue.optional(),
|
||||
dataset_query_variable: z.string().nullish(),
|
||||
external_data_tools_list: zJsonValue.optional(),
|
||||
file_upload_dict: zJsonValue.optional(),
|
||||
model_dict: zJsonValue.optional(),
|
||||
more_like_this_dict: zJsonValue.optional(),
|
||||
opening_statement: z.string().nullish(),
|
||||
pre_prompt: z.string().nullish(),
|
||||
prompt_type: z.string().nullish(),
|
||||
retriever_resource_dict: zJsonValue.optional(),
|
||||
sensitive_word_avoidance_dict: zJsonValue.optional(),
|
||||
speech_to_text_dict: zJsonValue.optional(),
|
||||
suggested_questions_after_answer_dict: zJsonValue.optional(),
|
||||
suggested_questions_list: zJsonValue.optional(),
|
||||
text_to_speech_dict: zJsonValue.optional(),
|
||||
updated_at: z.int().nullish(),
|
||||
updated_by: z.string().nullish(),
|
||||
user_input_form_list: zJsonValue.optional(),
|
||||
completion_params: z.record(z.string(), z.unknown()).optional(),
|
||||
mode: zLlmMode,
|
||||
name: z.string(),
|
||||
provider: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,33 +10,15 @@ export type RuleStructuredOutputPayload = {
|
||||
}
|
||||
|
||||
export type ModelConfig = {
|
||||
agent_mode_dict?: JsonValue
|
||||
annotation_reply_dict?: JsonValue
|
||||
chat_prompt_config_dict?: JsonValue
|
||||
completion_prompt_config_dict?: JsonValue
|
||||
created_at?: number | null
|
||||
created_by?: string | null
|
||||
dataset_configs_dict?: JsonValue
|
||||
dataset_query_variable?: string | null
|
||||
external_data_tools_list?: JsonValue
|
||||
file_upload_dict?: JsonValue
|
||||
model_dict?: JsonValue
|
||||
more_like_this_dict?: JsonValue
|
||||
opening_statement?: string | null
|
||||
pre_prompt?: string | null
|
||||
prompt_type?: string | null
|
||||
retriever_resource_dict?: JsonValue
|
||||
sensitive_word_avoidance_dict?: JsonValue
|
||||
speech_to_text_dict?: JsonValue
|
||||
suggested_questions_after_answer_dict?: JsonValue
|
||||
suggested_questions_list?: JsonValue
|
||||
text_to_speech_dict?: JsonValue
|
||||
updated_at?: number | null
|
||||
updated_by?: string | null
|
||||
user_input_form_list?: JsonValue
|
||||
completion_params?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
mode: LlmMode
|
||||
name: string
|
||||
provider: string
|
||||
}
|
||||
|
||||
export type JsonValue = unknown
|
||||
export type LlmMode = 'chat' | 'completion'
|
||||
|
||||
export type PostRuleStructuredOutputGenerateData = {
|
||||
body: RuleStructuredOutputPayload
|
||||
|
||||
@@ -2,36 +2,21 @@
|
||||
|
||||
import * as z from 'zod'
|
||||
|
||||
export const zJsonValue = z.unknown()
|
||||
/**
|
||||
* LLMMode
|
||||
*
|
||||
* Enum class for large language model mode.
|
||||
*/
|
||||
export const zLlmMode = z.enum(['chat', 'completion'])
|
||||
|
||||
/**
|
||||
* ModelConfig
|
||||
*/
|
||||
export const zModelConfig = z.object({
|
||||
agent_mode_dict: zJsonValue.optional(),
|
||||
annotation_reply_dict: zJsonValue.optional(),
|
||||
chat_prompt_config_dict: zJsonValue.optional(),
|
||||
completion_prompt_config_dict: zJsonValue.optional(),
|
||||
created_at: z.int().nullish(),
|
||||
created_by: z.string().nullish(),
|
||||
dataset_configs_dict: zJsonValue.optional(),
|
||||
dataset_query_variable: z.string().nullish(),
|
||||
external_data_tools_list: zJsonValue.optional(),
|
||||
file_upload_dict: zJsonValue.optional(),
|
||||
model_dict: zJsonValue.optional(),
|
||||
more_like_this_dict: zJsonValue.optional(),
|
||||
opening_statement: z.string().nullish(),
|
||||
pre_prompt: z.string().nullish(),
|
||||
prompt_type: z.string().nullish(),
|
||||
retriever_resource_dict: zJsonValue.optional(),
|
||||
sensitive_word_avoidance_dict: zJsonValue.optional(),
|
||||
speech_to_text_dict: zJsonValue.optional(),
|
||||
suggested_questions_after_answer_dict: zJsonValue.optional(),
|
||||
suggested_questions_list: zJsonValue.optional(),
|
||||
text_to_speech_dict: zJsonValue.optional(),
|
||||
updated_at: z.int().nullish(),
|
||||
updated_by: z.string().nullish(),
|
||||
user_input_form_list: zJsonValue.optional(),
|
||||
completion_params: z.record(z.string(), z.unknown()).optional(),
|
||||
mode: zLlmMode,
|
||||
name: z.string(),
|
||||
provider: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,7 +5,9 @@ export type ClientOptions = {
|
||||
}
|
||||
|
||||
export type SystemFeatureResponse = {
|
||||
[key: string]: unknown
|
||||
features?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
}
|
||||
|
||||
export type GetSystemFeaturesData = {
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
|
||||
import * as z from 'zod'
|
||||
|
||||
export const zSystemFeatureResponse = z.record(z.string(), z.unknown())
|
||||
export const zSystemFeatureResponse = z.object({
|
||||
features: z.record(z.string(), z.unknown()).optional(),
|
||||
})
|
||||
|
||||
/**
|
||||
* Success
|
||||
|
||||
@@ -4,48 +4,18 @@ import { oc } from '@orpc/contract'
|
||||
import * as z from 'zod'
|
||||
|
||||
import {
|
||||
zDeleteTagBindingsByIdBody,
|
||||
zDeleteTagBindingsByIdPath,
|
||||
zDeleteTagBindingsByIdResponse,
|
||||
zPostTagBindingsBody,
|
||||
zPostTagBindingsCreateBody,
|
||||
zPostTagBindingsCreateResponse,
|
||||
zPostTagBindingsRemoveBody,
|
||||
zPostTagBindingsRemoveResponse,
|
||||
zPostTagBindingsResponse,
|
||||
} from './zod.gen'
|
||||
|
||||
/**
|
||||
* Deprecated legacy alias. Use POST /tag-bindings instead.
|
||||
*
|
||||
* @deprecated
|
||||
* Remove one or more tag bindings from a target.
|
||||
*/
|
||||
export const post = oc
|
||||
.route({
|
||||
deprecated: true,
|
||||
description: 'Deprecated legacy alias. Use POST /tag-bindings instead.',
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postTagBindingsCreate',
|
||||
path: '/tag-bindings/create',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ body: zPostTagBindingsCreateBody }))
|
||||
.output(zPostTagBindingsCreateResponse)
|
||||
|
||||
export const create = {
|
||||
post,
|
||||
}
|
||||
|
||||
/**
|
||||
* Deprecated legacy alias. Use DELETE /tag-bindings/{id} instead.
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
export const post2 = oc
|
||||
.route({
|
||||
deprecated: true,
|
||||
description: 'Deprecated legacy alias. Use DELETE /tag-bindings/{id} instead.',
|
||||
description: 'Remove one or more tag bindings from a target.',
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postTagBindingsRemove',
|
||||
@@ -56,25 +26,10 @@ export const post2 = oc
|
||||
.output(zPostTagBindingsRemoveResponse)
|
||||
|
||||
export const remove = {
|
||||
post: post2,
|
||||
post,
|
||||
}
|
||||
|
||||
export const delete_ = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'DELETE',
|
||||
operationId: 'deleteTagBindingsById',
|
||||
path: '/tag-bindings/{id}',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ body: zDeleteTagBindingsByIdBody, params: zDeleteTagBindingsByIdPath }))
|
||||
.output(zDeleteTagBindingsByIdResponse)
|
||||
|
||||
export const byId = {
|
||||
delete: delete_,
|
||||
}
|
||||
|
||||
export const post3 = oc
|
||||
export const post2 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
@@ -86,10 +41,8 @@ export const post3 = oc
|
||||
.output(zPostTagBindingsResponse)
|
||||
|
||||
export const tagBindings = {
|
||||
post: post3,
|
||||
create,
|
||||
post: post2,
|
||||
remove,
|
||||
byId,
|
||||
}
|
||||
|
||||
export const contract = {
|
||||
|
||||
@@ -11,17 +11,12 @@ export type TagBindingPayload = {
|
||||
}
|
||||
|
||||
export type TagBindingRemovePayload = {
|
||||
tag_id: string
|
||||
tag_ids: Array<string>
|
||||
target_id: string
|
||||
type: TagType
|
||||
}
|
||||
|
||||
export type TagBindingItemDeletePayload = {
|
||||
target_id: string
|
||||
type: TagType
|
||||
}
|
||||
|
||||
export type TagType = 'knowledge' | 'app'
|
||||
export type TagType = 'app' | 'knowledge'
|
||||
|
||||
export type PostTagBindingsData = {
|
||||
body: TagBindingPayload
|
||||
@@ -38,22 +33,6 @@ export type PostTagBindingsResponses = {
|
||||
|
||||
export type PostTagBindingsResponse = PostTagBindingsResponses[keyof PostTagBindingsResponses]
|
||||
|
||||
export type PostTagBindingsCreateData = {
|
||||
body: TagBindingPayload
|
||||
path?: never
|
||||
query?: never
|
||||
url: '/tag-bindings/create'
|
||||
}
|
||||
|
||||
export type PostTagBindingsCreateResponses = {
|
||||
200: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
}
|
||||
|
||||
export type PostTagBindingsCreateResponse
|
||||
= PostTagBindingsCreateResponses[keyof PostTagBindingsCreateResponses]
|
||||
|
||||
export type PostTagBindingsRemoveData = {
|
||||
body: TagBindingRemovePayload
|
||||
path?: never
|
||||
@@ -69,21 +48,3 @@ export type PostTagBindingsRemoveResponses = {
|
||||
|
||||
export type PostTagBindingsRemoveResponse
|
||||
= PostTagBindingsRemoveResponses[keyof PostTagBindingsRemoveResponses]
|
||||
|
||||
export type DeleteTagBindingsByIdData = {
|
||||
body: TagBindingItemDeletePayload
|
||||
path: {
|
||||
id: string
|
||||
}
|
||||
query?: never
|
||||
url: '/tag-bindings/{id}'
|
||||
}
|
||||
|
||||
export type DeleteTagBindingsByIdResponses = {
|
||||
200: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
}
|
||||
|
||||
export type DeleteTagBindingsByIdResponse
|
||||
= DeleteTagBindingsByIdResponses[keyof DeleteTagBindingsByIdResponses]
|
||||
|
||||
@@ -7,7 +7,7 @@ import * as z from 'zod'
|
||||
*
|
||||
* Tag type
|
||||
*/
|
||||
export const zTagType = z.enum(['knowledge', 'app'])
|
||||
export const zTagType = z.enum(['app', 'knowledge'])
|
||||
|
||||
/**
|
||||
* TagBindingPayload
|
||||
@@ -22,15 +22,7 @@ export const zTagBindingPayload = z.object({
|
||||
* TagBindingRemovePayload
|
||||
*/
|
||||
export const zTagBindingRemovePayload = z.object({
|
||||
tag_id: z.string(),
|
||||
target_id: z.string(),
|
||||
type: zTagType,
|
||||
})
|
||||
|
||||
/**
|
||||
* TagBindingItemDeletePayload
|
||||
*/
|
||||
export const zTagBindingItemDeletePayload = z.object({
|
||||
tag_ids: z.array(z.string()).min(1),
|
||||
target_id: z.string(),
|
||||
type: zTagType,
|
||||
})
|
||||
@@ -42,27 +34,9 @@ export const zPostTagBindingsBody = zTagBindingPayload
|
||||
*/
|
||||
export const zPostTagBindingsResponse = z.record(z.string(), z.unknown())
|
||||
|
||||
export const zPostTagBindingsCreateBody = zTagBindingPayload
|
||||
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
export const zPostTagBindingsCreateResponse = z.record(z.string(), z.unknown())
|
||||
|
||||
export const zPostTagBindingsRemoveBody = zTagBindingRemovePayload
|
||||
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
export const zPostTagBindingsRemoveResponse = z.record(z.string(), z.unknown())
|
||||
|
||||
export const zDeleteTagBindingsByIdBody = zTagBindingItemDeletePayload
|
||||
|
||||
export const zDeleteTagBindingsByIdPath = z.object({
|
||||
id: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
export const zDeleteTagBindingsByIdResponse = z.record(z.string(), z.unknown())
|
||||
|
||||
@@ -16,14 +16,14 @@ export type TagBasePayload = {
|
||||
type: TagType
|
||||
}
|
||||
|
||||
export type TagType = 'knowledge' | 'app'
|
||||
export type TagType = 'app' | 'knowledge'
|
||||
|
||||
export type GetTagsData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: {
|
||||
type?: string
|
||||
keyword?: string
|
||||
type?: string
|
||||
}
|
||||
url: '/tags'
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ export const zTagResponse = z.object({
|
||||
*
|
||||
* Tag type
|
||||
*/
|
||||
export const zTagType = z.enum(['knowledge', 'app'])
|
||||
export const zTagType = z.enum(['app', 'knowledge'])
|
||||
|
||||
/**
|
||||
* TagBasePayload
|
||||
@@ -28,8 +28,8 @@ export const zTagBasePayload = z.object({
|
||||
})
|
||||
|
||||
export const zGetTagsQuery = z.object({
|
||||
type: z.string().optional(),
|
||||
keyword: z.string().optional(),
|
||||
type: z.string().optional(),
|
||||
})
|
||||
|
||||
/**
|
||||
|
||||
@@ -8,7 +8,7 @@ export type WebsiteCrawlPayload = {
|
||||
options: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
provider: 'firecrawl' | 'watercrawl' | 'jinareader'
|
||||
provider: 'firecrawl' | 'jinareader' | 'watercrawl'
|
||||
url: string
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ export type GetWebsiteCrawlStatusByJobIdData = {
|
||||
job_id: string
|
||||
}
|
||||
query: {
|
||||
provider: 'firecrawl' | 'watercrawl' | 'jinareader'
|
||||
provider: 'firecrawl' | 'jinareader' | 'watercrawl'
|
||||
}
|
||||
url: '/website/crawl/status/{job_id}'
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import * as z from 'zod'
|
||||
*/
|
||||
export const zWebsiteCrawlPayload = z.object({
|
||||
options: z.record(z.string(), z.unknown()),
|
||||
provider: z.enum(['firecrawl', 'watercrawl', 'jinareader']),
|
||||
provider: z.enum(['firecrawl', 'jinareader', 'watercrawl']),
|
||||
url: z.string(),
|
||||
})
|
||||
|
||||
@@ -23,7 +23,7 @@ export const zGetWebsiteCrawlStatusByJobIdPath = z.object({
|
||||
})
|
||||
|
||||
export const zGetWebsiteCrawlStatusByJobIdQuery = z.object({
|
||||
provider: z.enum(['firecrawl', 'watercrawl', 'jinareader']),
|
||||
provider: z.enum(['firecrawl', 'jinareader', 'watercrawl']),
|
||||
})
|
||||
|
||||
/**
|
||||
|
||||
@@ -38,6 +38,7 @@ export const events = {
|
||||
/**
|
||||
* Get workflow pause details
|
||||
*
|
||||
* Get workflow pause details
|
||||
* GET /console/api/workflow/<workflow_run_id>/pause-details
|
||||
*
|
||||
* Returns information about why and where the workflow is paused.
|
||||
@@ -45,7 +46,7 @@ export const events = {
|
||||
export const get2 = oc
|
||||
.route({
|
||||
description:
|
||||
'GET /console/api/workflow/<workflow_run_id>/pause-details\n\nReturns information about why and where the workflow is paused.',
|
||||
'Get workflow pause details\nGET /console/api/workflow/<workflow_run_id>/pause-details\n\nReturns information about why and where the workflow is paused.',
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getWorkflowByWorkflowRunIdPauseDetails',
|
||||
|
||||
@@ -4,6 +4,23 @@ export type ClientOptions = {
|
||||
baseUrl: `${string}://${string}/console/api` | (string & {})
|
||||
}
|
||||
|
||||
export type WorkflowPauseDetailsResponse = {
|
||||
paused_at?: string | null
|
||||
paused_nodes: Array<PausedNodeResponse>
|
||||
}
|
||||
|
||||
export type PausedNodeResponse = {
|
||||
node_id: string
|
||||
node_title: string
|
||||
pause_type: HumanInputPauseTypeResponse
|
||||
}
|
||||
|
||||
export type HumanInputPauseTypeResponse = {
|
||||
backstage_input_url?: string | null
|
||||
form_id: string
|
||||
type: string
|
||||
}
|
||||
|
||||
export type GetWorkflowByWorkflowRunIdEventsData = {
|
||||
body?: never
|
||||
path: {
|
||||
@@ -31,11 +48,18 @@ export type GetWorkflowByWorkflowRunIdPauseDetailsData = {
|
||||
url: '/workflow/{workflow_run_id}/pause-details'
|
||||
}
|
||||
|
||||
export type GetWorkflowByWorkflowRunIdPauseDetailsResponses = {
|
||||
200: {
|
||||
export type GetWorkflowByWorkflowRunIdPauseDetailsErrors = {
|
||||
404: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
}
|
||||
|
||||
export type GetWorkflowByWorkflowRunIdPauseDetailsError
|
||||
= GetWorkflowByWorkflowRunIdPauseDetailsErrors[keyof GetWorkflowByWorkflowRunIdPauseDetailsErrors]
|
||||
|
||||
export type GetWorkflowByWorkflowRunIdPauseDetailsResponses = {
|
||||
200: WorkflowPauseDetailsResponse
|
||||
}
|
||||
|
||||
export type GetWorkflowByWorkflowRunIdPauseDetailsResponse
|
||||
= GetWorkflowByWorkflowRunIdPauseDetailsResponses[keyof GetWorkflowByWorkflowRunIdPauseDetailsResponses]
|
||||
|
||||
@@ -2,6 +2,32 @@
|
||||
|
||||
import * as z from 'zod'
|
||||
|
||||
/**
|
||||
* HumanInputPauseTypeResponse
|
||||
*/
|
||||
export const zHumanInputPauseTypeResponse = z.object({
|
||||
backstage_input_url: z.string().nullish(),
|
||||
form_id: z.string(),
|
||||
type: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* PausedNodeResponse
|
||||
*/
|
||||
export const zPausedNodeResponse = z.object({
|
||||
node_id: z.string(),
|
||||
node_title: z.string(),
|
||||
pause_type: zHumanInputPauseTypeResponse,
|
||||
})
|
||||
|
||||
/**
|
||||
* WorkflowPauseDetailsResponse
|
||||
*/
|
||||
export const zWorkflowPauseDetailsResponse = z.object({
|
||||
paused_at: z.string().nullish(),
|
||||
paused_nodes: z.array(zPausedNodeResponse),
|
||||
})
|
||||
|
||||
export const zGetWorkflowByWorkflowRunIdEventsPath = z.object({
|
||||
workflow_run_id: z.string(),
|
||||
})
|
||||
@@ -16,6 +42,6 @@ export const zGetWorkflowByWorkflowRunIdPauseDetailsPath = z.object({
|
||||
})
|
||||
|
||||
/**
|
||||
* Success
|
||||
* Workflow pause details retrieved successfully
|
||||
*/
|
||||
export const zGetWorkflowByWorkflowRunIdPauseDetailsResponse = z.record(z.string(), z.unknown())
|
||||
export const zGetWorkflowByWorkflowRunIdPauseDetailsResponse = zWorkflowPauseDetailsResponse
|
||||
|
||||
@@ -201,7 +201,7 @@ export type LoadBalancingCredentialPayload = {
|
||||
}
|
||||
|
||||
export type ParserPreferredProviderType = {
|
||||
preferred_provider_type: 'system' | 'custom'
|
||||
preferred_provider_type: 'custom' | 'system'
|
||||
}
|
||||
|
||||
export type ParserGithubInstall = {
|
||||
@@ -487,9 +487,9 @@ export type Inner = {
|
||||
provider?: string | null
|
||||
}
|
||||
|
||||
export type TenantAccountRole = 'owner' | 'admin' | 'editor' | 'normal' | 'dataset_operator'
|
||||
export type TenantAccountRole = 'admin' | 'dataset_operator' | 'editor' | 'normal' | 'owner'
|
||||
|
||||
export type ModelType = 'llm' | 'text-embedding' | 'rerank' | 'speech2text' | 'moderation' | 'tts'
|
||||
export type ModelType = 'llm' | 'moderation' | 'rerank' | 'speech2text' | 'text-embedding' | 'tts'
|
||||
|
||||
export type LoadBalancingPayload = {
|
||||
configs?: Array<{
|
||||
@@ -498,9 +498,9 @@ export type LoadBalancingPayload = {
|
||||
enabled?: boolean | null
|
||||
}
|
||||
|
||||
export type DebugPermission = 'everyone' | 'admins' | 'noone'
|
||||
export type DebugPermission = 'admins' | 'everyone' | 'noone'
|
||||
|
||||
export type InstallPermission = 'everyone' | 'admins' | 'noone'
|
||||
export type InstallPermission = 'admins' | 'everyone' | 'noone'
|
||||
|
||||
export type PluginAutoUpgradeSettingsPayload = {
|
||||
exclude_plugins?: Array<string>
|
||||
@@ -515,7 +515,7 @@ export type PluginPermissionSettingsPayload = {
|
||||
install_permission?: InstallPermission
|
||||
}
|
||||
|
||||
export type ApiProviderSchemaType = 'openapi' | 'swagger' | 'openai_plugin' | 'openai_actions'
|
||||
export type ApiProviderSchemaType = 'openai_actions' | 'openai_plugin' | 'openapi' | 'swagger'
|
||||
|
||||
export type CredentialType = 'api-key' | 'oauth2' | 'unauthorized'
|
||||
|
||||
@@ -527,9 +527,9 @@ export type WorkflowToolParameterConfiguration = {
|
||||
|
||||
export type StrategySetting = 'disabled' | 'fix_only' | 'latest'
|
||||
|
||||
export type UpgradeMode = 'all' | 'partial' | 'exclude'
|
||||
export type UpgradeMode = 'all' | 'exclude' | 'partial'
|
||||
|
||||
export type ToolParameterForm = 'schema' | 'form' | 'llm'
|
||||
export type ToolParameterForm = 'form' | 'llm' | 'schema'
|
||||
|
||||
export type GetWorkspacesData = {
|
||||
body?: never
|
||||
@@ -1354,8 +1354,8 @@ export type PostWorkspacesCurrentModelProvidersByProviderModelsLoadBalancingConf
|
||||
= {
|
||||
body: LoadBalancingCredentialPayload
|
||||
path: {
|
||||
provider: string
|
||||
config_id: string
|
||||
provider: string
|
||||
}
|
||||
query?: never
|
||||
url: '/workspaces/current/model-providers/{provider}/models/load-balancing-configs/{config_id}/credentials-validate'
|
||||
@@ -1844,8 +1844,8 @@ export type PostWorkspacesCurrentPluginTasksByTaskIdDeleteResponse
|
||||
export type PostWorkspacesCurrentPluginTasksByTaskIdDeleteByIdentifierData = {
|
||||
body?: never
|
||||
path: {
|
||||
task_id: string
|
||||
identifier: string
|
||||
task_id: string
|
||||
}
|
||||
query?: never
|
||||
url: '/workspaces/current/plugin/tasks/{task_id}/delete/{identifier}'
|
||||
@@ -2140,8 +2140,8 @@ export type GetWorkspacesCurrentToolProviderBuiltinByProviderCredentialSchemaByC
|
||||
= {
|
||||
body?: never
|
||||
path: {
|
||||
provider: string
|
||||
credential_type: string
|
||||
provider: string
|
||||
}
|
||||
query?: never
|
||||
url: '/workspaces/current/tool-provider/builtin/{provider}/credential/schema/{credential_type}'
|
||||
@@ -3004,10 +3004,10 @@ export type PostWorkspacesSwitchResponse
|
||||
export type GetWorkspacesByTenantIdModelProvidersByProviderByIconTypeByLangData = {
|
||||
body?: never
|
||||
path: {
|
||||
tenant_id: string
|
||||
provider: string
|
||||
icon_type: string
|
||||
lang: string
|
||||
provider: string
|
||||
tenant_id: string
|
||||
}
|
||||
query?: never
|
||||
url: '/workspaces/{tenant_id}/model-providers/{provider}/{icon_type}/{lang}'
|
||||
|
||||
@@ -173,7 +173,7 @@ export const zParserCredentialValidate = z.object({
|
||||
* ParserPreferredProviderType
|
||||
*/
|
||||
export const zParserPreferredProviderType = z.object({
|
||||
preferred_provider_type: z.enum(['system', 'custom']),
|
||||
preferred_provider_type: z.enum(['custom', 'system']),
|
||||
})
|
||||
|
||||
/**
|
||||
@@ -431,7 +431,7 @@ export const zAccountWithRoleList = z.object({
|
||||
/**
|
||||
* TenantAccountRole
|
||||
*/
|
||||
export const zTenantAccountRole = z.enum(['owner', 'admin', 'editor', 'normal', 'dataset_operator'])
|
||||
export const zTenantAccountRole = z.enum(['admin', 'dataset_operator', 'editor', 'normal', 'owner'])
|
||||
|
||||
/**
|
||||
* MemberInvitePayload
|
||||
@@ -449,10 +449,10 @@ export const zMemberInvitePayload = z.object({
|
||||
*/
|
||||
export const zModelType = z.enum([
|
||||
'llm',
|
||||
'text-embedding',
|
||||
'moderation',
|
||||
'rerank',
|
||||
'speech2text',
|
||||
'moderation',
|
||||
'text-embedding',
|
||||
'tts',
|
||||
])
|
||||
|
||||
@@ -559,12 +559,12 @@ export const zParserPostModels = z.object({
|
||||
/**
|
||||
* DebugPermission
|
||||
*/
|
||||
export const zDebugPermission = z.enum(['everyone', 'admins', 'noone'])
|
||||
export const zDebugPermission = z.enum(['admins', 'everyone', 'noone'])
|
||||
|
||||
/**
|
||||
* InstallPermission
|
||||
*/
|
||||
export const zInstallPermission = z.enum(['everyone', 'admins', 'noone'])
|
||||
export const zInstallPermission = z.enum(['admins', 'everyone', 'noone'])
|
||||
|
||||
/**
|
||||
* ParserPermissionChange
|
||||
@@ -588,10 +588,10 @@ export const zPluginPermissionSettingsPayload = z.object({
|
||||
* Enum class for api provider schema type.
|
||||
*/
|
||||
export const zApiProviderSchemaType = z.enum([
|
||||
'openai_actions',
|
||||
'openai_plugin',
|
||||
'openapi',
|
||||
'swagger',
|
||||
'openai_plugin',
|
||||
'openai_actions',
|
||||
])
|
||||
|
||||
/**
|
||||
@@ -657,7 +657,7 @@ export const zStrategySetting = z.enum(['disabled', 'fix_only', 'latest'])
|
||||
/**
|
||||
* UpgradeMode
|
||||
*/
|
||||
export const zUpgradeMode = z.enum(['all', 'partial', 'exclude'])
|
||||
export const zUpgradeMode = z.enum(['all', 'exclude', 'partial'])
|
||||
|
||||
/**
|
||||
* PluginAutoUpgradeSettingsPayload
|
||||
@@ -681,7 +681,7 @@ export const zParserPreferencesChange = z.object({
|
||||
/**
|
||||
* ToolParameterForm
|
||||
*/
|
||||
export const zToolParameterForm = z.enum(['schema', 'form', 'llm'])
|
||||
export const zToolParameterForm = z.enum(['form', 'llm', 'schema'])
|
||||
|
||||
/**
|
||||
* WorkflowToolParameterConfiguration
|
||||
@@ -1214,8 +1214,8 @@ export const zPostWorkspacesCurrentModelProvidersByProviderModelsLoadBalancingCo
|
||||
|
||||
export const zPostWorkspacesCurrentModelProvidersByProviderModelsLoadBalancingConfigsByConfigIdCredentialsValidatePath
|
||||
= z.object({
|
||||
provider: z.string(),
|
||||
config_id: z.string(),
|
||||
provider: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
@@ -1484,8 +1484,8 @@ export const zPostWorkspacesCurrentPluginTasksByTaskIdDeleteResponse = z.record(
|
||||
)
|
||||
|
||||
export const zPostWorkspacesCurrentPluginTasksByTaskIdDeleteByIdentifierPath = z.object({
|
||||
task_id: z.string(),
|
||||
identifier: z.string(),
|
||||
task_id: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
@@ -1623,8 +1623,8 @@ export const zGetWorkspacesCurrentToolProviderBuiltinByProviderCredentialInfoRes
|
||||
|
||||
export const zGetWorkspacesCurrentToolProviderBuiltinByProviderCredentialSchemaByCredentialTypePath
|
||||
= z.object({
|
||||
provider: z.string(),
|
||||
credential_type: z.string(),
|
||||
provider: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
@@ -2135,10 +2135,10 @@ export const zPostWorkspacesSwitchBody = zSwitchWorkspacePayload
|
||||
export const zPostWorkspacesSwitchResponse = z.record(z.string(), z.unknown())
|
||||
|
||||
export const zGetWorkspacesByTenantIdModelProvidersByProviderByIconTypeByLangPath = z.object({
|
||||
tenant_id: z.string(),
|
||||
provider: z.string(),
|
||||
icon_type: z.string(),
|
||||
lang: z.string(),
|
||||
provider: z.string(),
|
||||
tenant_id: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
|
||||
@@ -703,11 +703,11 @@ export const binding = {
|
||||
}
|
||||
|
||||
/**
|
||||
* Unbind a tag from a dataset
|
||||
* Unbind tags from a dataset
|
||||
*/
|
||||
export const post11 = oc
|
||||
.route({
|
||||
description: 'Unbind a tag from a dataset',
|
||||
description: 'Unbind tags from a dataset',
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postDatasetsTagsUnbinding',
|
||||
|
||||
@@ -72,10 +72,34 @@ export type CompletionRequestPayload = {
|
||||
retriever_from?: string
|
||||
}
|
||||
|
||||
export type Condition = {
|
||||
comparison_operator:
|
||||
| '<'
|
||||
| '='
|
||||
| '>'
|
||||
| 'after'
|
||||
| 'before'
|
||||
| 'contains'
|
||||
| 'empty'
|
||||
| 'end with'
|
||||
| 'in'
|
||||
| 'is'
|
||||
| 'is not'
|
||||
| 'not contains'
|
||||
| 'not empty'
|
||||
| 'not in'
|
||||
| 'start with'
|
||||
| '≠'
|
||||
| '≤'
|
||||
| '≥'
|
||||
name: string
|
||||
value?: unknown
|
||||
}
|
||||
|
||||
export type ConversationListQuery = {
|
||||
last_id?: string | null
|
||||
limit?: number
|
||||
sort_by?: 'created_at' | '-created_at' | 'updated_at' | '-updated_at'
|
||||
sort_by?: '-created_at' | '-updated_at' | 'created_at' | 'updated_at'
|
||||
}
|
||||
|
||||
export type ConversationRenamePayload = {
|
||||
@@ -109,13 +133,20 @@ export type ConversationVariablesQuery = {
|
||||
variable_name?: string | null
|
||||
}
|
||||
|
||||
export type DataSetTag = {
|
||||
binding_count?: string | null
|
||||
id: string
|
||||
name: string
|
||||
type: string
|
||||
}
|
||||
|
||||
export type DatasetCreatePayload = {
|
||||
description?: string
|
||||
embedding_model?: string | null
|
||||
embedding_model_provider?: string | null
|
||||
external_knowledge_api_id?: string | null
|
||||
external_knowledge_id?: string | null
|
||||
indexing_technique?: 'high_quality' | 'economy' | null
|
||||
indexing_technique?: 'economy' | 'high_quality' | null
|
||||
name: string
|
||||
permission?: DatasetPermissionEnum
|
||||
provider?: string
|
||||
@@ -125,6 +156,16 @@ export type DatasetCreatePayload = {
|
||||
} | null
|
||||
}
|
||||
|
||||
export type DatasetListQuery = {
|
||||
include_all?: boolean
|
||||
keyword?: string | null
|
||||
limit?: number
|
||||
page?: number
|
||||
tag_ids?: Array<string>
|
||||
}
|
||||
|
||||
export type DatasetPermissionEnum = 'all_team_members' | 'only_me' | 'partial_members'
|
||||
|
||||
export type DatasetUpdatePayload = {
|
||||
description?: string | null
|
||||
embedding_model?: string | null
|
||||
@@ -134,7 +175,7 @@ export type DatasetUpdatePayload = {
|
||||
external_retrieval_model?: {
|
||||
[key: string]: unknown
|
||||
} | null
|
||||
indexing_technique?: 'high_quality' | 'economy' | null
|
||||
indexing_technique?: 'economy' | 'high_quality' | null
|
||||
name?: string | null
|
||||
partial_member_list?: Array<{
|
||||
[key: string]: string
|
||||
@@ -143,10 +184,32 @@ export type DatasetUpdatePayload = {
|
||||
retrieval_model?: RetrievalModel
|
||||
}
|
||||
|
||||
export type DatasourceNodeRunPayload = {
|
||||
credential_id?: string | null
|
||||
datasource_type: string
|
||||
inputs: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
is_published: boolean
|
||||
}
|
||||
|
||||
export type DocumentBatchDownloadZipPayload = {
|
||||
document_ids: Array<string>
|
||||
}
|
||||
|
||||
export type DocumentListQuery = {
|
||||
keyword?: string | null
|
||||
limit?: number
|
||||
page?: number
|
||||
status?: string | null
|
||||
}
|
||||
|
||||
export type DocumentMetadataOperation = {
|
||||
document_id: string
|
||||
metadata_list: Array<MetadataDetail>
|
||||
partial_update?: boolean
|
||||
}
|
||||
|
||||
export type DocumentTextCreatePayload = {
|
||||
doc_form?: string
|
||||
doc_language?: string
|
||||
@@ -211,9 +274,11 @@ export type HumanInputFormSubmitPayload = {
|
||||
}
|
||||
}
|
||||
|
||||
export type JsonValue = unknown
|
||||
|
||||
export type MessageFeedbackPayload = {
|
||||
content?: string | null
|
||||
rating?: 'like' | 'dislike' | null
|
||||
rating?: 'dislike' | 'like' | null
|
||||
}
|
||||
|
||||
export type MessageListQuery = {
|
||||
@@ -224,7 +289,18 @@ export type MessageListQuery = {
|
||||
|
||||
export type MetadataArgs = {
|
||||
name: string
|
||||
type: 'string' | 'number' | 'time'
|
||||
type: 'number' | 'string' | 'time'
|
||||
}
|
||||
|
||||
export type MetadataDetail = {
|
||||
id: string
|
||||
name: string
|
||||
value?: unknown
|
||||
}
|
||||
|
||||
export type MetadataFilteringCondition = {
|
||||
conditions?: Array<Condition> | null
|
||||
logical_operator?: 'and' | 'or' | null
|
||||
}
|
||||
|
||||
export type MetadataOperationData = {
|
||||
@@ -235,6 +311,59 @@ export type MetadataUpdatePayload = {
|
||||
name: string
|
||||
}
|
||||
|
||||
export type PipelineRunApiEntity = {
|
||||
datasource_info_list: Array<{
|
||||
[key: string]: unknown
|
||||
}>
|
||||
datasource_type: string
|
||||
inputs: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
is_published: boolean
|
||||
response_mode: string
|
||||
start_node_id: string
|
||||
}
|
||||
|
||||
export type PreProcessingRule = {
|
||||
enabled: boolean
|
||||
id: string
|
||||
}
|
||||
|
||||
export type ProcessRule = {
|
||||
mode: 'automatic' | 'custom' | 'hierarchical'
|
||||
rules?: Rule
|
||||
}
|
||||
|
||||
export type RerankingModel = {
|
||||
reranking_model_name?: string | null
|
||||
reranking_provider_name?: string | null
|
||||
}
|
||||
|
||||
export type RetrievalMethod
|
||||
= | 'full_text_search'
|
||||
| 'hybrid_search'
|
||||
| 'keyword_search'
|
||||
| 'semantic_search'
|
||||
|
||||
export type RetrievalModel = {
|
||||
metadata_filtering_conditions?: MetadataFilteringCondition
|
||||
reranking_enable: boolean
|
||||
reranking_mode?: string | null
|
||||
reranking_model?: RerankingModel
|
||||
score_threshold?: number | null
|
||||
score_threshold_enabled: boolean
|
||||
search_method: RetrievalMethod
|
||||
top_k: number
|
||||
weights?: WeightModel
|
||||
}
|
||||
|
||||
export type Rule = {
|
||||
parent_mode?: 'full-doc' | 'paragraph' | null
|
||||
pre_processing_rules?: Array<PreProcessingRule> | null
|
||||
segmentation?: Segmentation
|
||||
subchunk_segmentation?: Segmentation
|
||||
}
|
||||
|
||||
export type SegmentCreatePayload = {
|
||||
segments?: Array<{
|
||||
[key: string]: unknown
|
||||
@@ -246,10 +375,39 @@ export type SegmentListQuery = {
|
||||
status?: Array<string>
|
||||
}
|
||||
|
||||
export type SegmentUpdateArgs = {
|
||||
answer?: string | null
|
||||
attachment_ids?: Array<string> | null
|
||||
content?: string | null
|
||||
enabled?: boolean | null
|
||||
keywords?: Array<string> | null
|
||||
regenerate_child_chunks?: boolean
|
||||
summary?: string | null
|
||||
}
|
||||
|
||||
export type SegmentUpdatePayload = {
|
||||
segment: SegmentUpdateArgs
|
||||
}
|
||||
|
||||
export type Segmentation = {
|
||||
chunk_overlap?: number
|
||||
max_tokens: number
|
||||
separator?: string
|
||||
}
|
||||
|
||||
export type SimpleAccount = {
|
||||
email: string
|
||||
id: string
|
||||
name: string
|
||||
}
|
||||
|
||||
export type SimpleEndUser = {
|
||||
id: string
|
||||
is_anonymous: boolean
|
||||
session_id?: string | null
|
||||
type: string
|
||||
}
|
||||
|
||||
export type TagBindingPayload = {
|
||||
tag_ids: Array<string>
|
||||
target_id: string
|
||||
@@ -264,7 +422,8 @@ export type TagDeletePayload = {
|
||||
}
|
||||
|
||||
export type TagUnbindingPayload = {
|
||||
tag_id: string
|
||||
tag_id?: string | null
|
||||
tag_ids?: Array<string>
|
||||
target_id: string
|
||||
}
|
||||
|
||||
@@ -280,6 +439,22 @@ export type TextToAudioPayload = {
|
||||
voice?: string | null
|
||||
}
|
||||
|
||||
export type WeightKeywordSetting = {
|
||||
keyword_weight: number
|
||||
}
|
||||
|
||||
export type WeightModel = {
|
||||
keyword_setting?: WeightKeywordSetting
|
||||
vector_setting?: WeightVectorSetting
|
||||
weight_type?: 'customized' | 'keyword_first' | 'semantic_first' | null
|
||||
}
|
||||
|
||||
export type WeightVectorSetting = {
|
||||
embedding_model_name: string
|
||||
embedding_provider_name: string
|
||||
vector_weight: number
|
||||
}
|
||||
|
||||
export type WorkflowAppLogPaginationResponse = {
|
||||
data: Array<WorkflowAppLogPartialResponse>
|
||||
has_more: boolean
|
||||
@@ -288,6 +463,17 @@ export type WorkflowAppLogPaginationResponse = {
|
||||
total: number
|
||||
}
|
||||
|
||||
export type WorkflowAppLogPartialResponse = {
|
||||
created_at?: number | null
|
||||
created_by_account?: SimpleAccount
|
||||
created_by_end_user?: SimpleEndUser
|
||||
created_by_role?: string | null
|
||||
created_from?: string | null
|
||||
details?: unknown
|
||||
id: string
|
||||
workflow_run?: WorkflowRunForLogResponse
|
||||
}
|
||||
|
||||
export type WorkflowLogQuery = {
|
||||
created_at__after?: string | null
|
||||
created_at__before?: string | null
|
||||
@@ -296,7 +482,21 @@ export type WorkflowLogQuery = {
|
||||
keyword?: string | null
|
||||
limit?: number
|
||||
page?: number
|
||||
status?: 'succeeded' | 'failed' | 'stopped' | null
|
||||
status?: 'failed' | 'stopped' | 'succeeded' | null
|
||||
}
|
||||
|
||||
export type WorkflowRunForLogResponse = {
|
||||
created_at?: number | null
|
||||
elapsed_time?: unknown
|
||||
error?: string | null
|
||||
exceptions_count?: number | null
|
||||
finished_at?: number | null
|
||||
id: string
|
||||
status?: string | null
|
||||
total_steps?: number | null
|
||||
total_tokens?: number | null
|
||||
triggered_from?: string | null
|
||||
version?: string | null
|
||||
}
|
||||
|
||||
export type WorkflowRunPayload = {
|
||||
@@ -325,161 +525,6 @@ export type WorkflowRunResponse = {
|
||||
workflow_id: string
|
||||
}
|
||||
|
||||
export type Condition = {
|
||||
comparison_operator:
|
||||
| 'contains'
|
||||
| 'not contains'
|
||||
| 'start with'
|
||||
| 'end with'
|
||||
| 'is'
|
||||
| 'is not'
|
||||
| 'empty'
|
||||
| 'not empty'
|
||||
| 'in'
|
||||
| 'not in'
|
||||
| '='
|
||||
| '≠'
|
||||
| '>'
|
||||
| '<'
|
||||
| '≥'
|
||||
| '≤'
|
||||
| 'before'
|
||||
| 'after'
|
||||
name: string
|
||||
value?: unknown
|
||||
}
|
||||
|
||||
export type DatasetPermissionEnum = 'only_me' | 'all_team_members' | 'partial_members'
|
||||
|
||||
export type MetadataFilteringCondition = {
|
||||
conditions?: Array<Condition> | null
|
||||
logical_operator?: 'and' | 'or' | null
|
||||
}
|
||||
|
||||
export type RerankingModel = {
|
||||
reranking_model_name?: string | null
|
||||
reranking_provider_name?: string | null
|
||||
}
|
||||
|
||||
export type RetrievalMethod
|
||||
= | 'semantic_search'
|
||||
| 'full_text_search'
|
||||
| 'hybrid_search'
|
||||
| 'keyword_search'
|
||||
|
||||
export type RetrievalModel = {
|
||||
metadata_filtering_conditions?: MetadataFilteringCondition
|
||||
reranking_enable: boolean
|
||||
reranking_mode?: string | null
|
||||
reranking_model?: RerankingModel
|
||||
score_threshold?: number | null
|
||||
score_threshold_enabled: boolean
|
||||
search_method: RetrievalMethod
|
||||
top_k: number
|
||||
weights?: WeightModel
|
||||
}
|
||||
|
||||
export type WeightKeywordSetting = {
|
||||
keyword_weight: number
|
||||
}
|
||||
|
||||
export type WeightModel = {
|
||||
keyword_setting?: WeightKeywordSetting
|
||||
vector_setting?: WeightVectorSetting
|
||||
weight_type?: 'semantic_first' | 'keyword_first' | 'customized' | null
|
||||
}
|
||||
|
||||
export type WeightVectorSetting = {
|
||||
embedding_model_name: string
|
||||
embedding_provider_name: string
|
||||
vector_weight: number
|
||||
}
|
||||
|
||||
export type PreProcessingRule = {
|
||||
enabled: boolean
|
||||
id: string
|
||||
}
|
||||
|
||||
export type ProcessRule = {
|
||||
mode: 'automatic' | 'custom' | 'hierarchical'
|
||||
rules?: Rule
|
||||
}
|
||||
|
||||
export type Rule = {
|
||||
parent_mode?: 'full-doc' | 'paragraph' | null
|
||||
pre_processing_rules?: Array<PreProcessingRule> | null
|
||||
segmentation?: Segmentation
|
||||
subchunk_segmentation?: Segmentation
|
||||
}
|
||||
|
||||
export type Segmentation = {
|
||||
chunk_overlap?: number
|
||||
max_tokens: number
|
||||
separator?: string
|
||||
}
|
||||
|
||||
export type JsonValue = unknown
|
||||
|
||||
export type DocumentMetadataOperation = {
|
||||
document_id: string
|
||||
metadata_list: Array<MetadataDetail>
|
||||
partial_update?: boolean
|
||||
}
|
||||
|
||||
export type MetadataDetail = {
|
||||
id: string
|
||||
name: string
|
||||
value?: unknown
|
||||
}
|
||||
|
||||
export type SegmentUpdateArgs = {
|
||||
answer?: string | null
|
||||
attachment_ids?: Array<string> | null
|
||||
content?: string | null
|
||||
enabled?: boolean | null
|
||||
keywords?: Array<string> | null
|
||||
regenerate_child_chunks?: boolean
|
||||
summary?: string | null
|
||||
}
|
||||
|
||||
export type SimpleAccount = {
|
||||
email: string
|
||||
id: string
|
||||
name: string
|
||||
}
|
||||
|
||||
export type SimpleEndUser = {
|
||||
id: string
|
||||
is_anonymous: boolean
|
||||
session_id?: string | null
|
||||
type: string
|
||||
}
|
||||
|
||||
export type WorkflowAppLogPartialResponse = {
|
||||
created_at?: number | null
|
||||
created_by_account?: SimpleAccount
|
||||
created_by_end_user?: SimpleEndUser
|
||||
created_by_role?: string | null
|
||||
created_from?: string | null
|
||||
details?: unknown
|
||||
id: string
|
||||
workflow_run?: WorkflowRunForLogResponse
|
||||
}
|
||||
|
||||
export type WorkflowRunForLogResponse = {
|
||||
created_at?: number | null
|
||||
elapsed_time?: unknown
|
||||
error?: string | null
|
||||
exceptions_count?: number | null
|
||||
finished_at?: number | null
|
||||
id: string
|
||||
status?: string | null
|
||||
total_steps?: number | null
|
||||
total_tokens?: number | null
|
||||
triggered_from?: string | null
|
||||
version?: string | null
|
||||
}
|
||||
|
||||
export type GetRootData = {
|
||||
body?: never
|
||||
path?: never
|
||||
@@ -857,7 +902,7 @@ export type GetConversationsData = {
|
||||
query?: {
|
||||
last_id?: string | null
|
||||
limit?: number
|
||||
sort_by?: 'created_at' | '-created_at' | 'updated_at' | '-updated_at'
|
||||
sort_by?: '-created_at' | '-updated_at' | 'created_at' | 'updated_at'
|
||||
}
|
||||
url: '/conversations'
|
||||
}
|
||||
@@ -1561,8 +1606,8 @@ export type PostDatasetsByDatasetIdDocumentsMetadataResponse
|
||||
export type PatchDatasetsByDatasetIdDocumentsStatusByActionData = {
|
||||
body?: never
|
||||
path: {
|
||||
dataset_id: string
|
||||
action: string
|
||||
dataset_id: string
|
||||
}
|
||||
query?: never
|
||||
url: '/datasets/{dataset_id}/documents/status/{action}'
|
||||
@@ -1598,8 +1643,8 @@ export type PatchDatasetsByDatasetIdDocumentsStatusByActionResponse
|
||||
export type GetDatasetsByDatasetIdDocumentsByBatchIndexingStatusData = {
|
||||
body?: never
|
||||
path: {
|
||||
dataset_id: string
|
||||
batch: string
|
||||
dataset_id: string
|
||||
}
|
||||
query?: never
|
||||
url: '/datasets/{dataset_id}/documents/{batch}/indexing-status'
|
||||
@@ -1862,9 +1907,9 @@ export type DeleteDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdRes
|
||||
export type GetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdData = {
|
||||
body?: never
|
||||
path: {
|
||||
segment_id: string
|
||||
document_id: string
|
||||
dataset_id: string
|
||||
document_id: string
|
||||
segment_id: string
|
||||
}
|
||||
query?: never
|
||||
url: '/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}'
|
||||
@@ -1995,10 +2040,10 @@ export type DeleteDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChi
|
||||
= {
|
||||
body?: never
|
||||
path: {
|
||||
child_chunk_id: string
|
||||
dataset_id: string
|
||||
document_id: string
|
||||
segment_id: string
|
||||
child_chunk_id: string
|
||||
}
|
||||
query?: never
|
||||
url: '/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}/child_chunks/{child_chunk_id}'
|
||||
@@ -2031,10 +2076,10 @@ export type PatchDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChil
|
||||
= {
|
||||
body: ChildChunkUpdatePayload
|
||||
path: {
|
||||
child_chunk_id: string
|
||||
dataset_id: string
|
||||
document_id: string
|
||||
segment_id: string
|
||||
child_chunk_id: string
|
||||
}
|
||||
query?: never
|
||||
url: '/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}/child_chunks/{child_chunk_id}'
|
||||
@@ -2307,8 +2352,8 @@ export type GetDatasetsByDatasetIdMetadataBuiltInResponse
|
||||
export type PostDatasetsByDatasetIdMetadataBuiltInByActionData = {
|
||||
body?: never
|
||||
path: {
|
||||
dataset_id: string
|
||||
action: string
|
||||
dataset_id: string
|
||||
}
|
||||
query?: never
|
||||
url: '/datasets/{dataset_id}/metadata/built-in/{action}'
|
||||
@@ -2937,9 +2982,9 @@ export type GetWorkflowByTaskIdEventsData = {
|
||||
task_id: string
|
||||
}
|
||||
query?: {
|
||||
user?: string
|
||||
include_state_snapshot?: string
|
||||
continue_on_pause?: string
|
||||
include_state_snapshot?: string
|
||||
user?: string
|
||||
}
|
||||
url: '/workflow/{task_id}/events'
|
||||
}
|
||||
@@ -2976,7 +3021,7 @@ export type GetWorkflowsLogsData = {
|
||||
keyword?: string | null
|
||||
limit?: number
|
||||
page?: number
|
||||
status?: 'succeeded' | 'failed' | 'stopped' | null
|
||||
status?: 'failed' | 'stopped' | 'succeeded' | null
|
||||
}
|
||||
url: '/workflows/logs'
|
||||
}
|
||||
|
||||
@@ -89,6 +89,36 @@ export const zCompletionRequestPayload = z.object({
|
||||
retriever_from: z.string().optional().default('dev'),
|
||||
})
|
||||
|
||||
/**
|
||||
* Condition
|
||||
*
|
||||
* Condition detail
|
||||
*/
|
||||
export const zCondition = z.object({
|
||||
comparison_operator: z.enum([
|
||||
'<',
|
||||
'=',
|
||||
'>',
|
||||
'after',
|
||||
'before',
|
||||
'contains',
|
||||
'empty',
|
||||
'end with',
|
||||
'in',
|
||||
'is',
|
||||
'is not',
|
||||
'not contains',
|
||||
'not empty',
|
||||
'not in',
|
||||
'start with',
|
||||
'≠',
|
||||
'≤',
|
||||
'≥',
|
||||
]),
|
||||
name: z.string(),
|
||||
value: z.unknown().optional(),
|
||||
})
|
||||
|
||||
/**
|
||||
* ConversationListQuery
|
||||
*/
|
||||
@@ -96,7 +126,7 @@ export const zConversationListQuery = z.object({
|
||||
last_id: z.string().nullish(),
|
||||
limit: z.int().gte(1).lte(100).optional().default(20),
|
||||
sort_by: z
|
||||
.enum(['created_at', '-created_at', 'updated_at', '-updated_at'])
|
||||
.enum(['-created_at', '-updated_at', 'created_at', 'updated_at'])
|
||||
.optional()
|
||||
.default('-updated_at'),
|
||||
})
|
||||
@@ -147,6 +177,42 @@ export const zConversationVariablesQuery = z.object({
|
||||
variable_name: z.string().min(1).max(255).nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* DataSetTag
|
||||
*/
|
||||
export const zDataSetTag = z.object({
|
||||
binding_count: z.string().nullish(),
|
||||
id: z.string(),
|
||||
name: z.string(),
|
||||
type: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* DatasetListQuery
|
||||
*/
|
||||
export const zDatasetListQuery = z.object({
|
||||
include_all: z.boolean().optional().default(false),
|
||||
keyword: z.string().nullish(),
|
||||
limit: z.int().optional().default(20),
|
||||
page: z.int().optional().default(1),
|
||||
tag_ids: z.array(z.string()).optional(),
|
||||
})
|
||||
|
||||
/**
|
||||
* DatasetPermissionEnum
|
||||
*/
|
||||
export const zDatasetPermissionEnum = z.enum(['all_team_members', 'only_me', 'partial_members'])
|
||||
|
||||
/**
|
||||
* DatasourceNodeRunPayload
|
||||
*/
|
||||
export const zDatasourceNodeRunPayload = z.object({
|
||||
credential_id: z.string().nullish(),
|
||||
datasource_type: z.string(),
|
||||
inputs: z.record(z.string(), z.unknown()),
|
||||
is_published: z.boolean(),
|
||||
})
|
||||
|
||||
/**
|
||||
* DocumentBatchDownloadZipPayload
|
||||
*
|
||||
@@ -156,6 +222,16 @@ export const zDocumentBatchDownloadZipPayload = z.object({
|
||||
document_ids: z.array(z.uuid()).min(1).max(100),
|
||||
})
|
||||
|
||||
/**
|
||||
* DocumentListQuery
|
||||
*/
|
||||
export const zDocumentListQuery = z.object({
|
||||
keyword: z.string().nullish(),
|
||||
limit: z.int().optional().default(20),
|
||||
page: z.int().optional().default(1),
|
||||
status: z.string().nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* FeedbackListQuery
|
||||
*/
|
||||
@@ -191,12 +267,22 @@ export const zFileResponse = z.object({
|
||||
user_id: z.string().nullish(),
|
||||
})
|
||||
|
||||
export const zJsonValue = z.unknown()
|
||||
|
||||
/**
|
||||
* HumanInputFormSubmitPayload
|
||||
*/
|
||||
export const zHumanInputFormSubmitPayload = z.object({
|
||||
action: z.string(),
|
||||
inputs: z.record(z.string(), zJsonValue),
|
||||
})
|
||||
|
||||
/**
|
||||
* MessageFeedbackPayload
|
||||
*/
|
||||
export const zMessageFeedbackPayload = z.object({
|
||||
content: z.string().nullish(),
|
||||
rating: z.enum(['like', 'dislike']).nullish(),
|
||||
rating: z.enum(['dislike', 'like']).nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
@@ -213,7 +299,44 @@ export const zMessageListQuery = z.object({
|
||||
*/
|
||||
export const zMetadataArgs = z.object({
|
||||
name: z.string(),
|
||||
type: z.enum(['string', 'number', 'time']),
|
||||
type: z.enum(['number', 'string', 'time']),
|
||||
})
|
||||
|
||||
/**
|
||||
* MetadataDetail
|
||||
*/
|
||||
export const zMetadataDetail = z.object({
|
||||
id: z.string(),
|
||||
name: z.string(),
|
||||
value: z.unknown().optional(),
|
||||
})
|
||||
|
||||
/**
|
||||
* DocumentMetadataOperation
|
||||
*/
|
||||
export const zDocumentMetadataOperation = z.object({
|
||||
document_id: z.string(),
|
||||
metadata_list: z.array(zMetadataDetail),
|
||||
partial_update: z.boolean().optional().default(false),
|
||||
})
|
||||
|
||||
/**
|
||||
* MetadataFilteringCondition
|
||||
*
|
||||
* Metadata Filtering Condition.
|
||||
*/
|
||||
export const zMetadataFilteringCondition = z.object({
|
||||
conditions: z.array(zCondition).nullish(),
|
||||
logical_operator: z.enum(['and', 'or']).nullish().default('and'),
|
||||
})
|
||||
|
||||
/**
|
||||
* MetadataOperationData
|
||||
*
|
||||
* Metadata operation data
|
||||
*/
|
||||
export const zMetadataOperationData = z.object({
|
||||
operation_data: z.array(zDocumentMetadataOperation),
|
||||
})
|
||||
|
||||
/**
|
||||
@@ -223,6 +346,44 @@ export const zMetadataUpdatePayload = z.object({
|
||||
name: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* PipelineRunApiEntity
|
||||
*/
|
||||
export const zPipelineRunApiEntity = z.object({
|
||||
datasource_info_list: z.array(z.record(z.string(), z.unknown())),
|
||||
datasource_type: z.string(),
|
||||
inputs: z.record(z.string(), z.unknown()),
|
||||
is_published: z.boolean(),
|
||||
response_mode: z.string(),
|
||||
start_node_id: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* PreProcessingRule
|
||||
*/
|
||||
export const zPreProcessingRule = z.object({
|
||||
enabled: z.boolean(),
|
||||
id: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* RerankingModel
|
||||
*/
|
||||
export const zRerankingModel = z.object({
|
||||
reranking_model_name: z.string().nullish(),
|
||||
reranking_provider_name: z.string().nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* RetrievalMethod
|
||||
*/
|
||||
export const zRetrievalMethod = z.enum([
|
||||
'full_text_search',
|
||||
'hybrid_search',
|
||||
'keyword_search',
|
||||
'semantic_search',
|
||||
])
|
||||
|
||||
/**
|
||||
* SegmentCreatePayload
|
||||
*/
|
||||
@@ -239,246 +400,23 @@ export const zSegmentListQuery = z.object({
|
||||
})
|
||||
|
||||
/**
|
||||
* TagBindingPayload
|
||||
* SegmentUpdateArgs
|
||||
*/
|
||||
export const zTagBindingPayload = z.object({
|
||||
tag_ids: z.array(z.string()),
|
||||
target_id: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* TagCreatePayload
|
||||
*/
|
||||
export const zTagCreatePayload = z.object({
|
||||
name: z.string().min(1).max(50),
|
||||
})
|
||||
|
||||
/**
|
||||
* TagDeletePayload
|
||||
*/
|
||||
export const zTagDeletePayload = z.object({
|
||||
tag_id: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* TagUnbindingPayload
|
||||
*/
|
||||
export const zTagUnbindingPayload = z.object({
|
||||
tag_id: z.string(),
|
||||
target_id: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* TagUpdatePayload
|
||||
*/
|
||||
export const zTagUpdatePayload = z.object({
|
||||
name: z.string().min(1).max(50),
|
||||
tag_id: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* TextToAudioPayload
|
||||
*/
|
||||
export const zTextToAudioPayload = z.object({
|
||||
message_id: z.string().nullish(),
|
||||
streaming: z.boolean().nullish(),
|
||||
text: z.string().nullish(),
|
||||
voice: z.string().nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* WorkflowLogQuery
|
||||
*/
|
||||
export const zWorkflowLogQuery = z.object({
|
||||
created_at__after: z.string().nullish(),
|
||||
created_at__before: z.string().nullish(),
|
||||
created_by_account: z.string().nullish(),
|
||||
created_by_end_user_session_id: z.string().nullish(),
|
||||
keyword: z.string().nullish(),
|
||||
limit: z.int().gte(1).lte(100).optional().default(20),
|
||||
page: z.int().gte(1).lte(99999).optional().default(1),
|
||||
status: z.enum(['succeeded', 'failed', 'stopped']).nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* WorkflowRunPayload
|
||||
*/
|
||||
export const zWorkflowRunPayload = z.object({
|
||||
files: z.array(z.record(z.string(), z.unknown())).nullish(),
|
||||
inputs: z.record(z.string(), z.unknown()),
|
||||
response_mode: z.enum(['blocking', 'streaming']).nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* WorkflowRunResponse
|
||||
*/
|
||||
export const zWorkflowRunResponse = z.object({
|
||||
created_at: z.int().nullish(),
|
||||
elapsed_time: z.unknown().optional(),
|
||||
error: z.string().nullish(),
|
||||
finished_at: z.int().nullish(),
|
||||
id: z.string(),
|
||||
inputs: z.unknown().optional(),
|
||||
outputs: z.record(z.string(), z.unknown()).optional(),
|
||||
status: z.string(),
|
||||
total_steps: z.int().nullish(),
|
||||
total_tokens: z.int().nullish(),
|
||||
workflow_id: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* Condition
|
||||
*
|
||||
* Condition detail
|
||||
*/
|
||||
export const zCondition = z.object({
|
||||
comparison_operator: z.enum([
|
||||
'contains',
|
||||
'not contains',
|
||||
'start with',
|
||||
'end with',
|
||||
'is',
|
||||
'is not',
|
||||
'empty',
|
||||
'not empty',
|
||||
'in',
|
||||
'not in',
|
||||
'=',
|
||||
'≠',
|
||||
'>',
|
||||
'<',
|
||||
'≥',
|
||||
'≤',
|
||||
'before',
|
||||
'after',
|
||||
]),
|
||||
name: z.string(),
|
||||
value: z.unknown().optional(),
|
||||
})
|
||||
|
||||
/**
|
||||
* DatasetPermissionEnum
|
||||
*/
|
||||
export const zDatasetPermissionEnum = z.enum(['only_me', 'all_team_members', 'partial_members'])
|
||||
|
||||
/**
|
||||
* MetadataFilteringCondition
|
||||
*
|
||||
* Metadata Filtering Condition.
|
||||
*/
|
||||
export const zMetadataFilteringCondition = z.object({
|
||||
conditions: z.array(zCondition).nullish(),
|
||||
logical_operator: z.enum(['and', 'or']).nullish().default('and'),
|
||||
})
|
||||
|
||||
/**
|
||||
* RerankingModel
|
||||
*/
|
||||
export const zRerankingModel = z.object({
|
||||
reranking_model_name: z.string().nullish(),
|
||||
reranking_provider_name: z.string().nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* RetrievalMethod
|
||||
*/
|
||||
export const zRetrievalMethod = z.enum([
|
||||
'semantic_search',
|
||||
'full_text_search',
|
||||
'hybrid_search',
|
||||
'keyword_search',
|
||||
])
|
||||
|
||||
/**
|
||||
* WeightKeywordSetting
|
||||
*/
|
||||
export const zWeightKeywordSetting = z.object({
|
||||
keyword_weight: z.number(),
|
||||
})
|
||||
|
||||
/**
|
||||
* WeightVectorSetting
|
||||
*/
|
||||
export const zWeightVectorSetting = z.object({
|
||||
embedding_model_name: z.string(),
|
||||
embedding_provider_name: z.string(),
|
||||
vector_weight: z.number(),
|
||||
})
|
||||
|
||||
/**
|
||||
* WeightModel
|
||||
*/
|
||||
export const zWeightModel = z.object({
|
||||
keyword_setting: zWeightKeywordSetting.optional(),
|
||||
vector_setting: zWeightVectorSetting.optional(),
|
||||
weight_type: z.enum(['semantic_first', 'keyword_first', 'customized']).nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* RetrievalModel
|
||||
*/
|
||||
export const zRetrievalModel = z.object({
|
||||
metadata_filtering_conditions: zMetadataFilteringCondition.optional(),
|
||||
reranking_enable: z.boolean(),
|
||||
reranking_mode: z.string().nullish(),
|
||||
reranking_model: zRerankingModel.optional(),
|
||||
score_threshold: z.number().nullish(),
|
||||
score_threshold_enabled: z.boolean(),
|
||||
search_method: zRetrievalMethod,
|
||||
top_k: z.int(),
|
||||
weights: zWeightModel.optional(),
|
||||
})
|
||||
|
||||
/**
|
||||
* DatasetCreatePayload
|
||||
*/
|
||||
export const zDatasetCreatePayload = z.object({
|
||||
description: z.string().max(400).optional().default(''),
|
||||
embedding_model: z.string().nullish(),
|
||||
embedding_model_provider: z.string().nullish(),
|
||||
external_knowledge_api_id: z.string().nullish(),
|
||||
external_knowledge_id: z.string().nullish(),
|
||||
indexing_technique: z.enum(['high_quality', 'economy']).nullish(),
|
||||
name: z.string().min(1).max(40),
|
||||
permission: zDatasetPermissionEnum.optional(),
|
||||
provider: z.string().optional().default('vendor'),
|
||||
retrieval_model: zRetrievalModel.optional(),
|
||||
summary_index_setting: z.record(z.string(), z.unknown()).nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* DatasetUpdatePayload
|
||||
*/
|
||||
export const zDatasetUpdatePayload = z.object({
|
||||
description: z.string().max(400).nullish(),
|
||||
embedding_model: z.string().nullish(),
|
||||
embedding_model_provider: z.string().nullish(),
|
||||
external_knowledge_api_id: z.string().nullish(),
|
||||
external_knowledge_id: z.string().nullish(),
|
||||
external_retrieval_model: z.record(z.string(), z.unknown()).nullish(),
|
||||
indexing_technique: z.enum(['high_quality', 'economy']).nullish(),
|
||||
name: z.string().min(1).max(40).nullish(),
|
||||
partial_member_list: z.array(z.record(z.string(), z.string())).nullish(),
|
||||
permission: zDatasetPermissionEnum.optional(),
|
||||
retrieval_model: zRetrievalModel.optional(),
|
||||
})
|
||||
|
||||
/**
|
||||
* HitTestingPayload
|
||||
*/
|
||||
export const zHitTestingPayload = z.object({
|
||||
export const zSegmentUpdateArgs = z.object({
|
||||
answer: z.string().nullish(),
|
||||
attachment_ids: z.array(z.string()).nullish(),
|
||||
external_retrieval_model: z.record(z.string(), z.unknown()).nullish(),
|
||||
query: z.string().max(250),
|
||||
retrieval_model: zRetrievalModel.optional(),
|
||||
content: z.string().nullish(),
|
||||
enabled: z.boolean().nullish(),
|
||||
keywords: z.array(z.string()).nullish(),
|
||||
regenerate_child_chunks: z.boolean().optional().default(false),
|
||||
summary: z.string().nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* PreProcessingRule
|
||||
* SegmentUpdatePayload
|
||||
*/
|
||||
export const zPreProcessingRule = z.object({
|
||||
enabled: z.boolean(),
|
||||
id: z.string(),
|
||||
export const zSegmentUpdatePayload = z.object({
|
||||
segment: zSegmentUpdateArgs,
|
||||
})
|
||||
|
||||
/**
|
||||
@@ -508,6 +446,150 @@ export const zProcessRule = z.object({
|
||||
rules: zRule.optional(),
|
||||
})
|
||||
|
||||
/**
|
||||
* SimpleAccount
|
||||
*/
|
||||
export const zSimpleAccount = z.object({
|
||||
email: z.string(),
|
||||
id: z.string(),
|
||||
name: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* SimpleEndUser
|
||||
*/
|
||||
export const zSimpleEndUser = z.object({
|
||||
id: z.string(),
|
||||
is_anonymous: z.boolean(),
|
||||
session_id: z.string().nullish(),
|
||||
type: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* TagBindingPayload
|
||||
*/
|
||||
export const zTagBindingPayload = z.object({
|
||||
tag_ids: z.array(z.string()),
|
||||
target_id: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* TagCreatePayload
|
||||
*/
|
||||
export const zTagCreatePayload = z.object({
|
||||
name: z.string().min(1).max(50),
|
||||
})
|
||||
|
||||
/**
|
||||
* TagDeletePayload
|
||||
*/
|
||||
export const zTagDeletePayload = z.object({
|
||||
tag_id: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* TagUnbindingPayload
|
||||
*
|
||||
* Accept the legacy single-tag Service API payload while exposing a normalized tag_ids list internally.
|
||||
*/
|
||||
export const zTagUnbindingPayload = z.object({
|
||||
tag_id: z.string().nullish(),
|
||||
tag_ids: z.array(z.string()).optional(),
|
||||
target_id: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* TagUpdatePayload
|
||||
*/
|
||||
export const zTagUpdatePayload = z.object({
|
||||
name: z.string().min(1).max(50),
|
||||
tag_id: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* TextToAudioPayload
|
||||
*/
|
||||
export const zTextToAudioPayload = z.object({
|
||||
message_id: z.string().nullish(),
|
||||
streaming: z.boolean().nullish(),
|
||||
text: z.string().nullish(),
|
||||
voice: z.string().nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* WeightKeywordSetting
|
||||
*/
|
||||
export const zWeightKeywordSetting = z.object({
|
||||
keyword_weight: z.number(),
|
||||
})
|
||||
|
||||
/**
|
||||
* WeightVectorSetting
|
||||
*/
|
||||
export const zWeightVectorSetting = z.object({
|
||||
embedding_model_name: z.string(),
|
||||
embedding_provider_name: z.string(),
|
||||
vector_weight: z.number(),
|
||||
})
|
||||
|
||||
/**
|
||||
* WeightModel
|
||||
*/
|
||||
export const zWeightModel = z.object({
|
||||
keyword_setting: zWeightKeywordSetting.optional(),
|
||||
vector_setting: zWeightVectorSetting.optional(),
|
||||
weight_type: z.enum(['customized', 'keyword_first', 'semantic_first']).nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* RetrievalModel
|
||||
*/
|
||||
export const zRetrievalModel = z.object({
|
||||
metadata_filtering_conditions: zMetadataFilteringCondition.optional(),
|
||||
reranking_enable: z.boolean(),
|
||||
reranking_mode: z.string().nullish(),
|
||||
reranking_model: zRerankingModel.optional(),
|
||||
score_threshold: z.number().nullish(),
|
||||
score_threshold_enabled: z.boolean(),
|
||||
search_method: zRetrievalMethod,
|
||||
top_k: z.int(),
|
||||
weights: zWeightModel.optional(),
|
||||
})
|
||||
|
||||
/**
|
||||
* DatasetCreatePayload
|
||||
*/
|
||||
export const zDatasetCreatePayload = z.object({
|
||||
description: z.string().max(400).optional().default(''),
|
||||
embedding_model: z.string().nullish(),
|
||||
embedding_model_provider: z.string().nullish(),
|
||||
external_knowledge_api_id: z.string().nullish(),
|
||||
external_knowledge_id: z.string().nullish(),
|
||||
indexing_technique: z.enum(['economy', 'high_quality']).nullish(),
|
||||
name: z.string().min(1).max(40),
|
||||
permission: zDatasetPermissionEnum.optional(),
|
||||
provider: z.string().optional().default('vendor'),
|
||||
retrieval_model: zRetrievalModel.optional(),
|
||||
summary_index_setting: z.record(z.string(), z.unknown()).nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* DatasetUpdatePayload
|
||||
*/
|
||||
export const zDatasetUpdatePayload = z.object({
|
||||
description: z.string().max(400).nullish(),
|
||||
embedding_model: z.string().nullish(),
|
||||
embedding_model_provider: z.string().nullish(),
|
||||
external_knowledge_api_id: z.string().nullish(),
|
||||
external_knowledge_id: z.string().nullish(),
|
||||
external_retrieval_model: z.record(z.string(), z.unknown()).nullish(),
|
||||
indexing_technique: z.enum(['economy', 'high_quality']).nullish(),
|
||||
name: z.string().min(1).max(40).nullish(),
|
||||
partial_member_list: z.array(z.record(z.string(), z.string())).nullish(),
|
||||
permission: zDatasetPermissionEnum.optional(),
|
||||
retrieval_model: zRetrievalModel.optional(),
|
||||
})
|
||||
|
||||
/**
|
||||
* DocumentTextCreatePayload
|
||||
*/
|
||||
@@ -536,80 +618,28 @@ export const zDocumentTextUpdate = z.object({
|
||||
text: z.string().nullish(),
|
||||
})
|
||||
|
||||
export const zJsonValue = z.unknown()
|
||||
|
||||
/**
|
||||
* HumanInputFormSubmitPayload
|
||||
* HitTestingPayload
|
||||
*/
|
||||
export const zHumanInputFormSubmitPayload = z.object({
|
||||
action: z.string(),
|
||||
inputs: z.record(z.string(), zJsonValue),
|
||||
})
|
||||
|
||||
/**
|
||||
* MetadataDetail
|
||||
*/
|
||||
export const zMetadataDetail = z.object({
|
||||
id: z.string(),
|
||||
name: z.string(),
|
||||
value: z.unknown().optional(),
|
||||
})
|
||||
|
||||
/**
|
||||
* DocumentMetadataOperation
|
||||
*/
|
||||
export const zDocumentMetadataOperation = z.object({
|
||||
document_id: z.string(),
|
||||
metadata_list: z.array(zMetadataDetail),
|
||||
partial_update: z.boolean().optional().default(false),
|
||||
})
|
||||
|
||||
/**
|
||||
* MetadataOperationData
|
||||
*
|
||||
* Metadata operation data
|
||||
*/
|
||||
export const zMetadataOperationData = z.object({
|
||||
operation_data: z.array(zDocumentMetadataOperation),
|
||||
})
|
||||
|
||||
/**
|
||||
* SegmentUpdateArgs
|
||||
*/
|
||||
export const zSegmentUpdateArgs = z.object({
|
||||
answer: z.string().nullish(),
|
||||
export const zHitTestingPayload = z.object({
|
||||
attachment_ids: z.array(z.string()).nullish(),
|
||||
content: z.string().nullish(),
|
||||
enabled: z.boolean().nullish(),
|
||||
keywords: z.array(z.string()).nullish(),
|
||||
regenerate_child_chunks: z.boolean().optional().default(false),
|
||||
summary: z.string().nullish(),
|
||||
external_retrieval_model: z.record(z.string(), z.unknown()).nullish(),
|
||||
query: z.string().max(250),
|
||||
retrieval_model: zRetrievalModel.optional(),
|
||||
})
|
||||
|
||||
/**
|
||||
* SegmentUpdatePayload
|
||||
* WorkflowLogQuery
|
||||
*/
|
||||
export const zSegmentUpdatePayload = z.object({
|
||||
segment: zSegmentUpdateArgs,
|
||||
})
|
||||
|
||||
/**
|
||||
* SimpleAccount
|
||||
*/
|
||||
export const zSimpleAccount = z.object({
|
||||
email: z.string(),
|
||||
id: z.string(),
|
||||
name: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* SimpleEndUser
|
||||
*/
|
||||
export const zSimpleEndUser = z.object({
|
||||
id: z.string(),
|
||||
is_anonymous: z.boolean(),
|
||||
session_id: z.string().nullish(),
|
||||
type: z.string(),
|
||||
export const zWorkflowLogQuery = z.object({
|
||||
created_at__after: z.string().nullish(),
|
||||
created_at__before: z.string().nullish(),
|
||||
created_by_account: z.string().nullish(),
|
||||
created_by_end_user_session_id: z.string().nullish(),
|
||||
keyword: z.string().nullish(),
|
||||
limit: z.int().gte(1).lte(100).optional().default(20),
|
||||
page: z.int().gte(1).lte(99999).optional().default(1),
|
||||
status: z.enum(['failed', 'stopped', 'succeeded']).nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
@@ -654,6 +684,32 @@ export const zWorkflowAppLogPaginationResponse = z.object({
|
||||
total: z.int(),
|
||||
})
|
||||
|
||||
/**
|
||||
* WorkflowRunPayload
|
||||
*/
|
||||
export const zWorkflowRunPayload = z.object({
|
||||
files: z.array(z.record(z.string(), z.unknown())).nullish(),
|
||||
inputs: z.record(z.string(), z.unknown()),
|
||||
response_mode: z.enum(['blocking', 'streaming']).nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* WorkflowRunResponse
|
||||
*/
|
||||
export const zWorkflowRunResponse = z.object({
|
||||
created_at: z.int().nullish(),
|
||||
elapsed_time: z.unknown().optional(),
|
||||
error: z.string().nullish(),
|
||||
finished_at: z.int().nullish(),
|
||||
id: z.string(),
|
||||
inputs: z.unknown().optional(),
|
||||
outputs: z.record(z.string(), z.unknown()).optional(),
|
||||
status: z.string(),
|
||||
total_steps: z.int().nullish(),
|
||||
total_tokens: z.int().nullish(),
|
||||
workflow_id: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
@@ -766,7 +822,7 @@ export const zGetConversationsQuery = z.object({
|
||||
last_id: z.string().nullish(),
|
||||
limit: z.int().gte(1).lte(100).optional().default(20),
|
||||
sort_by: z
|
||||
.enum(['created_at', '-created_at', 'updated_at', '-updated_at'])
|
||||
.enum(['-created_at', '-updated_at', 'created_at', 'updated_at'])
|
||||
.optional()
|
||||
.default('-updated_at'),
|
||||
})
|
||||
@@ -877,7 +933,7 @@ export const zPostDatasetsTagsBindingResponse = z.record(z.string(), z.unknown()
|
||||
export const zPostDatasetsTagsUnbindingBody = zTagUnbindingPayload
|
||||
|
||||
/**
|
||||
* Tag unbound successfully
|
||||
* Tags unbound successfully
|
||||
*/
|
||||
export const zPostDatasetsTagsUnbindingResponse = z.record(z.string(), z.unknown())
|
||||
|
||||
@@ -997,8 +1053,8 @@ export const zPostDatasetsByDatasetIdDocumentsMetadataPath = z.object({
|
||||
export const zPostDatasetsByDatasetIdDocumentsMetadataResponse = z.record(z.string(), z.unknown())
|
||||
|
||||
export const zPatchDatasetsByDatasetIdDocumentsStatusByActionPath = z.object({
|
||||
dataset_id: z.string(),
|
||||
action: z.string(),
|
||||
dataset_id: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
@@ -1010,8 +1066,8 @@ export const zPatchDatasetsByDatasetIdDocumentsStatusByActionResponse = z.record
|
||||
)
|
||||
|
||||
export const zGetDatasetsByDatasetIdDocumentsByBatchIndexingStatusPath = z.object({
|
||||
dataset_id: z.string(),
|
||||
batch: z.string(),
|
||||
dataset_id: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
@@ -1122,9 +1178,9 @@ export const zDeleteDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdR
|
||||
)
|
||||
|
||||
export const zGetDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdPath = z.object({
|
||||
segment_id: z.string(),
|
||||
document_id: z.string(),
|
||||
dataset_id: z.string(),
|
||||
document_id: z.string(),
|
||||
segment_id: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
@@ -1190,10 +1246,10 @@ export const zPostDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChi
|
||||
|
||||
export const zDeleteDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksByChildChunkIdPath
|
||||
= z.object({
|
||||
child_chunk_id: z.string(),
|
||||
dataset_id: z.string(),
|
||||
document_id: z.string(),
|
||||
segment_id: z.string(),
|
||||
child_chunk_id: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
@@ -1207,10 +1263,10 @@ export const zPatchDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdCh
|
||||
|
||||
export const zPatchDatasetsByDatasetIdDocumentsByDocumentIdSegmentsBySegmentIdChildChunksByChildChunkIdPath
|
||||
= z.object({
|
||||
child_chunk_id: z.string(),
|
||||
dataset_id: z.string(),
|
||||
document_id: z.string(),
|
||||
segment_id: z.string(),
|
||||
child_chunk_id: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
@@ -1316,8 +1372,8 @@ export const zGetDatasetsByDatasetIdMetadataBuiltInPath = z.object({
|
||||
export const zGetDatasetsByDatasetIdMetadataBuiltInResponse = z.record(z.string(), z.unknown())
|
||||
|
||||
export const zPostDatasetsByDatasetIdMetadataBuiltInByActionPath = z.object({
|
||||
dataset_id: z.string(),
|
||||
action: z.string(),
|
||||
dataset_id: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
@@ -1524,9 +1580,9 @@ export const zGetWorkflowByTaskIdEventsPath = z.object({
|
||||
})
|
||||
|
||||
export const zGetWorkflowByTaskIdEventsQuery = z.object({
|
||||
user: z.string().optional(),
|
||||
include_state_snapshot: z.string().optional(),
|
||||
continue_on_pause: z.string().optional(),
|
||||
include_state_snapshot: z.string().optional(),
|
||||
user: z.string().optional(),
|
||||
})
|
||||
|
||||
/**
|
||||
@@ -1542,7 +1598,7 @@ export const zGetWorkflowsLogsQuery = z.object({
|
||||
keyword: z.string().nullish(),
|
||||
limit: z.int().gte(1).lte(100).optional().default(20),
|
||||
page: z.int().gte(1).lte(99999).optional().default(1),
|
||||
status: z.enum(['succeeded', 'failed', 'stopped']).nullish(),
|
||||
status: z.enum(['failed', 'stopped', 'succeeded']).nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
|
||||
@@ -4,6 +4,11 @@ export type ClientOptions = {
|
||||
baseUrl: `${string}://${string}/api` | (string & {})
|
||||
}
|
||||
|
||||
export type AppAccessModeQuery = {
|
||||
appCode?: string | null
|
||||
appId?: string | null
|
||||
}
|
||||
|
||||
export type ChatMessagePayload = {
|
||||
conversation_id?: string | null
|
||||
files?: Array<{
|
||||
@@ -30,6 +35,18 @@ export type CompletionMessagePayload = {
|
||||
retriever_from?: string
|
||||
}
|
||||
|
||||
export type ConversationListQuery = {
|
||||
last_id?: string | null
|
||||
limit?: number
|
||||
pinned?: boolean | null
|
||||
sort_by?: '-created_at' | '-updated_at' | 'created_at' | 'updated_at'
|
||||
}
|
||||
|
||||
export type ConversationRenamePayload = {
|
||||
auto_generate?: boolean
|
||||
name?: string | null
|
||||
}
|
||||
|
||||
export type EmailCodeLoginSendPayload = {
|
||||
email: string
|
||||
language?: string | null
|
||||
@@ -91,6 +108,17 @@ export type LoginPayload = {
|
||||
password: string
|
||||
}
|
||||
|
||||
export type MessageFeedbackPayload = {
|
||||
content?: string | null
|
||||
rating?: 'dislike' | 'like' | null
|
||||
}
|
||||
|
||||
export type MessageListQuery = {
|
||||
conversation_id: string
|
||||
first_id?: string | null
|
||||
limit?: number
|
||||
}
|
||||
|
||||
export type MessageMoreLikeThisQuery = {
|
||||
response_mode: 'blocking' | 'streaming'
|
||||
}
|
||||
@@ -100,6 +128,19 @@ export type RemoteFileInfo = {
|
||||
file_type: string
|
||||
}
|
||||
|
||||
export type RemoteFileUploadPayload = {
|
||||
url: string
|
||||
}
|
||||
|
||||
export type SavedMessageCreatePayload = {
|
||||
message_id: string
|
||||
}
|
||||
|
||||
export type SavedMessageListQuery = {
|
||||
last_id?: string | null
|
||||
limit?: number
|
||||
}
|
||||
|
||||
export type TextToAudioPayload = {
|
||||
message_id?: string | null
|
||||
streaming?: boolean | null
|
||||
@@ -310,8 +351,8 @@ export type GetConversationsData = {
|
||||
query?: {
|
||||
last_id?: string
|
||||
limit?: number
|
||||
pinned?: 'true' | 'false'
|
||||
sort_by?: 'created_at' | '-created_at' | 'updated_at' | '-updated_at'
|
||||
pinned?: 'false' | 'true'
|
||||
sort_by?: '-created_at' | '-updated_at' | 'created_at' | 'updated_at'
|
||||
}
|
||||
url: '/conversations'
|
||||
}
|
||||
@@ -389,8 +430,8 @@ export type PostConversationsByCIdNameData = {
|
||||
c_id: string
|
||||
}
|
||||
query?: {
|
||||
name?: string
|
||||
auto_generate?: boolean
|
||||
name?: string
|
||||
}
|
||||
url: '/conversations/{c_id}/name'
|
||||
}
|
||||
@@ -828,8 +869,8 @@ export type PostMessagesByMessageIdFeedbacksData = {
|
||||
message_id: string
|
||||
}
|
||||
query?: {
|
||||
rating?: 'like' | 'dislike'
|
||||
content?: string
|
||||
rating?: 'dislike' | 'like'
|
||||
}
|
||||
url: '/messages/{message_id}/feedbacks'
|
||||
}
|
||||
@@ -1310,8 +1351,8 @@ export type GetWebappAccessModeData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: {
|
||||
appId?: string
|
||||
appCode?: string
|
||||
appId?: string
|
||||
}
|
||||
url: '/webapp/access-mode'
|
||||
}
|
||||
|
||||
@@ -2,6 +2,14 @@
|
||||
|
||||
import * as z from 'zod'
|
||||
|
||||
/**
|
||||
* AppAccessModeQuery
|
||||
*/
|
||||
export const zAppAccessModeQuery = z.object({
|
||||
appCode: z.string().nullish(),
|
||||
appId: z.string().nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* ChatMessagePayload
|
||||
*/
|
||||
@@ -26,6 +34,27 @@ export const zCompletionMessagePayload = z.object({
|
||||
retriever_from: z.string().optional().default('web_app'),
|
||||
})
|
||||
|
||||
/**
|
||||
* ConversationListQuery
|
||||
*/
|
||||
export const zConversationListQuery = z.object({
|
||||
last_id: z.string().nullish(),
|
||||
limit: z.int().gte(1).lte(100).optional().default(20),
|
||||
pinned: z.boolean().nullish(),
|
||||
sort_by: z
|
||||
.enum(['-created_at', '-updated_at', 'created_at', 'updated_at'])
|
||||
.optional()
|
||||
.default('-updated_at'),
|
||||
})
|
||||
|
||||
/**
|
||||
* ConversationRenamePayload
|
||||
*/
|
||||
export const zConversationRenamePayload = z.object({
|
||||
auto_generate: z.boolean().optional().default(false),
|
||||
name: z.string().nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* EmailCodeLoginSendPayload
|
||||
*/
|
||||
@@ -111,6 +140,23 @@ export const zLoginPayload = z.object({
|
||||
password: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* MessageFeedbackPayload
|
||||
*/
|
||||
export const zMessageFeedbackPayload = z.object({
|
||||
content: z.string().nullish(),
|
||||
rating: z.enum(['dislike', 'like']).nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* MessageListQuery
|
||||
*/
|
||||
export const zMessageListQuery = z.object({
|
||||
conversation_id: z.string(),
|
||||
first_id: z.string().nullish(),
|
||||
limit: z.int().gte(1).lte(100).optional().default(20),
|
||||
})
|
||||
|
||||
/**
|
||||
* MessageMoreLikeThisQuery
|
||||
*/
|
||||
@@ -126,6 +172,28 @@ export const zRemoteFileInfo = z.object({
|
||||
file_type: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* RemoteFileUploadPayload
|
||||
*/
|
||||
export const zRemoteFileUploadPayload = z.object({
|
||||
url: z.url().min(1).max(2083),
|
||||
})
|
||||
|
||||
/**
|
||||
* SavedMessageCreatePayload
|
||||
*/
|
||||
export const zSavedMessageCreatePayload = z.object({
|
||||
message_id: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* SavedMessageListQuery
|
||||
*/
|
||||
export const zSavedMessageListQuery = z.object({
|
||||
last_id: z.string().nullish(),
|
||||
limit: z.int().gte(1).lte(100).optional().default(20),
|
||||
})
|
||||
|
||||
/**
|
||||
* TextToAudioPayload
|
||||
*/
|
||||
@@ -184,9 +252,9 @@ export const zPostCompletionMessagesByTaskIdStopResponse = z.record(z.string(),
|
||||
export const zGetConversationsQuery = z.object({
|
||||
last_id: z.string().optional(),
|
||||
limit: z.int().optional().default(20),
|
||||
pinned: z.enum(['true', 'false']).optional(),
|
||||
pinned: z.enum(['false', 'true']).optional(),
|
||||
sort_by: z
|
||||
.enum(['created_at', '-created_at', 'updated_at', '-updated_at'])
|
||||
.enum(['-created_at', '-updated_at', 'created_at', 'updated_at'])
|
||||
.optional()
|
||||
.default('-updated_at'),
|
||||
})
|
||||
@@ -210,8 +278,8 @@ export const zPostConversationsByCIdNamePath = z.object({
|
||||
})
|
||||
|
||||
export const zPostConversationsByCIdNameQuery = z.object({
|
||||
name: z.string().optional(),
|
||||
auto_generate: z.boolean().optional().default(false),
|
||||
name: z.string().optional(),
|
||||
})
|
||||
|
||||
/**
|
||||
@@ -328,8 +396,8 @@ export const zPostMessagesByMessageIdFeedbacksPath = z.object({
|
||||
})
|
||||
|
||||
export const zPostMessagesByMessageIdFeedbacksQuery = z.object({
|
||||
rating: z.enum(['like', 'dislike']).optional(),
|
||||
content: z.string().optional(),
|
||||
rating: z.enum(['dislike', 'like']).optional(),
|
||||
})
|
||||
|
||||
/**
|
||||
@@ -434,8 +502,8 @@ export const zPostTextToAudioBody = zTextToAudioPayload
|
||||
export const zPostTextToAudioResponse = z.record(z.string(), z.unknown())
|
||||
|
||||
export const zGetWebappAccessModeQuery = z.object({
|
||||
appId: z.string().optional(),
|
||||
appCode: z.string().optional(),
|
||||
appId: z.string().optional(),
|
||||
})
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user