diff --git a/agents-api/agents_api/activities/demo.py b/agents-api/agents_api/activities/demo.py index 797ef6c90..f6d63f206 100644 --- a/agents-api/agents_api/activities/demo.py +++ b/agents-api/agents_api/activities/demo.py @@ -1,3 +1,5 @@ +from typing import Callable + from temporalio import activity from ..env import testing @@ -12,6 +14,6 @@ async def mock_demo_activity(a: int, b: int) -> int: return a + b -demo_activity = activity.defn(name="demo_activity")( +demo_activity: Callable[[int, int], int] = activity.defn(name="demo_activity")( demo_activity if not testing else mock_demo_activity ) diff --git a/agents-api/agents_api/activities/embed_docs.py b/agents-api/agents_api/activities/embed_docs.py index 1dd3793b0..3222ff9e7 100644 --- a/agents-api/agents_api/activities/embed_docs.py +++ b/agents-api/agents_api/activities/embed_docs.py @@ -1,8 +1,8 @@ from beartype import beartype from temporalio import activity +from ..clients import cozo from ..clients import embed as embedder -from ..clients.cozo import get_cozo_client from ..env import testing from ..models.docs.embed_snippets import embed_snippets as embed_snippets_query from .types import EmbedDocsPayload @@ -28,7 +28,7 @@ async def embed_docs(payload: EmbedDocsPayload, cozo_client=None) -> None: doc_id=payload.doc_id, snippet_indices=indices, embeddings=embeddings, - client=cozo_client or get_cozo_client(), + client=cozo_client or cozo.get_cozo_client(), ) diff --git a/agents-api/agents_api/activities/logger.py b/agents-api/agents_api/activities/logger.py index f3c31fece..ed18019dc 100644 --- a/agents-api/agents_api/activities/logger.py +++ b/agents-api/agents_api/activities/logger.py @@ -1,7 +1,8 @@ import logging +from typing import TextIO -logger = logging.getLogger(__name__) -h = logging.StreamHandler() -fmt = logging.Formatter("[%(asctime)s/%(levelname)s] - %(message)s") +logger: logging.Logger = logging.getLogger(__name__) +h: logging.StreamHandler[TextIO] = logging.StreamHandler() +fmt: logging.Formatter = logging.Formatter("[%(asctime)s/%(levelname)s] - %(message)s") h.setFormatter(fmt) logger.addHandler(h) diff --git a/agents-api/agents_api/activities/summarization.py b/agents-api/agents_api/activities/summarization.py index 90a89fde5..a02237bf7 100644 --- a/agents-api/agents_api/activities/summarization.py +++ b/agents-api/agents_api/activities/summarization.py @@ -12,11 +12,11 @@ # TODO: remove stubs -def entries_summarization_query(*args, **kwargs): +def entries_summarization_query(*args, **kwargs) -> pd.DataFrame: return pd.DataFrame() -def get_toplevel_entries_query(*args, **kwargs): +def get_toplevel_entries_query(*args, **kwargs) -> pd.DataFrame: return pd.DataFrame() diff --git a/agents-api/agents_api/activities/task_steps/__init__.py b/agents-api/agents_api/activities/task_steps/__init__.py index 828fe5e31..e1792f051 100644 --- a/agents-api/agents_api/activities/task_steps/__init__.py +++ b/agents-api/agents_api/activities/task_steps/__init__.py @@ -2,8 +2,12 @@ from .evaluate_step import evaluate_step from .if_else_step import if_else_step +from .log_step import log_step from .prompt_step import prompt_step from .raise_complete_async import raise_complete_async +from .return_step import return_step +from .switch_step import switch_step from .tool_call_step import tool_call_step from .transition_step import transition_step +from .wait_for_input_step import wait_for_input_step from .yield_step import yield_step diff --git a/agents-api/agents_api/activities/task_steps/evaluate_step.py b/agents-api/agents_api/activities/task_steps/evaluate_step.py index 14f4f3f12..d15dde869 100644 --- a/agents-api/agents_api/activities/task_steps/evaluate_step.py +++ b/agents-api/agents_api/activities/task_steps/evaluate_step.py @@ -1,25 +1,30 @@ -from typing import Any +import logging from beartype import beartype from temporalio import activity from ...activities.task_steps.utils import simple_eval_dict from ...autogen.openapi_model import EvaluateStep -from ...common.protocol.tasks import ( - StepContext, - StepOutcome, -) +from ...common.protocol.tasks import StepContext, StepOutcome from ...env import testing @beartype -async def evaluate_step( - context: StepContext[EvaluateStep], -) -> StepOutcome[dict[str, Any]]: - exprs = context.definition.arguments - output = simple_eval_dict(exprs, values=context.model_dump()) +async def evaluate_step(context: StepContext) -> StepOutcome: + # NOTE: This activity is only for returning immediately, so we just evaluate the expression + # Hence, it's a local activity and SHOULD NOT fail + try: + assert isinstance(context.current_step, EvaluateStep) + + exprs = context.current_step.evaluate + output = simple_eval_dict(exprs, values=context.model_dump()) + + result = StepOutcome(output=output) + return result - return StepOutcome(output=output) + except BaseException as e: + logging.error(f"Error in evaluate_step: {e}") + return StepOutcome(error=str(e)) # Note: This is here just for clarity. We could have just imported evaluate_step directly diff --git a/agents-api/agents_api/activities/task_steps/if_else_step.py b/agents-api/agents_api/activities/task_steps/if_else_step.py index 363af2ffe..7959039cc 100644 --- a/agents-api/agents_api/activities/task_steps/if_else_step.py +++ b/agents-api/agents_api/activities/task_steps/if_else_step.py @@ -1,24 +1,40 @@ +import logging + from beartype import beartype +from simpleeval import simple_eval from temporalio import activity -from ...autogen.openapi_model import ( - IfElseWorkflowStep, -) +from ...autogen.openapi_model import IfElseWorkflowStep from ...common.protocol.tasks import ( StepContext, + StepOutcome, ) +from ...env import testing -@activity.defn @beartype -async def if_else_step(context: StepContext[IfElseWorkflowStep]) -> dict: - raise NotImplementedError() - # context_data: dict = context.model_dump() +async def if_else_step(context: StepContext) -> StepOutcome: + # NOTE: This activity is only for logging, so we just evaluate the expression + # Hence, it's a local activity and SHOULD NOT fail + try: + assert isinstance(context.current_step, IfElseWorkflowStep) + + expr: str = context.current_step.if_ + output = simple_eval(expr, names=context.model_dump()) + output: bool = bool(output) + + result = StepOutcome(output=output) + return result - # next_workflow = ( - # context.definition.then - # if simple_eval(context.definition.if_, names=context_data) - # else context.definition.else_ - # ) + except BaseException as e: + logging.error(f"Error in if_else_step: {e}") + return StepOutcome(error=str(e)) - # return {"goto_workflow": next_workflow} + +# Note: This is here just for clarity. We could have just imported if_else_step directly +# They do the same thing, so we dont need to mock the if_else_step function +mock_if_else_step = if_else_step + +if_else_step = activity.defn(name="if_else_step")( + if_else_step if not testing else mock_if_else_step +) diff --git a/agents-api/agents_api/activities/task_steps/log_step.py b/agents-api/agents_api/activities/task_steps/log_step.py new file mode 100644 index 000000000..458dabdf3 --- /dev/null +++ b/agents-api/agents_api/activities/task_steps/log_step.py @@ -0,0 +1,37 @@ +import logging + +from beartype import beartype +from simpleeval import simple_eval +from temporalio import activity + +from ...autogen.openapi_model import LogStep +from ...common.protocol.tasks import ( + StepContext, + StepOutcome, +) +from ...env import testing + + +@beartype +async def log_step(context: StepContext) -> StepOutcome: + # NOTE: This activity is only for logging, so we just evaluate the expression + # Hence, it's a local activity and SHOULD NOT fail + try: + assert isinstance(context.current_step, LogStep) + + expr: str = context.current_step.log + output = simple_eval(expr, names=context.model_dump()) + + result = StepOutcome(output=output) + return result + + except BaseException as e: + logging.error(f"Error in log_step: {e}") + return StepOutcome(error=str(e)) + + +# Note: This is here just for clarity. We could have just imported log_step directly +# They do the same thing, so we dont need to mock the log_step function +mock_log_step = log_step + +log_step = activity.defn(name="log_step")(log_step if not testing else mock_log_step) diff --git a/agents-api/agents_api/activities/task_steps/prompt_step.py b/agents-api/agents_api/activities/task_steps/prompt_step.py index 90ab975d3..cb0088550 100644 --- a/agents-api/agents_api/activities/task_steps/prompt_step.py +++ b/agents-api/agents_api/activities/task_steps/prompt_step.py @@ -3,31 +3,25 @@ from beartype import beartype from temporalio import activity -from ...autogen.openapi_model import ( - InputChatMLMessage, - PromptStep, -) +from ...autogen.openapi_model import InputChatMLMessage from ...clients import ( litellm, # We dont directly import `acompletion` so we can mock it ) -from ...common.protocol.tasks import ( - StepContext, - StepOutcome, -) +from ...common.protocol.tasks import StepContext, StepOutcome from ...common.utils.template import render_template @activity.defn @beartype -async def prompt_step(context: StepContext[PromptStep]) -> StepOutcome: +async def prompt_step(context: StepContext) -> StepOutcome: # Get context data context_data: dict = context.model_dump() # Render template messages prompt = ( - [InputChatMLMessage(content=context.definition.prompt)] - if isinstance(context.definition.prompt, str) - else context.definition.prompt + [InputChatMLMessage(content=context.current_step.prompt)] + if isinstance(context.current_step.prompt, str) + else context.current_step.prompt ) template_messages: list[InputChatMLMessage] = prompt @@ -47,7 +41,7 @@ async def prompt_step(context: StepContext[PromptStep]) -> StepOutcome: for m in messages ] - settings: dict = context.definition.settings.model_dump() + settings: dict = context.current_step.settings.model_dump() # Get settings and run llm response = await litellm.acompletion( messages=messages, diff --git a/agents-api/agents_api/activities/task_steps/return_step.py b/agents-api/agents_api/activities/task_steps/return_step.py new file mode 100644 index 000000000..90bc8adf8 --- /dev/null +++ b/agents-api/agents_api/activities/task_steps/return_step.py @@ -0,0 +1,37 @@ +import logging + +from temporalio import activity + +from ...activities.task_steps.utils import simple_eval_dict +from ...autogen.openapi_model import ReturnStep +from ...common.protocol.tasks import ( + StepContext, + StepOutcome, +) +from ...env import testing + + +async def return_step(context: StepContext) -> StepOutcome: + # NOTE: This activity is only for returning immediately, so we just evaluate the expression + # Hence, it's a local activity and SHOULD NOT fail + try: + assert isinstance(context.current_step, ReturnStep) + + exprs: dict[str, str] = context.current_step.return_ + output = simple_eval_dict(exprs, values=context.model_dump()) + + result = StepOutcome(output=output) + return result + + except BaseException as e: + logging.error(f"Error in log_step: {e}") + return StepOutcome(error=str(e)) + + +# Note: This is here just for clarity. We could have just imported return_step directly +# They do the same thing, so we dont need to mock the return_step function +mock_return_step = return_step + +return_step = activity.defn(name="return_step")( + return_step if not testing else mock_return_step +) diff --git a/agents-api/agents_api/activities/task_steps/switch_step.py b/agents-api/agents_api/activities/task_steps/switch_step.py new file mode 100644 index 000000000..60e64033e --- /dev/null +++ b/agents-api/agents_api/activities/task_steps/switch_step.py @@ -0,0 +1,48 @@ +import logging + +from beartype import beartype +from simpleeval import simple_eval +from temporalio import activity + +from ...autogen.openapi_model import SwitchStep +from ...common.protocol.tasks import ( + StepContext, + StepOutcome, +) +from ...env import testing + + +@beartype +async def switch_step(context: StepContext) -> StepOutcome: + # NOTE: This activity is only for logging, so we just evaluate the expression + # Hence, it's a local activity and SHOULD NOT fail + try: + assert isinstance(context.current_step, SwitchStep) + + # Assume that none of the cases evaluate to truthy + output: int = -1 + + cases: list[str] = [c.case for c in context.current_step.switch] + + for i, case in enumerate(cases): + result = simple_eval(case, names=context.model_dump()) + + if result: + output = i + break + + result = StepOutcome(output=output) + return result + + except BaseException as e: + logging.error(f"Error in switch_step: {e}") + return StepOutcome(error=str(e)) + + +# Note: This is here just for clarity. We could have just imported switch_step directly +# They do the same thing, so we dont need to mock the switch_step function +mock_switch_step = switch_step + +switch_step = activity.defn(name="switch_step")( + switch_step if not testing else mock_switch_step +) diff --git a/agents-api/agents_api/activities/task_steps/tool_call_step.py b/agents-api/agents_api/activities/task_steps/tool_call_step.py index 05bbe946b..85a119deb 100644 --- a/agents-api/agents_api/activities/task_steps/tool_call_step.py +++ b/agents-api/agents_api/activities/task_steps/tool_call_step.py @@ -10,10 +10,10 @@ @beartype async def tool_call_step(context: StepContext) -> dict: raise NotImplementedError() - # assert isinstance(context.definition, ToolCallStep) + # assert isinstance(context.current_step, ToolCallStep) - # context.definition.tool_id - # context.definition.arguments + # context.current_step.tool_id + # context.current_step.arguments # # get tool by id # # call tool diff --git a/agents-api/agents_api/activities/task_steps/wait_for_input_step.py b/agents-api/agents_api/activities/task_steps/wait_for_input_step.py new file mode 100644 index 000000000..4d4378095 --- /dev/null +++ b/agents-api/agents_api/activities/task_steps/wait_for_input_step.py @@ -0,0 +1,25 @@ +from temporalio import activity + +from ...activities.task_steps.utils import simple_eval_dict +from ...autogen.openapi_model import WaitForInputStep +from ...common.protocol.tasks import StepContext, StepOutcome +from ...env import testing + + +async def wait_for_input_step(context: StepContext) -> StepOutcome: + assert isinstance(context.current_step, WaitForInputStep) + + exprs = context.current_step.wait_for_input + output = simple_eval_dict(exprs, values=context.model_dump()) + + result = StepOutcome(output=output) + return result + + +# Note: This is here just for clarity. We could have just imported wait_for_input_step directly +# They do the same thing, so we dont need to mock the wait_for_input_step function +mock_wait_for_input_step = wait_for_input_step + +wait_for_input_step = activity.defn(name="wait_for_input_step")( + wait_for_input_step if not testing else mock_wait_for_input_step +) diff --git a/agents-api/agents_api/activities/task_steps/yield_step.py b/agents-api/agents_api/activities/task_steps/yield_step.py index b339b83d1..d514df8f9 100644 --- a/agents-api/agents_api/activities/task_steps/yield_step.py +++ b/agents-api/agents_api/activities/task_steps/yield_step.py @@ -1,42 +1,51 @@ -from typing import Any +import logging +from typing import Callable from beartype import beartype from temporalio import activity -from agents_api.autogen.Executions import TransitionTarget +from agents_api.autogen.openapi_model import TransitionTarget, YieldStep -from ...autogen.openapi_model import YieldStep from ...common.protocol.tasks import StepContext, StepOutcome from ...env import testing from .utils import simple_eval_dict @beartype -async def yield_step(context: StepContext[YieldStep]) -> StepOutcome[dict[str, Any]]: - all_workflows = context.execution_input.task.workflows - workflow = context.current_step.workflow +async def yield_step(context: StepContext) -> StepOutcome: + # NOTE: This activity is only for returning immediately, so we just evaluate the expression + # Hence, it's a local activity and SHOULD NOT fail + try: + assert isinstance(context.current_step, YieldStep) - assert workflow in [ - wf.name for wf in all_workflows - ], f"Workflow {workflow} not found in task" + all_workflows = context.execution_input.task.workflows + workflow = context.current_step.workflow - # Evaluate the expressions in the arguments - exprs = context.current_step.arguments - arguments = simple_eval_dict(exprs, values=context.model_dump()) + assert workflow in [ + wf.name for wf in all_workflows + ], f"Workflow {workflow} not found in task" - # Transition to the first step of that workflow - transition_target = TransitionTarget( - workflow=workflow, - step=0, - ) + # Evaluate the expressions in the arguments + exprs = context.current_step.arguments + arguments = simple_eval_dict(exprs, values=context.model_dump()) - return StepOutcome(output=arguments, transition_to=("step", transition_target)) + # Transition to the first step of that workflow + transition_target = TransitionTarget( + workflow=workflow, + step=0, + ) + + return StepOutcome(output=arguments, transition_to=("step", transition_target)) + + except BaseException as e: + logging.error(f"Error in log_step: {e}") + return StepOutcome(error=str(e)) # Note: This is here just for clarity. We could have just imported yield_step directly # They do the same thing, so we dont need to mock the yield_step function -mock_yield_step = yield_step +mock_yield_step: Callable[[StepContext], StepOutcome] = yield_step -yield_step = activity.defn(name="yield_step")( +yield_step: Callable[[StepContext], StepOutcome] = activity.defn(name="yield_step")( yield_step if not testing else mock_yield_step ) diff --git a/agents-api/agents_api/autogen/Executions.py b/agents-api/agents_api/autogen/Executions.py index fbafb54f1..4ff4c4b66 100644 --- a/agents-api/agents_api/autogen/Executions.py +++ b/agents-api/agents_api/autogen/Executions.py @@ -104,9 +104,16 @@ class TransitionTarget(BaseModel): model_config = ConfigDict( populate_by_name=True, ) - workflow: Annotated[str, Field(pattern="^[^\\W0-9]\\w*$")] + workflow: Annotated[ + str, + Field( + pattern="^[\\p{L}\\p{Nl}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]+[\\p{ID_Start}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]*$" + ), + ] """ - Valid python identifier names + For Unicode character safety + See: https://unicode.org/reports/tr31/ + See: https://www.unicode.org/reports/tr39/#Identifier_Characters """ step: int diff --git a/agents-api/agents_api/autogen/Tasks.py b/agents-api/agents_api/autogen/Tasks.py index add03d675..01a2cd602 100644 --- a/agents-api/agents_api/autogen/Tasks.py +++ b/agents-api/agents_api/autogen/Tasks.py @@ -9,6 +9,12 @@ from pydantic import AwareDatetime, BaseModel, ConfigDict, Field from .Chat import ChatSettings +from .Docs import ( + EmbedQueryRequest, + HybridDocSearchRequest, + TextOnlyDocSearchRequest, + VectorDocSearchRequest, +) from .Entries import InputChatMLMessage from .Tools import CreateToolRequest @@ -18,13 +24,58 @@ class BaseWorkflowStep(BaseModel): populate_by_name=True, ) kind_: Literal[ - "tool_call", "yield", "prompt", "evaluate", "if_else", "wait_for_input", "error" + "tool_call", + "prompt", + "evaluate", + "wait_for_input", + "log", + "embed", + "search", + "set", + "get", + "foreach", + "map_reduce", + "parallel", + "switch", + "if_else", + "sleep", + "return", + "yield", + "error", ] """ The kind of step """ +class CaseThen(BaseModel): + model_config = ConfigDict( + populate_by_name=True, + ) + case: str + """ + The condition to evaluate + """ + then: ( + Any + | ToolCallStep + | YieldStep + | PromptStep + | ErrorWorkflowStep + | SleepStep + | ReturnStep + | GetStep + | SetStep + | LogStep + | EmbedStep + | SearchStep + | WaitForInputStep + ) + """ + The steps to run if the condition is true + """ + + class CreateTaskRequest(BaseModel): """ Payload for creating a task @@ -41,8 +92,19 @@ class CreateTaskRequest(BaseModel): | YieldStep | PromptStep | ErrorWorkflowStep + | SleepStep + | ReturnStep + | GetStep + | SetStep + | LogStep + | EmbedStep + | SearchStep | WaitForInputStep | IfElseWorkflowStep + | SwitchStep + | ForeachStep + | ParallelStep + | MapReduceStep ] """ The entrypoint of the task. @@ -62,6 +124,17 @@ class CreateTaskRequest(BaseModel): metadata: dict[str, Any] | None = None +class EmbedStep(BaseWorkflowStep): + model_config = ConfigDict( + populate_by_name=True, + ) + kind_: Literal["embed"] = "embed" + embed: EmbedQueryRequest + """ + The text to embed + """ + + class ErrorWorkflowStep(BaseWorkflowStep): model_config = ConfigDict( populate_by_name=True, @@ -84,6 +157,56 @@ class EvaluateStep(BaseWorkflowStep): """ +class ForeachDo(BaseModel): + model_config = ConfigDict( + populate_by_name=True, + ) + in_: Annotated[str, Field(alias="in")] + """ + The variable to iterate over + """ + do: list[ + Any + | ToolCallStep + | YieldStep + | PromptStep + | ErrorWorkflowStep + | SleepStep + | ReturnStep + | GetStep + | SetStep + | LogStep + | EmbedStep + | SearchStep + | WaitForInputStep + ] + """ + The steps to run for each iteration + """ + + +class ForeachStep(BaseWorkflowStep): + model_config = ConfigDict( + populate_by_name=True, + ) + kind_: Literal["foreach"] = "foreach" + foreach: ForeachDo + """ + The steps to run for each iteration + """ + + +class GetStep(BaseWorkflowStep): + model_config = ConfigDict( + populate_by_name=True, + ) + kind_: Literal["get"] = "get" + get: str + """ + The key to get + """ + + class IfElseWorkflowStep(BaseWorkflowStep): model_config = ConfigDict( populate_by_name=True, @@ -99,6 +222,13 @@ class IfElseWorkflowStep(BaseWorkflowStep): | YieldStep | PromptStep | ErrorWorkflowStep + | SleepStep + | ReturnStep + | GetStep + | SetStep + | LogStep + | EmbedStep + | SearchStep | WaitForInputStep ) """ @@ -110,6 +240,13 @@ class IfElseWorkflowStep(BaseWorkflowStep): | YieldStep | PromptStep | ErrorWorkflowStep + | SleepStep + | ReturnStep + | GetStep + | SetStep + | LogStep + | EmbedStep + | SearchStep | WaitForInputStep, Field(alias="else"), ] @@ -118,6 +255,71 @@ class IfElseWorkflowStep(BaseWorkflowStep): """ +class LogStep(BaseWorkflowStep): + model_config = ConfigDict( + populate_by_name=True, + ) + kind_: Literal["log"] = "log" + log: str + """ + The value to log + """ + + +class MapOver(BaseModel): + model_config = ConfigDict( + populate_by_name=True, + ) + over: str + """ + The variable to iterate over + """ + workflow: str + """ + The subworkflow to run for each iteration + """ + + +class MapReduceStep(BaseWorkflowStep): + model_config = ConfigDict( + populate_by_name=True, + ) + kind_: Literal["map_reduce"] = "map_reduce" + map: MapOver + """ + The steps to run for each iteration + """ + reduce: str + """ + The expression to reduce the results (`_` is a list of outputs) + """ + + +class ParallelStep(BaseWorkflowStep): + model_config = ConfigDict( + populate_by_name=True, + ) + kind_: Literal["parallel"] = "parallel" + parallel: list[ + Any + | ToolCallStep + | YieldStep + | PromptStep + | ErrorWorkflowStep + | SleepStep + | ReturnStep + | GetStep + | SetStep + | LogStep + | EmbedStep + | SearchStep + | WaitForInputStep + ] + """ + The steps to run in parallel. Max concurrency will depend on the platform + """ + + class PatchTaskRequest(BaseModel): """ Payload for patching a task @@ -134,8 +336,19 @@ class PatchTaskRequest(BaseModel): | YieldStep | PromptStep | ErrorWorkflowStep + | SleepStep + | ReturnStep + | GetStep + | SetStep + | LogStep + | EmbedStep + | SearchStep | WaitForInputStep | IfElseWorkflowStep + | SwitchStep + | ForeachStep + | ParallelStep + | MapReduceStep ] | None ) = None @@ -172,6 +385,97 @@ class PromptStep(BaseWorkflowStep): """ +class ReturnStep(BaseWorkflowStep): + model_config = ConfigDict( + populate_by_name=True, + ) + kind_: Literal["return"] = "return" + return_: Annotated[dict[str, str], Field(alias="return")] + """ + The value to return + """ + + +class SearchStep(BaseWorkflowStep): + model_config = ConfigDict( + populate_by_name=True, + ) + kind_: Literal["search"] = "search" + search: VectorDocSearchRequest | TextOnlyDocSearchRequest | HybridDocSearchRequest + """ + The search query + """ + + +class SetKey(BaseModel): + model_config = ConfigDict( + populate_by_name=True, + ) + key: str + """ + The key to set + """ + value: str + """ + The value to set + """ + + +class SetStep(BaseWorkflowStep): + model_config = ConfigDict( + populate_by_name=True, + ) + kind_: Literal["set"] = "set" + set: SetKey | list[SetKey] + """ + The value to set + """ + + +class SleepFor(BaseModel): + model_config = ConfigDict( + populate_by_name=True, + ) + seconds: Annotated[int, Field(0, ge=0)] + """ + The number of seconds to sleep for + """ + minutes: Annotated[int, Field(0, ge=0)] + """ + The number of minutes to sleep for + """ + hours: Annotated[int, Field(0, ge=0)] + """ + The number of hours to sleep for + """ + days: Annotated[int, Field(0, ge=0)] + """ + The number of days to sleep for + """ + + +class SleepStep(BaseWorkflowStep): + model_config = ConfigDict( + populate_by_name=True, + ) + kind_: Literal["sleep"] = "sleep" + sleep: SleepFor + """ + The duration to sleep for + """ + + +class SwitchStep(BaseWorkflowStep): + model_config = ConfigDict( + populate_by_name=True, + ) + kind_: Literal["switch"] = "switch" + switch: list[CaseThen] + """ + The cond tree + """ + + class Task(BaseModel): """ Object describing a Task @@ -188,8 +492,19 @@ class Task(BaseModel): | YieldStep | PromptStep | ErrorWorkflowStep + | SleepStep + | ReturnStep + | GetStep + | SetStep + | LogStep + | EmbedStep + | SearchStep | WaitForInputStep | IfElseWorkflowStep + | SwitchStep + | ForeachStep + | ParallelStep + | MapReduceStep ] """ The entrypoint of the task. @@ -260,8 +575,19 @@ class UpdateTaskRequest(BaseModel): | YieldStep | PromptStep | ErrorWorkflowStep + | SleepStep + | ReturnStep + | GetStep + | SetStep + | LogStep + | EmbedStep + | SearchStep | WaitForInputStep | IfElseWorkflowStep + | SwitchStep + | ForeachStep + | ParallelStep + | MapReduceStep ] """ The entrypoint of the task. @@ -286,7 +612,7 @@ class WaitForInputStep(BaseWorkflowStep): populate_by_name=True, ) kind_: Literal["wait_for_input"] = "wait_for_input" - info: str | dict[str, Any] + wait_for_input: dict[str, str] """ Any additional info or data """ diff --git a/agents-api/agents_api/autogen/openapi_model.py b/agents-api/agents_api/autogen/openapi_model.py index fdaadd30a..0b0b0e2b5 100644 --- a/agents-api/agents_api/autogen/openapi_model.py +++ b/agents-api/agents_api/autogen/openapi_model.py @@ -1,11 +1,10 @@ # ruff: noqa: F401, F403, F405 -from typing import Annotated, Generic, Literal, Self, Type, TypeVar +from typing import Annotated, Any, Generic, Literal, Self, Type, TypeVar from uuid import UUID from litellm.utils import _select_tokenizer as select_tokenizer from litellm.utils import token_counter from pydantic import AwareDatetime, Field -from pydantic_partial import create_partial_model from ..common.utils.datetime import utcnow from .Agents import * @@ -97,17 +96,15 @@ class ListResponse(BaseModel, Generic[DataT]): # Create models # ------------- -CreateTransitionRequest = create_partial_model( - Transition, - # - # The following fields are optional - "id", - "execution_id", - "created_at", - "updated_at", - "metadata", -) -CreateTransitionRequest.model_rebuild() + +class CreateTransitionRequest(Transition): + # The following fields are optional in this + + id: UUID | None = None + execution_id: UUID | None = None + created_at: AwareDatetime | None = None + updated_at: AwareDatetime | None = None + metadata: dict[str, Any] | None = None class CreateEntryRequest(BaseEntry): @@ -152,6 +149,18 @@ def from_model_input( | ToolCallStep | ErrorWorkflowStep | IfElseWorkflowStep + | ReturnStep + | SleepStep + | WaitForInputStep + | LogStep + | EmbedStep + | SearchStep + | SetStep + | GetStep + | ForeachStep + | MapReduceStep + | ParallelStep + | SwitchStep ) diff --git a/agents-api/agents_api/clients/cozo.py b/agents-api/agents_api/clients/cozo.py index d582e5db4..e2991c9d8 100644 --- a/agents-api/agents_api/clients/cozo.py +++ b/agents-api/agents_api/clients/cozo.py @@ -1,14 +1,16 @@ +from typing import Any, Dict + from pycozo.client import Client from ..env import cozo_auth, cozo_host from ..web import app -options = {"host": cozo_host} +options: Dict[str, str] = {"host": cozo_host} if cozo_auth: options.update({"auth": cozo_auth}) -def get_cozo_client(): +def get_cozo_client() -> Any: client = getattr(app.state, "cozo_client", Client("http", options=options)) if not hasattr(app.state, "cozo_client"): app.state.cozo_client = client diff --git a/agents-api/agents_api/clients/litellm.py b/agents-api/agents_api/clients/litellm.py index 5c3a2e28e..4c78e2876 100644 --- a/agents-api/agents_api/clients/litellm.py +++ b/agents-api/agents_api/clients/litellm.py @@ -1,11 +1,14 @@ from functools import wraps +from typing import List, TypeVar from litellm import acompletion as _acompletion from litellm.utils import CustomStreamWrapper, ModelResponse from ..env import litellm_master_key, litellm_url -__all__ = ["acompletion"] +_RWrapped = TypeVar("_RWrapped") + +__all__: List[str] = ["acompletion"] @wraps(_acompletion) diff --git a/agents-api/agents_api/clients/temporal.py b/agents-api/agents_api/clients/temporal.py index 61f53c71c..f271509b0 100644 --- a/agents-api/agents_api/clients/temporal.py +++ b/agents-api/agents_api/clients/temporal.py @@ -1,3 +1,4 @@ +from datetime import timedelta from uuid import UUID from temporalio.client import Client, TLSConfig @@ -52,4 +53,5 @@ async def run_task_execution_workflow( args=[execution_input, start, previous_inputs], task_queue=temporal_task_queue, id=str(job_id), + run_timeout=timedelta(days=31), ) diff --git a/agents-api/agents_api/common/exceptions/__init__.py b/agents-api/agents_api/common/exceptions/__init__.py index fa0016b4e..a38a546a2 100644 --- a/agents-api/agents_api/common/exceptions/__init__.py +++ b/agents-api/agents_api/common/exceptions/__init__.py @@ -11,6 +11,6 @@ class BaseCommonException(Exception): - def __init__(self, msg: str, http_code: int): + def __init__(self, msg: str, http_code: int) -> None: super().__init__(msg) self.http_code = http_code diff --git a/agents-api/agents_api/common/protocol/tasks.py b/agents-api/agents_api/common/protocol/tasks.py index 61466dfdb..4196d73a7 100644 --- a/agents-api/agents_api/common/protocol/tasks.py +++ b/agents-api/agents_api/common/protocol/tasks.py @@ -1,11 +1,13 @@ -from typing import Any, Generic, TypeVar +from typing import Annotated, Any, Type from uuid import UUID -from pydantic import BaseModel, computed_field +from pydantic import BaseModel, Field, computed_field +from pydantic_partial import create_partial_model from ...autogen.openapi_model import ( Agent, CreateTaskRequest, + CreateTransitionRequest, Execution, PartialTaskSpecDef, PatchTaskRequest, @@ -53,6 +55,9 @@ } +PendingTransition: Type[BaseModel] = create_partial_model(CreateTransitionRequest) + + class ExecutionInput(BaseModel): developer_id: UUID execution: Execution @@ -66,40 +71,37 @@ class ExecutionInput(BaseModel): session: Session | None = None -WorkflowStepType = TypeVar("WorkflowStepType", bound=WorkflowStep) - - -class StepContext(BaseModel, Generic[WorkflowStepType]): +class StepContext(BaseModel): execution_input: ExecutionInput inputs: list[dict[str, Any]] cursor: TransitionTarget @computed_field @property - def outputs(self) -> list[dict[str, Any]]: + def outputs(self) -> Annotated[list[dict[str, Any]], Field(exclude=True)]: return self.inputs[1:] @computed_field @property - def current_input(self) -> dict[str, Any]: + def current_input(self) -> Annotated[dict[str, Any], Field(exclude=True)]: return self.inputs[-1] @computed_field @property - def current_workflow(self) -> Workflow: + def current_workflow(self) -> Annotated[Workflow, Field(exclude=True)]: workflows: list[Workflow] = self.execution_input.task.workflows return next(wf for wf in workflows if wf.name == self.cursor.workflow) @computed_field @property - def current_step(self) -> WorkflowStepType: - step = self.current_workflow[self.cursor.step] + def current_step(self) -> Annotated[WorkflowStep, Field(exclude=True)]: + step = self.current_workflow.steps[self.cursor.step] return step @computed_field @property - def is_last_step(self) -> bool: - return (self.cursor.step + 1) == len(self.current_workflow) + def is_last_step(self) -> Annotated[bool, Field(exclude=True)]: + return (self.cursor.step + 1) == len(self.current_workflow.steps) def model_dump(self, *args, **kwargs) -> dict[str, Any]: dump = super().model_dump(*args, **kwargs) @@ -108,11 +110,9 @@ def model_dump(self, *args, **kwargs) -> dict[str, Any]: return dump -OutcomeType = TypeVar("OutcomeType", bound=BaseModel) - - -class StepOutcome(BaseModel, Generic[OutcomeType]): - output: OutcomeType | None +class StepOutcome(BaseModel): + error: str | None = None + output: Any transition_to: tuple[TransitionType, TransitionTarget] | None = None diff --git a/agents-api/agents_api/common/utils/cozo.py b/agents-api/agents_api/common/utils/cozo.py index db8f336f0..a8195a1ba 100644 --- a/agents-api/agents_api/common/utils/cozo.py +++ b/agents-api/agents_api/common/utils/cozo.py @@ -8,7 +8,7 @@ from pycozo import Client # Define a mock client for testing purposes, simulating Cozo API client behavior. -_fake_client = SimpleNamespace() +_fake_client: SimpleNamespace = SimpleNamespace() # Lambda function to process and mutate data dictionaries using the Cozo client's internal method. This is a workaround to access protected member functions for testing. _fake_client._process_mutate_data_dict = lambda data: ( Client._process_mutate_data_dict(_fake_client, data) @@ -20,5 +20,5 @@ ) -def uuid_int_list_to_uuid4(data): +def uuid_int_list_to_uuid4(data) -> UUID: return UUID(bytes=b"".join([i.to_bytes(1, "big") for i in data])) diff --git a/agents-api/agents_api/common/utils/json.py b/agents-api/agents_api/common/utils/json.py index 9beff6049..3157af9c8 100644 --- a/agents-api/agents_api/common/utils/json.py +++ b/agents-api/agents_api/common/utils/json.py @@ -10,7 +10,7 @@ class CustomJSONEncoder(json.JSONEncoder): """A custom JSON encoder subclass that handles None values and UUIDs for JSON serialization. It allows specifying a default value for None objects during initialization.""" - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: """Initializes the custom JSON encoder. Parameters: *args: Variable length argument list. @@ -19,7 +19,7 @@ def __init__(self, *args, **kwargs): self._default_empty_value = kwargs.pop("default_empty_value") super().__init__(*args, **kwargs) - def encode(self, o): + def encode(self, o) -> str: """Encodes the given object into a JSON formatted string. Parameters: o: The object to encode. @@ -27,7 +27,7 @@ def encode(self, o): # Use the overridden default method for serialization before encoding return super().encode(self.default(o)) - def default(self, obj): + def default(self, obj) -> Any: """Provides a default serialization for objects that the standard JSON encoder cannot serialize. Parameters: obj: The object to serialize. diff --git a/agents-api/agents_api/common/utils/template.py b/agents-api/agents_api/common/utils/template.py index d806ddb6d..1fcc143b3 100644 --- a/agents-api/agents_api/common/utils/template.py +++ b/agents-api/agents_api/common/utils/template.py @@ -1,14 +1,16 @@ +from typing import List + import arrow from jinja2.sandbox import ImmutableSandboxedEnvironment from jinja2schema import infer, to_json_schema from jsonschema import validate -__all__ = [ +__all__: List[str] = [ "render_template", ] # jinja environment -jinja_env = ImmutableSandboxedEnvironment( +jinja_env: ImmutableSandboxedEnvironment = ImmutableSandboxedEnvironment( autoescape=False, trim_blocks=True, lstrip_blocks=True, diff --git a/agents-api/agents_api/dependencies/auth.py b/agents-api/agents_api/dependencies/auth.py index 0054cb1cc..e5e22995b 100644 --- a/agents-api/agents_api/dependencies/auth.py +++ b/agents-api/agents_api/dependencies/auth.py @@ -1,13 +1,18 @@ +from typing import Any + from fastapi import HTTPException, Security from fastapi.security.api_key import APIKeyHeader from starlette.status import HTTP_403_FORBIDDEN from ..env import api_key, api_key_header_name -api_key_header = APIKeyHeader(name=api_key_header_name, auto_error=False) +api_key_header: Any = APIKeyHeader(name=api_key_header_name, auto_error=False) -async def get_api_key(user_api_key: str = Security(api_key_header)): +async def get_api_key( + user_api_key: str = Security(api_key_header), +) -> str: + user_api_key = str(user_api_key) user_api_key = (user_api_key or "").replace("Bearer ", "").strip() if user_api_key != api_key: diff --git a/agents-api/agents_api/env.py b/agents-api/agents_api/env.py index afdc81e1e..64d9082ef 100644 --- a/agents-api/agents_api/env.py +++ b/agents-api/agents_api/env.py @@ -5,11 +5,12 @@ import random from pprint import pprint +from typing import Any, Dict from environs import Env # Initialize the Env object for environment variable parsing. -env = Env() +env: Any = Env() # Debug @@ -30,7 +31,7 @@ # Auth # ---- -_random_generated_key = "".join(str(random.randint(0, 9)) for _ in range(32)) +_random_generated_key: str = "".join(str(random.randint(0, 9)) for _ in range(32)) api_key: str = env.str("AGENTS_API_KEY", _random_generated_key) if api_key == _random_generated_key: @@ -65,12 +66,12 @@ temporal_namespace: str = env.str("TEMPORAL_NAMESPACE", default="default") temporal_client_cert: str = env.str("TEMPORAL_CLIENT_CERT", default=None) temporal_private_key: str = env.str("TEMPORAL_PRIVATE_KEY", default=None) -temporal_endpoint = env.str("TEMPORAL_ENDPOINT", default="localhost:7233") -temporal_task_queue = env.str("TEMPORAL_TASK_QUEUE", default="julep-task-queue") +temporal_endpoint: Any = env.str("TEMPORAL_ENDPOINT", default="localhost:7233") +temporal_task_queue: Any = env.str("TEMPORAL_TASK_QUEUE", default="julep-task-queue") # Consolidate environment variables -environment = dict( +environment: Dict[str, Any] = dict( debug=debug, cozo_host=cozo_host, cozo_auth=cozo_auth, diff --git a/agents-api/agents_api/exceptions.py b/agents-api/agents_api/exceptions.py index 2ccc5a67f..fbb8f00f8 100644 --- a/agents-api/agents_api/exceptions.py +++ b/agents-api/agents_api/exceptions.py @@ -3,17 +3,17 @@ class AgentsBaseException(Exception): class ModelNotSupportedError(AgentsBaseException): - def __init__(self, model_name): + def __init__(self, model_name) -> None: super().__init__(f"model {model_name} is not supported") class PromptTooBigError(AgentsBaseException): - def __init__(self, token_count, max_tokens): + def __init__(self, token_count, max_tokens) -> None: super().__init__( f"prompt is too big, {token_count} tokens provided, exceeds maximum of {max_tokens}" ) class UnknownTokenizerError(AgentsBaseException): - def __init__(self): + def __init__(self) -> None: super().__init__("unknown tokenizer") diff --git a/agents-api/agents_api/model_registry.py b/agents-api/agents_api/model_registry.py index 99ae66ea3..0120cc205 100644 --- a/agents-api/agents_api/model_registry.py +++ b/agents-api/agents_api/model_registry.py @@ -66,7 +66,7 @@ } -DISCONTINUED_MODELS = { +DISCONTINUED_MODELS: Dict[str, int] = { "code-davinci-002": 8001, "code-davinci-001": 8001, "code-cushman-002": 2048, @@ -84,9 +84,14 @@ "claude-3-haiku-20240307": 180000, } -OPENAI_MODELS = {**GPT4_MODELS, **TURBO_MODELS, **GPT3_5_MODELS, **GPT3_MODELS} +OPENAI_MODELS: Dict[str, int] = { + **GPT4_MODELS, + **TURBO_MODELS, + **GPT3_5_MODELS, + **GPT3_MODELS, +} -LOCAL_MODELS = { +LOCAL_MODELS: Dict[str, int] = { "gpt-4o": 32768, "gpt-4o-awq": 32768, "TinyLlama/TinyLlama_v1.1": 2048, @@ -95,13 +100,13 @@ "OpenPipe/Hermes-2-Theta-Llama-3-8B-32k": 32768, } -LOCAL_MODELS_WITH_TOOL_CALLS = { +LOCAL_MODELS_WITH_TOOL_CALLS: Dict[str, int] = { "OpenPipe/Hermes-2-Theta-Llama-3-8B-32k": 32768, "julep-ai/Hermes-2-Theta-Llama-3-8B": 8192, } -OLLAMA_MODELS = { +OLLAMA_MODELS: Dict[str, int] = { "llama2": 4096, } -CHAT_MODELS = {**GPT4_MODELS, **TURBO_MODELS, **CLAUDE_MODELS} +CHAT_MODELS: Dict[str, int] = {**GPT4_MODELS, **TURBO_MODELS, **CLAUDE_MODELS} diff --git a/agents-api/agents_api/models/agent/create_agent.py b/agents-api/agents_api/models/agent/create_agent.py index a4b408c78..73be4ec77 100644 --- a/agents-api/agents_api/models/agent/create_agent.py +++ b/agents-api/agents_api/models/agent/create_agent.py @@ -3,6 +3,7 @@ It includes functions to construct and execute datalog queries for inserting new agent records. """ +from typing import Any, TypeVar from uuid import UUID, uuid4 from beartype import beartype @@ -20,6 +21,9 @@ wrap_in_class, ) +ModelT = TypeVar("ModelT", bound=Any) +T = TypeVar("T") + @rewrap_exceptions( { diff --git a/agents-api/agents_api/models/agent/create_or_update_agent.py b/agents-api/agents_api/models/agent/create_or_update_agent.py index fb80f6dd7..64b008d44 100644 --- a/agents-api/agents_api/models/agent/create_or_update_agent.py +++ b/agents-api/agents_api/models/agent/create_or_update_agent.py @@ -3,6 +3,7 @@ It includes functions to construct and execute datalog queries for inserting new agent records. """ +from typing import Any, TypeVar from uuid import UUID from beartype import beartype @@ -20,6 +21,9 @@ wrap_in_class, ) +ModelT = TypeVar("ModelT", bound=Any) +T = TypeVar("T") + @rewrap_exceptions( { diff --git a/agents-api/agents_api/models/agent/delete_agent.py b/agents-api/agents_api/models/agent/delete_agent.py index e1efd7333..409c755d3 100644 --- a/agents-api/agents_api/models/agent/delete_agent.py +++ b/agents-api/agents_api/models/agent/delete_agent.py @@ -2,6 +2,7 @@ This module contains the implementation of the delete_agent_query function, which is responsible for deleting an agent and its related default settings from the CozoDB database. """ +from typing import Any, TypeVar from uuid import UUID from beartype import beartype @@ -20,6 +21,9 @@ wrap_in_class, ) +ModelT = TypeVar("ModelT", bound=Any) +T = TypeVar("T") + @rewrap_exceptions( { diff --git a/agents-api/agents_api/models/agent/get_agent.py b/agents-api/agents_api/models/agent/get_agent.py index ceef527f3..c977fa614 100644 --- a/agents-api/agents_api/models/agent/get_agent.py +++ b/agents-api/agents_api/models/agent/get_agent.py @@ -1,3 +1,4 @@ +from typing import Any, TypeVar from uuid import UUID from beartype import beartype @@ -15,6 +16,9 @@ wrap_in_class, ) +ModelT = TypeVar("ModelT", bound=Any) +T = TypeVar("T") + @rewrap_exceptions( { diff --git a/agents-api/agents_api/models/agent/list_agents.py b/agents-api/agents_api/models/agent/list_agents.py index 5d291f654..5266659d7 100644 --- a/agents-api/agents_api/models/agent/list_agents.py +++ b/agents-api/agents_api/models/agent/list_agents.py @@ -1,4 +1,4 @@ -from typing import Any, Literal +from typing import Any, Literal, TypeVar from uuid import UUID from beartype import beartype @@ -16,6 +16,9 @@ wrap_in_class, ) +ModelT = TypeVar("ModelT", bound=Any) +T = TypeVar("T") + @rewrap_exceptions( { diff --git a/agents-api/agents_api/models/agent/patch_agent.py b/agents-api/agents_api/models/agent/patch_agent.py index 336e33a91..72fdc7811 100644 --- a/agents-api/agents_api/models/agent/patch_agent.py +++ b/agents-api/agents_api/models/agent/patch_agent.py @@ -1,3 +1,4 @@ +from typing import Any, TypeVar from uuid import UUID from beartype import beartype @@ -17,6 +18,9 @@ wrap_in_class, ) +ModelT = TypeVar("ModelT", bound=Any) +T = TypeVar("T") + @rewrap_exceptions( { diff --git a/agents-api/agents_api/models/agent/update_agent.py b/agents-api/agents_api/models/agent/update_agent.py index 4dd489333..be7e9ea21 100644 --- a/agents-api/agents_api/models/agent/update_agent.py +++ b/agents-api/agents_api/models/agent/update_agent.py @@ -1,3 +1,4 @@ +from typing import Any, TypeVar from uuid import UUID from beartype import beartype @@ -16,6 +17,9 @@ wrap_in_class, ) +ModelT = TypeVar("ModelT", bound=Any) +T = TypeVar("T") + @rewrap_exceptions( { diff --git a/agents-api/agents_api/models/chat/gather_messages.py b/agents-api/agents_api/models/chat/gather_messages.py index 2a3c0eca1..f8e08632d 100644 --- a/agents-api/agents_api/models/chat/gather_messages.py +++ b/agents-api/agents_api/models/chat/gather_messages.py @@ -1,3 +1,4 @@ +from typing import TypeVar from uuid import UUID from beartype import beartype @@ -18,6 +19,8 @@ rewrap_exceptions, ) +T = TypeVar("T") + @rewrap_exceptions( { diff --git a/agents-api/agents_api/models/chat/prepare_chat_context.py b/agents-api/agents_api/models/chat/prepare_chat_context.py index 5ca93b8c0..742038535 100644 --- a/agents-api/agents_api/models/chat/prepare_chat_context.py +++ b/agents-api/agents_api/models/chat/prepare_chat_context.py @@ -1,3 +1,4 @@ +from typing import Any, TypeVar from uuid import UUID from beartype import beartype @@ -17,6 +18,9 @@ wrap_in_class, ) +ModelT = TypeVar("ModelT", bound=Any) +T = TypeVar("T") + @rewrap_exceptions( { diff --git a/agents-api/agents_api/models/developer/get_developer.py b/agents-api/agents_api/models/developer/get_developer.py index c78517613..31ade5334 100644 --- a/agents-api/agents_api/models/developer/get_developer.py +++ b/agents-api/agents_api/models/developer/get_developer.py @@ -1,5 +1,6 @@ """Module for retrieving document snippets from the CozoDB based on document IDs.""" +from typing import Any, TypeVar from uuid import UUID from beartype import beartype @@ -16,6 +17,9 @@ wrap_in_class, ) +ModelT = TypeVar("ModelT", bound=Any) +T = TypeVar("T") + @rewrap_exceptions({QueryException: partialclass(HTTPException, status_code=401)}) @cozo_query diff --git a/agents-api/agents_api/models/docs/create_doc.py b/agents-api/agents_api/models/docs/create_doc.py index 3a86ad0e5..ee26df484 100644 --- a/agents-api/agents_api/models/docs/create_doc.py +++ b/agents-api/agents_api/models/docs/create_doc.py @@ -1,4 +1,4 @@ -from typing import Literal +from typing import Any, Literal, TypeVar from uuid import UUID, uuid4 from beartype import beartype @@ -17,6 +17,9 @@ wrap_in_class, ) +ModelT = TypeVar("ModelT", bound=Any) +T = TypeVar("T") + @rewrap_exceptions( { diff --git a/agents-api/agents_api/models/docs/delete_doc.py b/agents-api/agents_api/models/docs/delete_doc.py index e7a02f3d9..c02705756 100644 --- a/agents-api/agents_api/models/docs/delete_doc.py +++ b/agents-api/agents_api/models/docs/delete_doc.py @@ -1,3 +1,4 @@ +from typing import Any, TypeVar from uuid import UUID from beartype import beartype @@ -16,6 +17,9 @@ wrap_in_class, ) +ModelT = TypeVar("ModelT", bound=Any) +T = TypeVar("T") + @rewrap_exceptions( { diff --git a/agents-api/agents_api/models/docs/embed_snippets.py b/agents-api/agents_api/models/docs/embed_snippets.py index a701ef1be..e810d0379 100644 --- a/agents-api/agents_api/models/docs/embed_snippets.py +++ b/agents-api/agents_api/models/docs/embed_snippets.py @@ -1,5 +1,6 @@ """Module for embedding documents in the cozodb database. Contains functions to update document embeddings.""" +from typing import Any, TypeVar from uuid import UUID from beartype import beartype @@ -18,6 +19,9 @@ wrap_in_class, ) +ModelT = TypeVar("ModelT", bound=Any) +T = TypeVar("T") + @rewrap_exceptions( { diff --git a/agents-api/agents_api/models/docs/get_doc.py b/agents-api/agents_api/models/docs/get_doc.py index 6c612fef7..84cd181ec 100644 --- a/agents-api/agents_api/models/docs/get_doc.py +++ b/agents-api/agents_api/models/docs/get_doc.py @@ -1,5 +1,6 @@ """Module for retrieving document snippets from the CozoDB based on document IDs.""" +from typing import Any, TypeVar from uuid import UUID from beartype import beartype @@ -16,6 +17,9 @@ wrap_in_class, ) +ModelT = TypeVar("ModelT", bound=Any) +T = TypeVar("T") + @rewrap_exceptions( { diff --git a/agents-api/agents_api/models/docs/list_docs.py b/agents-api/agents_api/models/docs/list_docs.py index d785cc331..afdf06c2d 100644 --- a/agents-api/agents_api/models/docs/list_docs.py +++ b/agents-api/agents_api/models/docs/list_docs.py @@ -1,7 +1,7 @@ """This module contains functions for querying document-related data from the 'cozodb' database using datalog queries.""" import json -from typing import Any, Literal +from typing import Any, Literal, TypeVar from uuid import UUID from beartype import beartype @@ -19,6 +19,9 @@ wrap_in_class, ) +ModelT = TypeVar("ModelT", bound=Any) +T = TypeVar("T") + @rewrap_exceptions( { diff --git a/agents-api/agents_api/models/docs/search_docs_by_embedding.py b/agents-api/agents_api/models/docs/search_docs_by_embedding.py index 3f7114a23..acebd09cd 100644 --- a/agents-api/agents_api/models/docs/search_docs_by_embedding.py +++ b/agents-api/agents_api/models/docs/search_docs_by_embedding.py @@ -1,6 +1,6 @@ """This module contains functions for searching documents in the CozoDB based on embedding queries.""" -from typing import Literal +from typing import Any, Literal, TypeVar from uuid import UUID from beartype import beartype @@ -18,6 +18,9 @@ wrap_in_class, ) +ModelT = TypeVar("ModelT", bound=Any) +T = TypeVar("T") + @rewrap_exceptions( { diff --git a/agents-api/agents_api/models/docs/search_docs_by_text.py b/agents-api/agents_api/models/docs/search_docs_by_text.py index a5e379f24..0662aa84d 100644 --- a/agents-api/agents_api/models/docs/search_docs_by_text.py +++ b/agents-api/agents_api/models/docs/search_docs_by_text.py @@ -1,6 +1,6 @@ """This module contains functions for searching documents in the CozoDB based on embedding queries.""" -from typing import Literal +from typing import Any, Literal, TypeVar from uuid import UUID from beartype import beartype @@ -18,6 +18,9 @@ wrap_in_class, ) +ModelT = TypeVar("ModelT", bound=Any) +T = TypeVar("T") + @rewrap_exceptions( { diff --git a/agents-api/agents_api/models/entry/create_entries.py b/agents-api/agents_api/models/entry/create_entries.py index e71a81c7a..e227714d1 100644 --- a/agents-api/agents_api/models/entry/create_entries.py +++ b/agents-api/agents_api/models/entry/create_entries.py @@ -1,3 +1,4 @@ +from typing import Any, TypeVar from uuid import UUID, uuid4 from beartype import beartype @@ -19,6 +20,9 @@ wrap_in_class, ) +ModelT = TypeVar("ModelT", bound=Any) +T = TypeVar("T") + @rewrap_exceptions( { diff --git a/agents-api/agents_api/models/entry/delete_entries.py b/agents-api/agents_api/models/entry/delete_entries.py index 1d7cf0386..48c37cd25 100644 --- a/agents-api/agents_api/models/entry/delete_entries.py +++ b/agents-api/agents_api/models/entry/delete_entries.py @@ -1,3 +1,4 @@ +from typing import Any, TypeVar from uuid import UUID from beartype import beartype @@ -17,6 +18,9 @@ wrap_in_class, ) +ModelT = TypeVar("ModelT", bound=Any) +T = TypeVar("T") + @rewrap_exceptions( { diff --git a/agents-api/agents_api/models/entry/get_history.py b/agents-api/agents_api/models/entry/get_history.py index fed658ea5..68fe05979 100644 --- a/agents-api/agents_api/models/entry/get_history.py +++ b/agents-api/agents_api/models/entry/get_history.py @@ -1,3 +1,4 @@ +from typing import Any, TypeVar from uuid import UUID from beartype import beartype @@ -16,6 +17,9 @@ wrap_in_class, ) +ModelT = TypeVar("ModelT", bound=Any) +T = TypeVar("T") + @rewrap_exceptions( { diff --git a/agents-api/agents_api/models/entry/list_entries.py b/agents-api/agents_api/models/entry/list_entries.py index da2341c4c..d3081a9b0 100644 --- a/agents-api/agents_api/models/entry/list_entries.py +++ b/agents-api/agents_api/models/entry/list_entries.py @@ -1,4 +1,4 @@ -from typing import Literal +from typing import Any, Literal, TypeVar from uuid import UUID from beartype import beartype @@ -16,6 +16,9 @@ wrap_in_class, ) +ModelT = TypeVar("ModelT", bound=Any) +T = TypeVar("T") + @rewrap_exceptions( { diff --git a/agents-api/agents_api/models/execution/create_execution.py b/agents-api/agents_api/models/execution/create_execution.py index c564c343d..b4918065b 100644 --- a/agents-api/agents_api/models/execution/create_execution.py +++ b/agents-api/agents_api/models/execution/create_execution.py @@ -1,4 +1,4 @@ -from typing import Annotated +from typing import Annotated, Any, TypeVar from uuid import UUID, uuid4 from beartype import beartype @@ -18,6 +18,9 @@ wrap_in_class, ) +ModelT = TypeVar("ModelT", bound=Any) +T = TypeVar("T") + @rewrap_exceptions( { diff --git a/agents-api/agents_api/models/execution/create_temporal_lookup.py b/agents-api/agents_api/models/execution/create_temporal_lookup.py index 1867b64b9..21c3005dd 100644 --- a/agents-api/agents_api/models/execution/create_temporal_lookup.py +++ b/agents-api/agents_api/models/execution/create_temporal_lookup.py @@ -1,3 +1,4 @@ +from typing import TypeVar from uuid import UUID, uuid4 from beartype import beartype @@ -15,6 +16,8 @@ verify_developer_owns_resource_query, ) +T = TypeVar("T") + @rewrap_exceptions( { diff --git a/agents-api/agents_api/models/execution/get_execution.py b/agents-api/agents_api/models/execution/get_execution.py index a0bbe550c..cf9df2e09 100644 --- a/agents-api/agents_api/models/execution/get_execution.py +++ b/agents-api/agents_api/models/execution/get_execution.py @@ -1,3 +1,4 @@ +from typing import Any, TypeVar from uuid import UUID from beartype import beartype @@ -13,6 +14,9 @@ wrap_in_class, ) +ModelT = TypeVar("ModelT", bound=Any) +T = TypeVar("T") + @rewrap_exceptions( { diff --git a/agents-api/agents_api/models/execution/get_execution_transition.py b/agents-api/agents_api/models/execution/get_execution_transition.py index 39d30278c..d418ef5f4 100644 --- a/agents-api/agents_api/models/execution/get_execution_transition.py +++ b/agents-api/agents_api/models/execution/get_execution_transition.py @@ -1,3 +1,4 @@ +from typing import Any, TypeVar from uuid import UUID from beartype import beartype @@ -14,6 +15,9 @@ wrap_in_class, ) +ModelT = TypeVar("ModelT", bound=Any) +T = TypeVar("T") + @rewrap_exceptions( { diff --git a/agents-api/agents_api/models/execution/get_paused_execution_token.py b/agents-api/agents_api/models/execution/get_paused_execution_token.py index 1b1f6e803..d8b0945c1 100644 --- a/agents-api/agents_api/models/execution/get_paused_execution_token.py +++ b/agents-api/agents_api/models/execution/get_paused_execution_token.py @@ -1,3 +1,4 @@ +from typing import Any, TypeVar from uuid import UUID from beartype import beartype @@ -13,6 +14,9 @@ wrap_in_class, ) +ModelT = TypeVar("ModelT", bound=Any) +T = TypeVar("T") + @rewrap_exceptions( { diff --git a/agents-api/agents_api/models/execution/get_temporal_workflow_data.py b/agents-api/agents_api/models/execution/get_temporal_workflow_data.py index 104918f22..bb0a462ef 100644 --- a/agents-api/agents_api/models/execution/get_temporal_workflow_data.py +++ b/agents-api/agents_api/models/execution/get_temporal_workflow_data.py @@ -1,3 +1,4 @@ +from typing import Any, TypeVar from uuid import UUID from beartype import beartype @@ -12,6 +13,9 @@ wrap_in_class, ) +ModelT = TypeVar("ModelT", bound=Any) +T = TypeVar("T") + @rewrap_exceptions( { diff --git a/agents-api/agents_api/models/execution/list_execution_transitions.py b/agents-api/agents_api/models/execution/list_execution_transitions.py index 9b103acf0..45aca935a 100644 --- a/agents-api/agents_api/models/execution/list_execution_transitions.py +++ b/agents-api/agents_api/models/execution/list_execution_transitions.py @@ -1,4 +1,4 @@ -from typing import Literal +from typing import Any, Literal, TypeVar from uuid import UUID from beartype import beartype @@ -9,6 +9,9 @@ from ...autogen.openapi_model import Transition from ..utils import cozo_query, partialclass, rewrap_exceptions, wrap_in_class +ModelT = TypeVar("ModelT", bound=Any) +T = TypeVar("T") + @rewrap_exceptions( { diff --git a/agents-api/agents_api/models/execution/list_executions.py b/agents-api/agents_api/models/execution/list_executions.py index e497ec4fe..09194cdbd 100644 --- a/agents-api/agents_api/models/execution/list_executions.py +++ b/agents-api/agents_api/models/execution/list_executions.py @@ -1,4 +1,4 @@ -from typing import Literal +from typing import Any, Literal, TypeVar from uuid import UUID from beartype import beartype @@ -16,6 +16,9 @@ wrap_in_class, ) +ModelT = TypeVar("ModelT", bound=Any) +T = TypeVar("T") + @rewrap_exceptions( { diff --git a/agents-api/agents_api/models/execution/prepare_execution_input.py b/agents-api/agents_api/models/execution/prepare_execution_input.py index 39485b90f..c858bc6a0 100644 --- a/agents-api/agents_api/models/execution/prepare_execution_input.py +++ b/agents-api/agents_api/models/execution/prepare_execution_input.py @@ -1,3 +1,4 @@ +from typing import Any, TypeVar from uuid import UUID from beartype import beartype @@ -20,6 +21,9 @@ ) from .get_execution import get_execution +ModelT = TypeVar("ModelT", bound=Any) +T = TypeVar("T") + @rewrap_exceptions( { @@ -167,7 +171,7 @@ def prepare_execution_input( # TODO: Enable these later user = null, session = null, - arguments = {{}}, + arguments = execution->"input" """ queries = [ diff --git a/agents-api/agents_api/models/execution/update_execution.py b/agents-api/agents_api/models/execution/update_execution.py index f3c1e528e..90a8cb1cc 100644 --- a/agents-api/agents_api/models/execution/update_execution.py +++ b/agents-api/agents_api/models/execution/update_execution.py @@ -1,3 +1,4 @@ +from typing import Any, TypeVar from uuid import UUID from beartype import beartype @@ -22,6 +23,9 @@ wrap_in_class, ) +ModelT = TypeVar("ModelT", bound=Any) +T = TypeVar("T") + @rewrap_exceptions( { diff --git a/agents-api/agents_api/models/session/create_or_update_session.py b/agents-api/agents_api/models/session/create_or_update_session.py index 7b2e39e74..60c0b7f71 100644 --- a/agents-api/agents_api/models/session/create_or_update_session.py +++ b/agents-api/agents_api/models/session/create_or_update_session.py @@ -1,3 +1,4 @@ +from typing import Any, TypeVar from uuid import UUID from beartype import beartype @@ -19,6 +20,9 @@ wrap_in_class, ) +ModelT = TypeVar("ModelT", bound=Any) +T = TypeVar("T") + @rewrap_exceptions( { diff --git a/agents-api/agents_api/models/session/create_session.py b/agents-api/agents_api/models/session/create_session.py index 7bb0576c9..a83837ffd 100644 --- a/agents-api/agents_api/models/session/create_session.py +++ b/agents-api/agents_api/models/session/create_session.py @@ -3,6 +3,7 @@ It constructs and executes a datalog query to insert session data. """ +from typing import Any, TypeVar from uuid import UUID, uuid4 from beartype import beartype @@ -20,6 +21,9 @@ wrap_in_class, ) +ModelT = TypeVar("ModelT", bound=Any) +T = TypeVar("T") + @rewrap_exceptions( { diff --git a/agents-api/agents_api/models/session/delete_session.py b/agents-api/agents_api/models/session/delete_session.py index 71f153fb1..af9e331c7 100644 --- a/agents-api/agents_api/models/session/delete_session.py +++ b/agents-api/agents_api/models/session/delete_session.py @@ -1,5 +1,6 @@ """This module contains the implementation for deleting sessions from the 'cozodb' database using datalog queries.""" +from typing import Any, TypeVar from uuid import UUID from beartype import beartype @@ -18,6 +19,9 @@ wrap_in_class, ) +ModelT = TypeVar("ModelT", bound=Any) +T = TypeVar("T") + @rewrap_exceptions( { diff --git a/agents-api/agents_api/models/session/get_session.py b/agents-api/agents_api/models/session/get_session.py index 8e7d6adb5..0a365df2f 100644 --- a/agents-api/agents_api/models/session/get_session.py +++ b/agents-api/agents_api/models/session/get_session.py @@ -1,3 +1,4 @@ +from typing import Any, TypeVar from uuid import UUID from beartype import beartype @@ -15,6 +16,9 @@ wrap_in_class, ) +ModelT = TypeVar("ModelT", bound=Any) +T = TypeVar("T") + @rewrap_exceptions( { diff --git a/agents-api/agents_api/models/session/list_sessions.py b/agents-api/agents_api/models/session/list_sessions.py index dba36ab98..fa1097e5e 100644 --- a/agents-api/agents_api/models/session/list_sessions.py +++ b/agents-api/agents_api/models/session/list_sessions.py @@ -1,6 +1,6 @@ """This module contains functions for querying session data from the 'cozodb' database.""" -from typing import Any, Literal +from typing import Any, Literal, TypeVar from uuid import UUID from beartype import beartype @@ -18,6 +18,9 @@ wrap_in_class, ) +ModelT = TypeVar("ModelT", bound=Any) +T = TypeVar("T") + @rewrap_exceptions( { diff --git a/agents-api/agents_api/models/session/patch_session.py b/agents-api/agents_api/models/session/patch_session.py index feafcc679..e6e0e5750 100644 --- a/agents-api/agents_api/models/session/patch_session.py +++ b/agents-api/agents_api/models/session/patch_session.py @@ -1,5 +1,6 @@ """This module contains functions for patching session data in the 'cozodb' database using datalog queries.""" +from typing import Any, List, TypeVar from uuid import UUID from beartype import beartype @@ -18,7 +19,10 @@ wrap_in_class, ) -_fields = [ +ModelT = TypeVar("ModelT", bound=Any) +T = TypeVar("T") + +_fields: List[str] = [ "situation", "summary", "created_at", diff --git a/agents-api/agents_api/models/session/prepare_session_data.py b/agents-api/agents_api/models/session/prepare_session_data.py index 754b0538c..9a936b183 100644 --- a/agents-api/agents_api/models/session/prepare_session_data.py +++ b/agents-api/agents_api/models/session/prepare_session_data.py @@ -1,3 +1,4 @@ +from typing import Any, TypeVar from uuid import UUID from beartype import beartype @@ -15,6 +16,9 @@ wrap_in_class, ) +ModelT = TypeVar("ModelT", bound=Any) +T = TypeVar("T") + @rewrap_exceptions( { diff --git a/agents-api/agents_api/models/session/update_session.py b/agents-api/agents_api/models/session/update_session.py index 14b989de1..99688bd98 100644 --- a/agents-api/agents_api/models/session/update_session.py +++ b/agents-api/agents_api/models/session/update_session.py @@ -1,3 +1,4 @@ +from typing import Any, List, TypeVar from uuid import UUID from beartype import beartype @@ -16,7 +17,10 @@ wrap_in_class, ) -_fields = [ +ModelT = TypeVar("ModelT", bound=Any) +T = TypeVar("T") + +_fields: List[str] = [ "situation", "summary", "metadata", diff --git a/agents-api/agents_api/models/task/create_or_update_task.py b/agents-api/agents_api/models/task/create_or_update_task.py index a3014a64f..af7e258d9 100644 --- a/agents-api/agents_api/models/task/create_or_update_task.py +++ b/agents-api/agents_api/models/task/create_or_update_task.py @@ -3,6 +3,7 @@ It constructs and executes a datalog query to insert Task data. """ +from typing import Any, TypeVar from uuid import UUID from beartype import beartype @@ -26,6 +27,9 @@ wrap_in_class, ) +ModelT = TypeVar("ModelT", bound=Any) +T = TypeVar("T") + @rewrap_exceptions( { diff --git a/agents-api/agents_api/models/task/create_task.py b/agents-api/agents_api/models/task/create_task.py index 61f0bca72..a44146c34 100644 --- a/agents-api/agents_api/models/task/create_task.py +++ b/agents-api/agents_api/models/task/create_task.py @@ -3,6 +3,7 @@ It constructs and executes a datalog query to insert Task data. """ +from typing import Any, TypeVar from uuid import UUID, uuid4 from beartype import beartype @@ -24,6 +25,9 @@ wrap_in_class, ) +ModelT = TypeVar("ModelT", bound=Any) +T = TypeVar("T") + @rewrap_exceptions( { diff --git a/agents-api/agents_api/models/task/delete_task.py b/agents-api/agents_api/models/task/delete_task.py index 1eb780057..60d6f2756 100644 --- a/agents-api/agents_api/models/task/delete_task.py +++ b/agents-api/agents_api/models/task/delete_task.py @@ -1,3 +1,4 @@ +from typing import Any, TypeVar from uuid import UUID from beartype import beartype @@ -16,6 +17,9 @@ wrap_in_class, ) +ModelT = TypeVar("ModelT", bound=Any) +T = TypeVar("T") + @rewrap_exceptions( { diff --git a/agents-api/agents_api/models/task/get_task.py b/agents-api/agents_api/models/task/get_task.py index 975da28cd..076936b6c 100644 --- a/agents-api/agents_api/models/task/get_task.py +++ b/agents-api/agents_api/models/task/get_task.py @@ -1,3 +1,4 @@ +from typing import Any, TypeVar from uuid import UUID from beartype import beartype @@ -15,6 +16,9 @@ ) from .create_task import spec_to_task +ModelT = TypeVar("ModelT", bound=Any) +T = TypeVar("T") + @rewrap_exceptions( { diff --git a/agents-api/agents_api/models/task/list_tasks.py b/agents-api/agents_api/models/task/list_tasks.py index 1c6e16efd..573c1404e 100644 --- a/agents-api/agents_api/models/task/list_tasks.py +++ b/agents-api/agents_api/models/task/list_tasks.py @@ -1,4 +1,4 @@ -from typing import Literal +from typing import Any, Literal, TypeVar from uuid import UUID from beartype import beartype @@ -16,6 +16,9 @@ ) from .create_task import spec_to_task +ModelT = TypeVar("ModelT", bound=Any) +T = TypeVar("T") + @rewrap_exceptions( { diff --git a/agents-api/agents_api/models/task/patch_task.py b/agents-api/agents_api/models/task/patch_task.py index dc32f83d2..1837064c7 100644 --- a/agents-api/agents_api/models/task/patch_task.py +++ b/agents-api/agents_api/models/task/patch_task.py @@ -3,6 +3,7 @@ It constructs and executes a datalog query to insert Task data. """ +from typing import Any, TypeVar from uuid import UUID from beartype import beartype @@ -22,6 +23,9 @@ wrap_in_class, ) +ModelT = TypeVar("ModelT", bound=Any) +T = TypeVar("T") + @rewrap_exceptions( { diff --git a/agents-api/agents_api/models/task/update_task.py b/agents-api/agents_api/models/task/update_task.py index 151d4fb4d..9cfb04357 100644 --- a/agents-api/agents_api/models/task/update_task.py +++ b/agents-api/agents_api/models/task/update_task.py @@ -3,6 +3,7 @@ It constructs and executes a datalog query to insert Task data. """ +from typing import Any, TypeVar from uuid import UUID from beartype import beartype @@ -22,6 +23,9 @@ wrap_in_class, ) +ModelT = TypeVar("ModelT", bound=Any) +T = TypeVar("T") + @rewrap_exceptions( { diff --git a/agents-api/agents_api/models/tools/create_tools.py b/agents-api/agents_api/models/tools/create_tools.py index 0c034d4d2..dd8397797 100644 --- a/agents-api/agents_api/models/tools/create_tools.py +++ b/agents-api/agents_api/models/tools/create_tools.py @@ -1,5 +1,6 @@ """This module contains functions for creating tools in the CozoDB database.""" +from typing import Any, TypeVar from uuid import UUID, uuid4 from beartype import beartype @@ -17,6 +18,9 @@ wrap_in_class, ) +ModelT = TypeVar("ModelT", bound=Any) +T = TypeVar("T") + @rewrap_exceptions( { diff --git a/agents-api/agents_api/models/tools/delete_tool.py b/agents-api/agents_api/models/tools/delete_tool.py index e6d00498a..c79cdfd29 100644 --- a/agents-api/agents_api/models/tools/delete_tool.py +++ b/agents-api/agents_api/models/tools/delete_tool.py @@ -1,3 +1,4 @@ +from typing import Any, TypeVar from uuid import UUID from beartype import beartype @@ -16,6 +17,9 @@ wrap_in_class, ) +ModelT = TypeVar("ModelT", bound=Any) +T = TypeVar("T") + @rewrap_exceptions( { diff --git a/agents-api/agents_api/models/tools/get_tool.py b/agents-api/agents_api/models/tools/get_tool.py index f3e6a52c3..5ea009064 100644 --- a/agents-api/agents_api/models/tools/get_tool.py +++ b/agents-api/agents_api/models/tools/get_tool.py @@ -1,3 +1,4 @@ +from typing import Any, TypeVar from uuid import UUID from beartype import beartype @@ -15,6 +16,9 @@ wrap_in_class, ) +ModelT = TypeVar("ModelT", bound=Any) +T = TypeVar("T") + @rewrap_exceptions( { diff --git a/agents-api/agents_api/models/tools/list_tools.py b/agents-api/agents_api/models/tools/list_tools.py index e1636fdd4..4b44fc1e0 100644 --- a/agents-api/agents_api/models/tools/list_tools.py +++ b/agents-api/agents_api/models/tools/list_tools.py @@ -1,4 +1,4 @@ -from typing import Literal +from typing import Any, Literal, TypeVar from uuid import UUID from beartype import beartype @@ -16,6 +16,9 @@ wrap_in_class, ) +ModelT = TypeVar("ModelT", bound=Any) +T = TypeVar("T") + @rewrap_exceptions( { diff --git a/agents-api/agents_api/models/tools/patch_tool.py b/agents-api/agents_api/models/tools/patch_tool.py index 0b2777030..5bbfe1c91 100644 --- a/agents-api/agents_api/models/tools/patch_tool.py +++ b/agents-api/agents_api/models/tools/patch_tool.py @@ -1,3 +1,4 @@ +from typing import Any, TypeVar from uuid import UUID from beartype import beartype @@ -16,6 +17,9 @@ wrap_in_class, ) +ModelT = TypeVar("ModelT", bound=Any) +T = TypeVar("T") + @rewrap_exceptions( { diff --git a/agents-api/agents_api/models/tools/update_tool.py b/agents-api/agents_api/models/tools/update_tool.py index 3e91b7562..d1676e984 100644 --- a/agents-api/agents_api/models/tools/update_tool.py +++ b/agents-api/agents_api/models/tools/update_tool.py @@ -1,3 +1,4 @@ +from typing import Any, TypeVar from uuid import UUID from beartype import beartype @@ -19,6 +20,9 @@ wrap_in_class, ) +ModelT = TypeVar("ModelT", bound=Any) +T = TypeVar("T") + @rewrap_exceptions( { diff --git a/agents-api/agents_api/models/user/create_or_update_user.py b/agents-api/agents_api/models/user/create_or_update_user.py index 5784db880..9e9045e74 100644 --- a/agents-api/agents_api/models/user/create_or_update_user.py +++ b/agents-api/agents_api/models/user/create_or_update_user.py @@ -3,6 +3,7 @@ It includes functions to construct and execute datalog queries for inserting new user records. """ +from typing import Any, TypeVar from uuid import UUID from beartype import beartype @@ -19,6 +20,9 @@ wrap_in_class, ) +ModelT = TypeVar("ModelT", bound=Any) +T = TypeVar("T") + @rewrap_exceptions( { diff --git a/agents-api/agents_api/models/user/create_user.py b/agents-api/agents_api/models/user/create_user.py index 4115b3326..9dd036c57 100644 --- a/agents-api/agents_api/models/user/create_user.py +++ b/agents-api/agents_api/models/user/create_user.py @@ -3,6 +3,7 @@ It defines a query for inserting user data into the 'users' relation. """ +from typing import Any, TypeVar from uuid import UUID, uuid4 from beartype import beartype @@ -19,6 +20,9 @@ wrap_in_class, ) +ModelT = TypeVar("ModelT", bound=Any) +T = TypeVar("T") + @rewrap_exceptions( { diff --git a/agents-api/agents_api/models/user/delete_user.py b/agents-api/agents_api/models/user/delete_user.py index b9ebc2db7..b5fcb8424 100644 --- a/agents-api/agents_api/models/user/delete_user.py +++ b/agents-api/agents_api/models/user/delete_user.py @@ -2,6 +2,7 @@ This module contains the implementation of the delete_user_query function, which is responsible for deleting an user and its related default settings from the CozoDB database. """ +from typing import Any, TypeVar from uuid import UUID from beartype import beartype @@ -20,6 +21,9 @@ wrap_in_class, ) +ModelT = TypeVar("ModelT", bound=Any) +T = TypeVar("T") + @rewrap_exceptions( { diff --git a/agents-api/agents_api/models/user/get_user.py b/agents-api/agents_api/models/user/get_user.py index d4556a365..181bf05f0 100644 --- a/agents-api/agents_api/models/user/get_user.py +++ b/agents-api/agents_api/models/user/get_user.py @@ -1,3 +1,4 @@ +from typing import Any, TypeVar from uuid import UUID from beartype import beartype @@ -15,6 +16,9 @@ wrap_in_class, ) +ModelT = TypeVar("ModelT", bound=Any) +T = TypeVar("T") + @rewrap_exceptions( { diff --git a/agents-api/agents_api/models/user/list_users.py b/agents-api/agents_api/models/user/list_users.py index 5fdc62ef0..57dc9b8c8 100644 --- a/agents-api/agents_api/models/user/list_users.py +++ b/agents-api/agents_api/models/user/list_users.py @@ -1,4 +1,4 @@ -from typing import Any, Literal +from typing import Any, Literal, TypeVar from uuid import UUID from beartype import beartype @@ -16,6 +16,9 @@ wrap_in_class, ) +ModelT = TypeVar("ModelT", bound=Any) +T = TypeVar("T") + @rewrap_exceptions( { diff --git a/agents-api/agents_api/models/user/patch_user.py b/agents-api/agents_api/models/user/patch_user.py index d8dfeb2ad..faf38298c 100644 --- a/agents-api/agents_api/models/user/patch_user.py +++ b/agents-api/agents_api/models/user/patch_user.py @@ -1,5 +1,6 @@ """Module for generating datalog queries to update user information in the 'cozodb' database.""" +from typing import Any, TypeVar from uuid import UUID from beartype import beartype @@ -19,6 +20,9 @@ wrap_in_class, ) +ModelT = TypeVar("ModelT", bound=Any) +T = TypeVar("T") + @rewrap_exceptions( { diff --git a/agents-api/agents_api/models/user/update_user.py b/agents-api/agents_api/models/user/update_user.py index 8411ecc3e..9a13d9369 100644 --- a/agents-api/agents_api/models/user/update_user.py +++ b/agents-api/agents_api/models/user/update_user.py @@ -1,3 +1,4 @@ +from typing import Any, TypeVar from uuid import UUID from beartype import beartype @@ -16,6 +17,9 @@ wrap_in_class, ) +ModelT = TypeVar("ModelT", bound=Any) +T = TypeVar("T") + @rewrap_exceptions( { diff --git a/agents-api/agents_api/models/utils.py b/agents-api/agents_api/models/utils.py index ee2ba3fdd..bc36af8d2 100644 --- a/agents-api/agents_api/models/utils.py +++ b/agents-api/agents_api/models/utils.py @@ -195,10 +195,10 @@ def wrapper(*args: P.args, client=None, **kwargs: P.kwargs) -> pd.DataFrame: ) # Run the query - from ..clients.cozo import get_cozo_client + from ..clients import cozo try: - client = client or get_cozo_client() + client = client or cozo.get_cozo_client() result = client.run(query, variables) except Exception as e: diff --git a/agents-api/agents_api/rec_sum/data.py b/agents-api/agents_api/rec_sum/data.py index e7857a037..23474c995 100644 --- a/agents-api/agents_api/rec_sum/data.py +++ b/agents-api/agents_api/rec_sum/data.py @@ -1,24 +1,25 @@ import json from pathlib import Path +from typing import Any -module_directory = Path(__file__).parent +module_directory: Path = Path(__file__).parent with open(f"{module_directory}/entities_example_chat.json", "r") as _f: - entities_example_chat = json.load(_f) + entities_example_chat: Any = json.load(_f) with open(f"{module_directory}/trim_example_chat.json", "r") as _f: - trim_example_chat = json.load(_f) + trim_example_chat: Any = json.load(_f) with open(f"{module_directory}/trim_example_result.json", "r") as _f: - trim_example_result = json.load(_f) + trim_example_result: Any = json.load(_f) with open(f"{module_directory}/summarize_example_chat.json", "r") as _f: - summarize_example_chat = json.load(_f) + summarize_example_chat: Any = json.load(_f) with open(f"{module_directory}/summarize_example_result.json", "r") as _f: - summarize_example_result = json.load(_f) + summarize_example_result: Any = json.load(_f) diff --git a/agents-api/agents_api/rec_sum/entities.py b/agents-api/agents_api/rec_sum/entities.py index 9992063ff..01b29951b 100644 --- a/agents-api/agents_api/rec_sum/entities.py +++ b/agents-api/agents_api/rec_sum/entities.py @@ -12,21 +12,21 @@ ## Entities ## ############## -entities_example_plan = """\ +entities_example_plan: str = """\ Thinking step by step: - To add context for future entries, let's outline the main entities in the session above. - In this session, as mentioned in the first message metadata, the user's name is Camille and the assistant's name is JaneBot. - They talk about Elon Musk and the banana tattoo on Camille's arm briefly.""" -entities_example_result = """\ +entities_example_result: str = """\ 1. Camille (The user): Humorous, creative, and enjoys playful banter. 2. JaneBot (The assistant): Engages in lighthearted conversation and tries to guess user's thoughts. 3. Elon Musk: Camille and JaneBot discuss the polarizing tech and space industry figure. 4. Banana Tattoo: Camille has a tattoo of a banana on their arm.""" -entities_instructions = """\ +entities_instructions: str = """\ Your goal is to identify the main entities in the session. Entities should include: - Characters in the conversation: Assistant, User1, User2 - People references or spoken about diff --git a/agents-api/agents_api/rec_sum/summarize.py b/agents-api/agents_api/rec_sum/summarize.py index f98f35094..46a6662a3 100644 --- a/agents-api/agents_api/rec_sum/summarize.py +++ b/agents-api/agents_api/rec_sum/summarize.py @@ -1,4 +1,5 @@ import json +from typing import List from tenacity import retry, stop_after_attempt @@ -10,7 +11,7 @@ ## summarize ## ########## -summarize_example_plan = """\ +summarize_example_plan: str = """\ Planning step by step: - We can replace entries 1,2,3,4 with a summary of those messages. - We can replace entries 5,6,7,8 similarly. @@ -23,7 +24,7 @@ - We can safely summarize message 34's essay into just the salient points only.""" -summarize_instructions = """\ +summarize_instructions: str = """\ Your goal is to compactify the history by coalescing redundant information in messages into their summary in order to reduce its size and save costs. Instructions: @@ -34,7 +35,9 @@ - VERY IMPORTANT: Add the indices of messages that are being summarized so that those messages can then be removed from the session otherwise, there'll be no way to identify which messages to remove. See example for more details.""" -def make_summarize_prompt(session, user="a user", assistant="gpt-4-turbo", **_): +def make_summarize_prompt( + session, user="a user", assistant="gpt-4-turbo", **_ +) -> List[str]: return [ f"You are given a session history of a chat between {user or 'a user'} and {assistant or 'gpt-4-turbo'}. The session is formatted in the ChatML JSON format (from OpenAI).\n\n{summarize_instructions}\n\n\n{json.dumps(add_indices(summarize_example_chat), indent=2)}\n\n\n\n{summarize_example_plan}\n\n\n\n{json.dumps(summarize_example_result, indent=2)}\n", f"Begin! Write the summarized messages as a json list just like the example above. First write your plan inside and then your answer between . Don't forget to add the indices of the messages being summarized alongside each summary.\n\n\n{json.dumps(add_indices(session), indent=2)}\n\n", diff --git a/agents-api/agents_api/rec_sum/trim.py b/agents-api/agents_api/rec_sum/trim.py index 7e902859c..ee4025ea0 100644 --- a/agents-api/agents_api/rec_sum/trim.py +++ b/agents-api/agents_api/rec_sum/trim.py @@ -1,4 +1,5 @@ import json +from typing import List from tenacity import retry, stop_after_attempt @@ -10,7 +11,7 @@ ## Trim ## ########## -trim_example_plan = """\ +trim_example_plan: str = """\ Thinking step by step: - To trim the context, let's examine the messages in the session above. - Messages 1, 2, and 3 are succinct and do not need trimming. @@ -18,7 +19,7 @@ - Message 7 is short enough and doesn't need any edits.""" -trim_instructions = """\ +trim_instructions: str = """\ Your goal is to identify messages in the session that are needlessly verbose and then trim them in length without losing any meaning or changing the tone of the message. Instructions: @@ -32,7 +33,7 @@ # It is important to make keep the tone, setting and flow of the conversation consistent while trimming the messages. -def make_trim_prompt(session, user="a user", assistant="gpt-4-turbo", **_): +def make_trim_prompt(session, user="a user", assistant="gpt-4-turbo", **_) -> List[str]: return [ f"You are given a session history of a chat between {user or 'a user'} and {assistant or 'gpt-4-turbo'}. The session is formatted in the ChatML JSON format (from OpenAI).\n\n{trim_instructions}\n\n\n{json.dumps(add_indices(trim_example_chat), indent=2)}\n\n\n\n{trim_example_plan}\n\n\n\n{json.dumps(trim_example_result, indent=2)}\n", f"Begin! Write the trimmed messages as a json list. First write your plan inside and then your answer between .\n\n\n{json.dumps(add_indices(session), indent=2)}\n\n", diff --git a/agents-api/agents_api/rec_sum/utils.py b/agents-api/agents_api/rec_sum/utils.py index 596174e08..c674a4d44 100644 --- a/agents-api/agents_api/rec_sum/utils.py +++ b/agents-api/agents_api/rec_sum/utils.py @@ -3,9 +3,14 @@ ########### +from typing import Any, Dict, List, TypeVar + +_T2 = TypeVar("_T2") + + class chatml: @staticmethod - def make(content, role="system", name=None, **_): + def make(content, role="system", name: _T2 = None, **_) -> Dict[str, _T2]: return { key: value for key, value in dict(role=role, name=name, content=content).items() @@ -13,39 +18,39 @@ def make(content, role="system", name=None, **_): } @staticmethod - def user(content, name=None): + def user(content, name=None) -> Any: return chatml.make(role="user", content=content, name=name) @staticmethod - def assistant(content, name=None): + def assistant(content, name=None) -> Any: return chatml.make(role="assistant", content=content, name=name) @staticmethod - def system(content, name=None): + def system(content, name=None) -> Any: return chatml.make(content, name=name) @staticmethod - def thought(content, name=None): + def thought(content, name=None) -> Any: return chatml.make(content, name="thought") @staticmethod - def information(content): + def information(content) -> Any: return chatml.system(content, name="information") @staticmethod - def summary(content): + def summary(content) -> Any: return chatml.system(content, name="summary") @staticmethod - def entities(content): + def entities(content) -> Any: return chatml.system(content, name="entity") -def add_indices(list_of_dicts, idx_name="index"): +def add_indices(list_of_dicts, idx_name="index") -> List[dict]: return [{idx_name: i, **msg} for i, msg in enumerate(list_of_dicts)] -def get_names_from_session(session): +def get_names_from_session(session) -> Dict[str, Any]: return { role: next( (msg.get("name", None) for msg in session if msg["role"] == role), None diff --git a/agents-api/agents_api/routers/agents/router.py b/agents-api/agents_api/routers/agents/router.py index af9233c56..6582baa6f 100644 --- a/agents-api/agents_api/routers/agents/router.py +++ b/agents-api/agents_api/routers/agents/router.py @@ -1,3 +1,5 @@ +from typing import Any + from fastapi import APIRouter -router = APIRouter() +router: Any = APIRouter() diff --git a/agents-api/agents_api/routers/docs/router.py b/agents-api/agents_api/routers/docs/router.py index af9233c56..6582baa6f 100644 --- a/agents-api/agents_api/routers/docs/router.py +++ b/agents-api/agents_api/routers/docs/router.py @@ -1,3 +1,5 @@ +from typing import Any + from fastapi import APIRouter -router = APIRouter() +router: Any = APIRouter() diff --git a/agents-api/agents_api/routers/docs/search_docs.py b/agents-api/agents_api/routers/docs/search_docs.py index ad19a3178..f2864164e 100644 --- a/agents-api/agents_api/routers/docs/search_docs.py +++ b/agents-api/agents_api/routers/docs/search_docs.py @@ -1,5 +1,5 @@ import time -from typing import Annotated +from typing import Annotated, Any, Dict, List, Optional, Tuple, Union from fastapi import Depends from pydantic import UUID4 @@ -17,7 +17,11 @@ from .router import router -def get_search_fn_and_params(search_params): +def get_search_fn_and_params( + search_params, +) -> Tuple[ + Any, Optional[Dict[str, Union[float, int, str, Dict[str, float], List[float]]]] +]: search_fn, params = None, None match search_params: diff --git a/agents-api/agents_api/routers/jobs/routers.py b/agents-api/agents_api/routers/jobs/routers.py index 1ec60c2b4..5f7d3ef67 100644 --- a/agents-api/agents_api/routers/jobs/routers.py +++ b/agents-api/agents_api/routers/jobs/routers.py @@ -1,4 +1,4 @@ -from typing import Literal +from typing import Any, Literal from fastapi import APIRouter from pydantic import UUID4 @@ -7,7 +7,7 @@ from agents_api.autogen.openapi_model import JobStatus from agents_api.clients.temporal import get_client -router = APIRouter() +router: Any = APIRouter() def map_job_status( diff --git a/agents-api/agents_api/routers/sessions/exceptions.py b/agents-api/agents_api/routers/sessions/exceptions.py index add4b79cb..b7a5bb971 100644 --- a/agents-api/agents_api/routers/sessions/exceptions.py +++ b/agents-api/agents_api/routers/sessions/exceptions.py @@ -3,7 +3,7 @@ class BaseSessionException(Exception): class InputTooBigError(BaseSessionException): - def __init__(self, actual_tokens, required_tokens): + def __init__(self, actual_tokens, required_tokens) -> None: super().__init__( f"Input is too big, {actual_tokens} tokens provided, but only {required_tokens} tokens are allowed." ) diff --git a/agents-api/agents_api/routers/sessions/router.py b/agents-api/agents_api/routers/sessions/router.py index af9233c56..6582baa6f 100644 --- a/agents-api/agents_api/routers/sessions/router.py +++ b/agents-api/agents_api/routers/sessions/router.py @@ -1,3 +1,5 @@ +from typing import Any + from fastapi import APIRouter -router = APIRouter() +router: Any = APIRouter() diff --git a/agents-api/agents_api/routers/tasks/create_task_execution.py b/agents-api/agents_api/routers/tasks/create_task_execution.py index 988af074f..6202baa93 100644 --- a/agents-api/agents_api/routers/tasks/create_task_execution.py +++ b/agents-api/agents_api/routers/tasks/create_task_execution.py @@ -30,7 +30,7 @@ from ...models.task.get_task import get_task as get_task_query from .router import router -logger = logging.getLogger(__name__) +logger: logging.Logger = logging.getLogger(__name__) logger.setLevel(logging.DEBUG) diff --git a/agents-api/agents_api/routers/tasks/router.py b/agents-api/agents_api/routers/tasks/router.py index af9233c56..6582baa6f 100644 --- a/agents-api/agents_api/routers/tasks/router.py +++ b/agents-api/agents_api/routers/tasks/router.py @@ -1,3 +1,5 @@ +from typing import Any + from fastapi import APIRouter -router = APIRouter() +router: Any = APIRouter() diff --git a/agents-api/agents_api/routers/users/router.py b/agents-api/agents_api/routers/users/router.py index af9233c56..6582baa6f 100644 --- a/agents-api/agents_api/routers/users/router.py +++ b/agents-api/agents_api/routers/users/router.py @@ -1,3 +1,5 @@ +from typing import Any + from fastapi import APIRouter -router = APIRouter() +router: Any = APIRouter() diff --git a/agents-api/agents_api/web.py b/agents-api/agents_api/web.py index 2b85ece5f..2a24dcebb 100644 --- a/agents-api/agents_api/web.py +++ b/agents-api/agents_api/web.py @@ -3,6 +3,7 @@ """ import logging +from typing import Any, Callable import fire import sentry_sdk @@ -37,10 +38,10 @@ ) -logger = logging.getLogger(__name__) +logger: logging.Logger = logging.getLogger(__name__) -def make_exception_handler(status: int): +def make_exception_handler(status: int) -> Callable[[Any, Any], Any]: """ Creates a custom exception handler for the application. @@ -60,7 +61,7 @@ async def _handler(request: Request, exc): return _handler -def register_exceptions(app: FastAPI): +def register_exceptions(app: FastAPI) -> None: """ Registers custom exception handlers for the FastAPI application. @@ -77,7 +78,7 @@ def register_exceptions(app: FastAPI): ) -app = FastAPI(dependencies=[Depends(get_api_key)]) +app: Any = FastAPI(dependencies=[Depends(get_api_key)]) app.add_middleware( CORSMiddleware, @@ -147,7 +148,7 @@ def main( timeout_keep_alive=30, workers=None, log_level="info", -): +) -> None: uvicorn.run( app, host=host, diff --git a/agents-api/agents_api/worker/codec.py b/agents-api/agents_api/worker/codec.py index abf3ddfe5..cdd7e3448 100644 --- a/agents-api/agents_api/worker/codec.py +++ b/agents-api/agents_api/worker/codec.py @@ -19,7 +19,7 @@ from agents_api.common.utils.json import dumps as json_dumps # Map of model name to class so that we can look up the class when deserializing -model_class_map = { +model_class_map: dict = { subclass.__module__ + "." + subclass.__name__: subclass for subclass in { # All the models we want to support @@ -83,7 +83,7 @@ def __init__(self) -> None: # Use the default data converter, but change the payload converter. -pydantic_data_converter = dataclasses.replace( +pydantic_data_converter: Any = dataclasses.replace( temporalio.converter.default(), payload_converter_class=PydanticPayloadConverter, ) diff --git a/agents-api/agents_api/worker/worker.py b/agents-api/agents_api/worker/worker.py index d3821c902..604454c4c 100644 --- a/agents-api/agents_api/worker/worker.py +++ b/agents-api/agents_api/worker/worker.py @@ -1,10 +1,11 @@ from datetime import timedelta +from typing import Any from temporalio.client import Client from temporalio.worker import Worker -def create_worker(client: Client): +def create_worker(client: Client) -> Any: """ Initializes the Temporal client and worker with TLS configuration (if provided), then create a worker to listen for tasks on the configured task queue. @@ -18,9 +19,13 @@ def create_worker(client: Client): from ..activities.task_steps import ( evaluate_step, if_else_step, + log_step, prompt_step, + return_step, + switch_step, tool_call_step, transition_step, + wait_for_input_step, yield_step, ) from ..activities.truncation import truncation @@ -36,12 +41,16 @@ def create_worker(client: Client): from ..workflows.truncation import TruncationWorkflow task_activities = [ - prompt_step, evaluate_step, - yield_step, - tool_call_step, if_else_step, + log_step, + prompt_step, + return_step, + switch_step, + tool_call_step, transition_step, + wait_for_input_step, + yield_step, ] # Initialize the worker with the specified task queue, workflows, and activities diff --git a/agents-api/agents_api/workflows/task_execution.py b/agents-api/agents_api/workflows/task_execution.py index 9fb74c4c0..d2d357cef 100644 --- a/agents-api/agents_api/workflows/task_execution.py +++ b/agents-api/agents_api/workflows/task_execution.py @@ -1,47 +1,57 @@ #!/usr/bin/env python3 +import asyncio from datetime import timedelta +from typing import Any from temporalio import workflow +from temporalio.exceptions import ApplicationError with workflow.unsafe.imports_passed_through(): - from ..activities.task_steps import ( - evaluate_step, - if_else_step, - prompt_step, - tool_call_step, - transition_step, - yield_step, - ) + from ..activities import task_steps from ..autogen.openapi_model import ( CreateTransitionRequest, ErrorWorkflowStep, EvaluateStep, IfElseWorkflowStep, - PromptStep, - ToolCallStep, + LogStep, + # PromptStep, + ReturnStep, + SleepFor, + SleepStep, + SwitchStep, + # ToolCallStep, TransitionTarget, - TransitionType, - # WaitForInputStep, - # WorkflowStep, + WaitForInputStep, + Workflow, YieldStep, ) from ..common.protocol.tasks import ( ExecutionInput, - # OutcomeType, + PendingTransition, StepContext, StepOutcome, - # Workflow, ) + from ..env import testing STEP_TO_ACTIVITY = { - PromptStep: prompt_step, - EvaluateStep: evaluate_step, - ToolCallStep: tool_call_step, - IfElseWorkflowStep: if_else_step, - YieldStep: yield_step, + # PromptStep: prompt_step, + # ToolCallStep: tool_call_step, + WaitForInputStep: task_steps.wait_for_input_step, + LogStep: task_steps.log_step, + SwitchStep: task_steps.switch_step, +} + +# Use few local activities (currently experimental) +STEP_TO_LOCAL_ACTIVITY = { + # NOTE: local activities are directly called in the workflow executor + # They MUST NOT FAIL, otherwise they will crash the workflow + EvaluateStep: task_steps.evaluate_step, + ReturnStep: task_steps.return_step, + YieldStep: task_steps.yield_step, + IfElseWorkflowStep: task_steps.if_else_step, } @@ -53,156 +63,193 @@ async def run( execution_input: ExecutionInput, start: TransitionTarget = TransitionTarget(workflow="main", step=0), previous_inputs: list[dict] = [], - ) -> None: + ) -> Any: + # 0. Prepare context previous_inputs = previous_inputs or [execution_input.arguments] context = StepContext( execution_input=execution_input, inputs=previous_inputs, - current=start, + cursor=start, ) step_type = type(context.current_step) - # 1. First execute the current step's activity if applicable - if activity := STEP_TO_ACTIVITY.get(step_type): - outcome = await workflow.execute_activity( - activity, - context, - schedule_to_close_timeout=timedelta(seconds=600), + # --- + + # 1a. Set global state + # (By default, exit if last otherwise transition 'step' to the next step) + state = PendingTransition( + type="finish" if context.is_last_step else "step", + next=None + if context.is_last_step + else TransitionTarget(workflow=start.workflow, step=start.step + 1), + metadata={"__meta__": {"step_type": step_type.__name__}}, + ) + + # 1b. Prep a transition request + async def transition(**kwargs) -> None: + # NOTE: The state variable is closured from the outer scope + transition_request = CreateTransitionRequest( + current=context.cursor, + **{ + **state.model_dump(exclude_unset=True), + **kwargs, # Override with any additional kwargs + }, ) - # 2. Then, based on the outcome and step type, decide what to do next - # (By default, exit if last otherwise transition 'step' to the next step) - final_output = None - transition_type: TransitionType - next_target: TransitionTarget | None - metadata: dict = {"step_type": step_type.__name__} + await workflow.execute_activity( + task_steps.transition_step, + args=[context, transition_request], + schedule_to_close_timeout=timedelta(seconds=600), + ) - if context.is_last_step: - transition_type = "finish" - next_target = None + # --- + # 2. Execute the current step's activity if applicable + if activity := STEP_TO_ACTIVITY.get(step_type): + execute_activity = workflow.execute_activity + elif activity := STEP_TO_LOCAL_ACTIVITY.get(step_type): + execute_activity = workflow.execute_local_activity else: - transition_type = "step" - next_target = TransitionTarget( - workflow=context.cursor.workflow, step=context.cursor.step + 1 + execute_activity = None + + outcome = None + if execute_activity: + outcome = await execute_activity( + activity, + context, + # + # TODO: This should be a configurable timeout everywhere based on the task + schedule_to_close_timeout=timedelta(seconds=3 if testing else 600), ) - # 3. Orchestrate the step + # --- + + # 3. Then, based on the outcome and step type, decide what to do next match context.current_step, outcome: - case EvaluateStep(), StepOutcome(output=output): - final_output = output - transition_request = CreateTransitionRequest( - type=transition_type, - current=context.cursor, - next=next_target, - output=final_output, - metadata=metadata, + # Handle errors (activity returns None) + case step, StepOutcome(error=error) if error is not None: + raise ApplicationError( + f"{step.__class__.__name__} step threw error: {error}" + ) + + case LogStep(), StepOutcome(output=output): + # Add the logged message to transition history + await transition(output=dict(logged=output)) + + # Set the output to the current input + state.output = context.current_input + + case ReturnStep(), StepOutcome(output=output): + await transition(output=output, type="finish", next=None) + return output # <--- Byeeee! + + case SwitchStep(switch=switch), StepOutcome(output=index) if index >= 0: + raise NotImplementedError("SwitchStep is not implemented") + + case SwitchStep(), StepOutcome(output=index) if index < 0: + # If no case matched, then the output will be -1 + raise NotImplementedError("SwitchStep is not implemented") + + case IfElseWorkflowStep(then=then_branch, else_=else_branch), StepOutcome( + output=condition + ): + # Choose the branch based on the condition + chosen_branch = then_branch if condition else else_branch + + # Create a faux workflow + if_else_wf_name = ( + f"`{context.cursor.workflow}`[{context.cursor.step}].if_else" ) + if_else_wf_name += ".then" if condition else ".else" + + if_else_task = execution_input.task.model_copy() + if_else_task.workflows = [ + Workflow(name=if_else_wf_name, steps=[chosen_branch]) + ] - await workflow.execute_activity( - transition_step, - args=[context, transition_request], - schedule_to_close_timeout=timedelta(seconds=600), + # Create a new execution input + if_else_execution_input = execution_input.model_copy() + if_else_execution_input.task = if_else_task + + # Set the next target to the chosen branch + if_else_next_target = TransitionTarget(workflow=if_else_wf_name, step=0) + + if_else_args = [ + if_else_execution_input, + if_else_next_target, + previous_inputs, + ] + + # Execute the chosen branch and come back here + state.output = await workflow.execute_child_workflow( + TaskExecutionWorkflow.run, + args=if_else_args, ) - case ErrorWorkflowStep(error=error), _: - final_output = dict(error=error) - transition_type = "error" - transition_request = CreateTransitionRequest( - type=transition_type, - current=context.cursor, - next=None, - output=final_output, - metadata=metadata, + case SleepStep( + sleep=SleepFor( + seconds=seconds, + minutes=minutes, + hours=hours, + days=days, ) + ), _: + seconds = seconds + minutes * 60 + hours * 60 * 60 + days * 24 * 60 * 60 + assert seconds > 0, "Sleep duration must be greater than 0" - await workflow.execute_activity( - transition_step, - args=[context, transition_request], - schedule_to_close_timeout=timedelta(seconds=600), + state.output = await asyncio.sleep( + seconds, result=context.current_input ) - raise Exception(f"Error raised by ErrorWorkflowStep: {error}") + await transition() + + case EvaluateStep(), StepOutcome(output=output): + state.output = output + await transition() + + case ErrorWorkflowStep(error=error), _: + state.output = dict(error=error) + state.type = "error" + await transition() + + raise ApplicationError(f"Error raised by ErrorWorkflowStep: {error}") case YieldStep(), StepOutcome( - output=output, transition_to=(transition_type, next) + output=output, transition_to=(yield_transition_type, yield_next_target) ): - final_output = output - transition_request = CreateTransitionRequest( - type=transition_type, - current=context.cursor, - next=next, - output=final_output, - metadata=metadata, + await transition( + output=output, type=yield_transition_type, next=yield_next_target ) - await workflow.execute_activity( - transition_step, - args=[context, transition_request], - schedule_to_close_timeout=timedelta(seconds=600), - ) - - yield_outcome: StepOutcome = await workflow.execute_child_workflow( + state.output = await workflow.execute_child_workflow( TaskExecutionWorkflow.run, - args=[execution_input, next, [output]], + args=[execution_input, yield_next_target, [output]], ) - final_output = yield_outcome.output + case WaitForInputStep(), StepOutcome(output=output): + await transition(output=output, type="wait", next=None) + + state.type = "resume" + state.output = await execute_activity( + task_steps.raise_complete_async, + schedule_to_close_timeout=timedelta(days=31), + ) case _: - raise NotImplementedError() + raise ApplicationError("Not implemented") + + # --- # 4. Closing # End if the last step - if transition_type in ("finish", "cancelled"): - return final_output + if state.type in ("finish", "cancelled"): + return state.output # Otherwise, recurse to the next step + # TODO: Should use a continue_as_new workflow ONLY if the next step is a conditional or loop + # Otherwise, we should just call the next step as a child workflow workflow.continue_as_new( - execution_input, next_target, previous_inputs + [final_output] + args=[execution_input, state.next, previous_inputs + [state.output]] ) - - ################## - - # should_wait, is_error = False, False - # # Run the step - # match step: - # case PromptStep(): - # outputs = await workflow.execute_activity( - # prompt_step, - # context, - # schedule_to_close_timeout=timedelta(seconds=600), - # ) - # - # # TODO: ChatCompletion does not have tool_calls - # # if outputs.tool_calls is not None: - # # should_wait = True - - # case ToolCallStep(): - # outputs = await workflow.execute_activity( - # tool_call_step, - # context, - # schedule_to_close_timeout=timedelta(seconds=600), - # ) - - # case IfElseWorkflowStep(): - # outputs = await workflow.execute_activity( - # if_else_step, - # context, - # schedule_to_close_timeout=timedelta(seconds=600), - # ) - # workflow_step = YieldStep(**outputs["goto_workflow"]) - # - # outputs = await workflow.execute_child_workflow( - # TaskExecutionWorkflow.run, - # args=[ - # execution_input, - # (workflow_step.workflow, 0), - # previous_inputs, - # ], - # ) - - # case WaitForInputStep(): - # should_wait = True diff --git a/agents-api/poetry.lock b/agents-api/poetry.lock index aaaada66e..d22f8beec 100644 --- a/agents-api/poetry.lock +++ b/agents-api/poetry.lock @@ -2,98 +2,98 @@ [[package]] name = "aiohappyeyeballs" -version = "2.3.5" +version = "2.3.7" description = "Happy Eyeballs for asyncio" optional = false python-versions = ">=3.8" files = [ - {file = "aiohappyeyeballs-2.3.5-py3-none-any.whl", hash = "sha256:4d6dea59215537dbc746e93e779caea8178c866856a721c9c660d7a5a7b8be03"}, - {file = "aiohappyeyeballs-2.3.5.tar.gz", hash = "sha256:6fa48b9f1317254f122a07a131a86b71ca6946ca989ce6326fff54a99a920105"}, + {file = "aiohappyeyeballs-2.3.7-py3-none-any.whl", hash = "sha256:337ce4dc0e99eb697c3c5a77d6cb3c52925824d9a67ac0dea7c55b8a2d60b222"}, + {file = "aiohappyeyeballs-2.3.7.tar.gz", hash = "sha256:e794cd29ba6a14078092984e43688212a19081de3a73b6796c2fdeb3706dd6ce"}, ] [[package]] name = "aiohttp" -version = "3.10.3" +version = "3.10.4" description = "Async http client/server framework (asyncio)" optional = false python-versions = ">=3.8" files = [ - {file = "aiohttp-3.10.3-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:cc36cbdedf6f259371dbbbcaae5bb0e95b879bc501668ab6306af867577eb5db"}, - {file = "aiohttp-3.10.3-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:85466b5a695c2a7db13eb2c200af552d13e6a9313d7fa92e4ffe04a2c0ea74c1"}, - {file = "aiohttp-3.10.3-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:71bb1d97bfe7e6726267cea169fdf5df7658831bb68ec02c9c6b9f3511e108bb"}, - {file = "aiohttp-3.10.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:baec1eb274f78b2de54471fc4c69ecbea4275965eab4b556ef7a7698dee18bf2"}, - {file = "aiohttp-3.10.3-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:13031e7ec1188274bad243255c328cc3019e36a5a907978501256000d57a7201"}, - {file = "aiohttp-3.10.3-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2bbc55a964b8eecb341e492ae91c3bd0848324d313e1e71a27e3d96e6ee7e8e8"}, - {file = "aiohttp-3.10.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e8cc0564b286b625e673a2615ede60a1704d0cbbf1b24604e28c31ed37dc62aa"}, - {file = "aiohttp-3.10.3-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f817a54059a4cfbc385a7f51696359c642088710e731e8df80d0607193ed2b73"}, - {file = "aiohttp-3.10.3-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:8542c9e5bcb2bd3115acdf5adc41cda394e7360916197805e7e32b93d821ef93"}, - {file = "aiohttp-3.10.3-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:671efce3a4a0281060edf9a07a2f7e6230dca3a1cbc61d110eee7753d28405f7"}, - {file = "aiohttp-3.10.3-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:0974f3b5b0132edcec92c3306f858ad4356a63d26b18021d859c9927616ebf27"}, - {file = "aiohttp-3.10.3-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:44bb159b55926b57812dca1b21c34528e800963ffe130d08b049b2d6b994ada7"}, - {file = "aiohttp-3.10.3-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:6ae9ae382d1c9617a91647575255ad55a48bfdde34cc2185dd558ce476bf16e9"}, - {file = "aiohttp-3.10.3-cp310-cp310-win32.whl", hash = "sha256:aed12a54d4e1ee647376fa541e1b7621505001f9f939debf51397b9329fd88b9"}, - {file = "aiohttp-3.10.3-cp310-cp310-win_amd64.whl", hash = "sha256:b51aef59370baf7444de1572f7830f59ddbabd04e5292fa4218d02f085f8d299"}, - {file = "aiohttp-3.10.3-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:e021c4c778644e8cdc09487d65564265e6b149896a17d7c0f52e9a088cc44e1b"}, - {file = "aiohttp-3.10.3-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:24fade6dae446b183e2410a8628b80df9b7a42205c6bfc2eff783cbeedc224a2"}, - {file = "aiohttp-3.10.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:bc8e9f15939dacb0e1f2d15f9c41b786051c10472c7a926f5771e99b49a5957f"}, - {file = "aiohttp-3.10.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d5a9ec959b5381271c8ec9310aae1713b2aec29efa32e232e5ef7dcca0df0279"}, - {file = "aiohttp-3.10.3-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2a5d0ea8a6467b15d53b00c4e8ea8811e47c3cc1bdbc62b1aceb3076403d551f"}, - {file = "aiohttp-3.10.3-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c9ed607dbbdd0d4d39b597e5bf6b0d40d844dfb0ac6a123ed79042ef08c1f87e"}, - {file = "aiohttp-3.10.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d3e66d5b506832e56add66af88c288c1d5ba0c38b535a1a59e436b300b57b23e"}, - {file = "aiohttp-3.10.3-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:fda91ad797e4914cca0afa8b6cccd5d2b3569ccc88731be202f6adce39503189"}, - {file = "aiohttp-3.10.3-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:61ccb867b2f2f53df6598eb2a93329b5eee0b00646ee79ea67d68844747a418e"}, - {file = "aiohttp-3.10.3-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:6d881353264e6156f215b3cb778c9ac3184f5465c2ece5e6fce82e68946868ef"}, - {file = "aiohttp-3.10.3-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:b031ce229114825f49cec4434fa844ccb5225e266c3e146cb4bdd025a6da52f1"}, - {file = "aiohttp-3.10.3-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:5337cc742a03f9e3213b097abff8781f79de7190bbfaa987bd2b7ceb5bb0bdec"}, - {file = "aiohttp-3.10.3-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:ab3361159fd3dcd0e48bbe804006d5cfb074b382666e6c064112056eb234f1a9"}, - {file = "aiohttp-3.10.3-cp311-cp311-win32.whl", hash = "sha256:05d66203a530209cbe40f102ebaac0b2214aba2a33c075d0bf825987c36f1f0b"}, - {file = "aiohttp-3.10.3-cp311-cp311-win_amd64.whl", hash = "sha256:70b4a4984a70a2322b70e088d654528129783ac1ebbf7dd76627b3bd22db2f17"}, - {file = "aiohttp-3.10.3-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:166de65e2e4e63357cfa8417cf952a519ac42f1654cb2d43ed76899e2319b1ee"}, - {file = "aiohttp-3.10.3-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:7084876352ba3833d5d214e02b32d794e3fd9cf21fdba99cff5acabeb90d9806"}, - {file = "aiohttp-3.10.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:8d98c604c93403288591d7d6d7d6cc8a63459168f8846aeffd5b3a7f3b3e5e09"}, - {file = "aiohttp-3.10.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d73b073a25a0bb8bf014345374fe2d0f63681ab5da4c22f9d2025ca3e3ea54fc"}, - {file = "aiohttp-3.10.3-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8da6b48c20ce78f5721068f383e0e113dde034e868f1b2f5ee7cb1e95f91db57"}, - {file = "aiohttp-3.10.3-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3a9dcdccf50284b1b0dc72bc57e5bbd3cc9bf019060dfa0668f63241ccc16aa7"}, - {file = "aiohttp-3.10.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:56fb94bae2be58f68d000d046172d8b8e6b1b571eb02ceee5535e9633dcd559c"}, - {file = "aiohttp-3.10.3-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:bf75716377aad2c718cdf66451c5cf02042085d84522aec1f9246d3e4b8641a6"}, - {file = "aiohttp-3.10.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:6c51ed03e19c885c8e91f574e4bbe7381793f56f93229731597e4a499ffef2a5"}, - {file = "aiohttp-3.10.3-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:b84857b66fa6510a163bb083c1199d1ee091a40163cfcbbd0642495fed096204"}, - {file = "aiohttp-3.10.3-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:c124b9206b1befe0491f48185fd30a0dd51b0f4e0e7e43ac1236066215aff272"}, - {file = "aiohttp-3.10.3-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:3461d9294941937f07bbbaa6227ba799bc71cc3b22c40222568dc1cca5118f68"}, - {file = "aiohttp-3.10.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:08bd0754d257b2db27d6bab208c74601df6f21bfe4cb2ec7b258ba691aac64b3"}, - {file = "aiohttp-3.10.3-cp312-cp312-win32.whl", hash = "sha256:7f9159ae530297f61a00116771e57516f89a3de6ba33f314402e41560872b50a"}, - {file = "aiohttp-3.10.3-cp312-cp312-win_amd64.whl", hash = "sha256:e1128c5d3a466279cb23c4aa32a0f6cb0e7d2961e74e9e421f90e74f75ec1edf"}, - {file = "aiohttp-3.10.3-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:d1100e68e70eb72eadba2b932b185ebf0f28fd2f0dbfe576cfa9d9894ef49752"}, - {file = "aiohttp-3.10.3-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:a541414578ff47c0a9b0b8b77381ea86b0c8531ab37fc587572cb662ccd80b88"}, - {file = "aiohttp-3.10.3-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:d5548444ef60bf4c7b19ace21f032fa42d822e516a6940d36579f7bfa8513f9c"}, - {file = "aiohttp-3.10.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5ba2e838b5e6a8755ac8297275c9460e729dc1522b6454aee1766c6de6d56e5e"}, - {file = "aiohttp-3.10.3-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:48665433bb59144aaf502c324694bec25867eb6630fcd831f7a893ca473fcde4"}, - {file = "aiohttp-3.10.3-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:bac352fceed158620ce2d701ad39d4c1c76d114255a7c530e057e2b9f55bdf9f"}, - {file = "aiohttp-3.10.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2b0f670502100cdc567188c49415bebba947eb3edaa2028e1a50dd81bd13363f"}, - {file = "aiohttp-3.10.3-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:43b09f38a67679e32d380fe512189ccb0b25e15afc79b23fbd5b5e48e4fc8fd9"}, - {file = "aiohttp-3.10.3-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:cd788602e239ace64f257d1c9d39898ca65525583f0fbf0988bcba19418fe93f"}, - {file = "aiohttp-3.10.3-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:214277dcb07ab3875f17ee1c777d446dcce75bea85846849cc9d139ab8f5081f"}, - {file = "aiohttp-3.10.3-cp38-cp38-musllinux_1_2_ppc64le.whl", hash = "sha256:32007fdcaab789689c2ecaaf4b71f8e37bf012a15cd02c0a9db8c4d0e7989fa8"}, - {file = "aiohttp-3.10.3-cp38-cp38-musllinux_1_2_s390x.whl", hash = "sha256:123e5819bfe1b87204575515cf448ab3bf1489cdeb3b61012bde716cda5853e7"}, - {file = "aiohttp-3.10.3-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:812121a201f0c02491a5db335a737b4113151926a79ae9ed1a9f41ea225c0e3f"}, - {file = "aiohttp-3.10.3-cp38-cp38-win32.whl", hash = "sha256:b97dc9a17a59f350c0caa453a3cb35671a2ffa3a29a6ef3568b523b9113d84e5"}, - {file = "aiohttp-3.10.3-cp38-cp38-win_amd64.whl", hash = "sha256:3731a73ddc26969d65f90471c635abd4e1546a25299b687e654ea6d2fc052394"}, - {file = "aiohttp-3.10.3-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:38d91b98b4320ffe66efa56cb0f614a05af53b675ce1b8607cdb2ac826a8d58e"}, - {file = "aiohttp-3.10.3-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:9743fa34a10a36ddd448bba8a3adc2a66a1c575c3c2940301bacd6cc896c6bf1"}, - {file = "aiohttp-3.10.3-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:7c126f532caf238031c19d169cfae3c6a59129452c990a6e84d6e7b198a001dc"}, - {file = "aiohttp-3.10.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:926e68438f05703e500b06fe7148ef3013dd6f276de65c68558fa9974eeb59ad"}, - {file = "aiohttp-3.10.3-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:434b3ab75833accd0b931d11874e206e816f6e6626fd69f643d6a8269cd9166a"}, - {file = "aiohttp-3.10.3-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d35235a44ec38109b811c3600d15d8383297a8fab8e3dec6147477ec8636712a"}, - {file = "aiohttp-3.10.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:59c489661edbd863edb30a8bd69ecb044bd381d1818022bc698ba1b6f80e5dd1"}, - {file = "aiohttp-3.10.3-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:50544fe498c81cb98912afabfc4e4d9d85e89f86238348e3712f7ca6a2f01dab"}, - {file = "aiohttp-3.10.3-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:09bc79275737d4dc066e0ae2951866bb36d9c6b460cb7564f111cc0427f14844"}, - {file = "aiohttp-3.10.3-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:af4dbec58e37f5afff4f91cdf235e8e4b0bd0127a2a4fd1040e2cad3369d2f06"}, - {file = "aiohttp-3.10.3-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:b22cae3c9dd55a6b4c48c63081d31c00fc11fa9db1a20c8a50ee38c1a29539d2"}, - {file = "aiohttp-3.10.3-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:ba562736d3fbfe9241dad46c1a8994478d4a0e50796d80e29d50cabe8fbfcc3f"}, - {file = "aiohttp-3.10.3-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:f25d6c4e82d7489be84f2b1c8212fafc021b3731abdb61a563c90e37cced3a21"}, - {file = "aiohttp-3.10.3-cp39-cp39-win32.whl", hash = "sha256:b69d832e5f5fa15b1b6b2c8eb6a9fd2c0ec1fd7729cb4322ed27771afc9fc2ac"}, - {file = "aiohttp-3.10.3-cp39-cp39-win_amd64.whl", hash = "sha256:673bb6e3249dc8825df1105f6ef74e2eab779b7ff78e96c15cadb78b04a83752"}, - {file = "aiohttp-3.10.3.tar.gz", hash = "sha256:21650e7032cc2d31fc23d353d7123e771354f2a3d5b05a5647fc30fea214e696"}, + {file = "aiohttp-3.10.4-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:81037ddda8cc0a95c6d8c1b9029d0b19a62db8770c0e239e3bea0109d294ab66"}, + {file = "aiohttp-3.10.4-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:71944d4f4090afc07ce96b7029d5a574240e2f39570450df4af0d5b93a5ee64a"}, + {file = "aiohttp-3.10.4-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:c774f08afecc0a617966f45a9c378456e713a999ee60654d9727617def3e4ee4"}, + {file = "aiohttp-3.10.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dc990e73613c78ab2930b60266135066f37fdfce6b32dd604f42c5c377ee880a"}, + {file = "aiohttp-3.10.4-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f6acd1a908740f708358d240f9a3243cec31a456e3ded65c2cb46f6043bc6735"}, + {file = "aiohttp-3.10.4-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:6075e27e7e54fbcd1c129c5699b2d251c885c9892e26d59a0fb7705141c2d14b"}, + {file = "aiohttp-3.10.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fc98d93d11d860ac823beb6131f292d82efb76f226b5e28a3eab1ec578dfd041"}, + {file = "aiohttp-3.10.4-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:201ddf1471567568be381b6d4701e266a768f7eaa2f99ef753f2c9c5e1e3fb5c"}, + {file = "aiohttp-3.10.4-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:7d202ec55e61f06b1a1eaf317fba7546855cbf803c13ce7625d462fb8c88e238"}, + {file = "aiohttp-3.10.4-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:96b2e7c110a941c8c1a692703b8ac1013e47f17ee03356c71d55c0a54de2ce38"}, + {file = "aiohttp-3.10.4-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:8ba0fbc56c44883bd757ece433f9caadbca67f565934afe9bc53ba3bd99cc368"}, + {file = "aiohttp-3.10.4-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:46cc9069da466652bb7b8b3fac1f8ce2e12a9dc0fb11551faa420c4cdbc60abf"}, + {file = "aiohttp-3.10.4-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:93a19cd1e9dc703257fda78b8e889c3a08eabaa09f6ff0d867850b03964f80d1"}, + {file = "aiohttp-3.10.4-cp310-cp310-win32.whl", hash = "sha256:8593040bcc8075fc0e817a602bc5d3d74c7bd717619ffc175a8ba0188edebadf"}, + {file = "aiohttp-3.10.4-cp310-cp310-win_amd64.whl", hash = "sha256:326fb5228aadfc395981d9b336d56a698da335897c4143105c73b583d7500839"}, + {file = "aiohttp-3.10.4-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:dfe48f477e02ef5ab247c6ac431a6109c69b5c24cb3ccbcd3e27c4fb39691fe4"}, + {file = "aiohttp-3.10.4-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:f6fe78b51852e25d4e20be51ef88c2a0bf31432b9f2223bdbd61c01a0f9253a7"}, + {file = "aiohttp-3.10.4-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:5cc75ff5efbd92301e63a157fddb18a6964a3f40e31c77d57e97dbb9bb3373b4"}, + {file = "aiohttp-3.10.4-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dca39391f45fbb28daa6412f98c625265bf6b512cc41382df61672d1b242f8f4"}, + {file = "aiohttp-3.10.4-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8616dd5ed8b3b4029021b560305041c62e080bb28f238c27c2e150abe3539587"}, + {file = "aiohttp-3.10.4-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9d7958ba22854b3f00a7bbb66cde1dc759760ce8a3e6dfe9ea53f06bccaa9aa2"}, + {file = "aiohttp-3.10.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8a24ac7164a824ef2e8e4e9a9f6debb1f43c44ad7ad04efc6018a6610555666d"}, + {file = "aiohttp-3.10.4-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:660ad010b8fd0b26e8edb8ae5c036db5b16baac4278198ad238b11956d920b3d"}, + {file = "aiohttp-3.10.4-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:93ee83008d3e505db9846a5a1f48a002676d8dcc90ee431a9462541c9b81393c"}, + {file = "aiohttp-3.10.4-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:77071795efd6ba87f409001141fb05c94ee962b9fca6c8fa1f735c2718512de4"}, + {file = "aiohttp-3.10.4-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:ff371ae72a1816c3eeba5c9cff42cb739aaa293fec7d78f180d1c7ee342285b6"}, + {file = "aiohttp-3.10.4-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:c253e81f12da97f85d45441e8c6da0d9c12e07db4a7136b0a955df6fc5e4bf51"}, + {file = "aiohttp-3.10.4-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:2ce101c447cf7ba4b6e5ab07bfa2c0da21cbab66922f78a601f0b84fd7710d72"}, + {file = "aiohttp-3.10.4-cp311-cp311-win32.whl", hash = "sha256:705c311ecf2d30fbcf3570d1a037c657be99095694223488140c47dee4ef2460"}, + {file = "aiohttp-3.10.4-cp311-cp311-win_amd64.whl", hash = "sha256:ebddbfea8a8d6b97f717658fa85a96681a28990072710d3de3a4eba5d6804a37"}, + {file = "aiohttp-3.10.4-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:fe4d63f42d9c604521b208b754abfafe01218af4a8f6332b43196ee8fe88bbd5"}, + {file = "aiohttp-3.10.4-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:fef7b7bd3a6911b4d148332136d34d3c2aee3d54d354373b1da6d96bc08089a5"}, + {file = "aiohttp-3.10.4-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:fff8606149098935188fe1e135f7e7991e6a36d6fe394fd15939fc57d0aff889"}, + {file = "aiohttp-3.10.4-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9eb3df1aa83602be9a5e572c834d74c3c8e382208b59a873aabfe4c493c45ed0"}, + {file = "aiohttp-3.10.4-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5c4a71d4a5e0cbfd4bfadd13cb84fe2bc76c64d550dc4f22c22008c9354cffb3"}, + {file = "aiohttp-3.10.4-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:bf61884a604c399458c4a42c8caea000fbcc44255ed89577ff50cb688a0fe8e2"}, + {file = "aiohttp-3.10.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2015e4b40bd5dedc8155c2b2d24a2b07963ae02b5772373d0b599a68e38a316b"}, + {file = "aiohttp-3.10.4-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b06e1a66bf0a1a2d0f12aef25843dfd2093df080d6c1acbc43914bb9c8f36ed3"}, + {file = "aiohttp-3.10.4-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:eb898c9ad5a1228a669ebe2e2ba3d76aebe1f7c10b78f09a36000254f049fc2b"}, + {file = "aiohttp-3.10.4-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:2d64a5a7539320c3cecb4bca093ea825fcc906f8461cf8b42a7bf3c706ce1932"}, + {file = "aiohttp-3.10.4-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:438c6e1492d060b21285f4b6675b941cf96dd9ef3dfdd59940561029b82e3e1f"}, + {file = "aiohttp-3.10.4-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:e99bf118afb2584848dba169a685fe092b338a4fe52ae08c7243d7bc4cc204fe"}, + {file = "aiohttp-3.10.4-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:9dc26781fb95225c6170619dece8b5c6ca7cfb1b0be97b7ee719915773d0c2a9"}, + {file = "aiohttp-3.10.4-cp312-cp312-win32.whl", hash = "sha256:45bb655cb8b3a61e19977183a4e0962051ae90f6d46588ed4addb8232128141c"}, + {file = "aiohttp-3.10.4-cp312-cp312-win_amd64.whl", hash = "sha256:347bbdc48411badc24fe3a13565820bc742db3aa2f9127cd5f48c256caf87e29"}, + {file = "aiohttp-3.10.4-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:4ad284cee0fdcdc0216346b849fd53d201b510aff3c48aa3622daec9ada4bf80"}, + {file = "aiohttp-3.10.4-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:58df59234be7d7e80548b9482ebfeafdda21948c25cb2873c7f23870c8053dfe"}, + {file = "aiohttp-3.10.4-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:5f52225af7f91f27b633f73473e9ef0aa8e2112d57b69eaf3aa4479e3ea3bc0e"}, + {file = "aiohttp-3.10.4-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:93f1a0e12c321d923c024b56d7dcd8012e60bf30a4b3fb69a88be15dcb9ab80b"}, + {file = "aiohttp-3.10.4-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c9e9e9a51dd12f2f71fdbd7f7230dcb75ed8f77d8ac8e07c73b599b6d7027e5c"}, + {file = "aiohttp-3.10.4-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:38bb515f1affc36d3d97b02bf82099925a5785c4a96066ff4400a83ad09d3d5d"}, + {file = "aiohttp-3.10.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2e685afb0e3b7b861d89cb3690d89eeda221b43095352efddaaa735c6baf87f3"}, + {file = "aiohttp-3.10.4-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:abd5673e3391564871ba6753cf674dcf2051ef19dc508998fe0758a6c7b429a0"}, + {file = "aiohttp-3.10.4-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:4b34e5086e1ead3baa740e32adf35cc5e42338e44c4b07f7b62b41ca6d6a5bfd"}, + {file = "aiohttp-3.10.4-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:c3fd3b8f0164fb2866400cd6eb9e884ab0dc95f882cf8b25e560ace7350c552d"}, + {file = "aiohttp-3.10.4-cp38-cp38-musllinux_1_2_ppc64le.whl", hash = "sha256:b95e1694d234f27b4bbf5bdef56bb751974ac5dbe045b1e462bde1fe39421cbe"}, + {file = "aiohttp-3.10.4-cp38-cp38-musllinux_1_2_s390x.whl", hash = "sha256:c031de4dfabe7bb6565743745ab43d20588944ddfc7233360169cab4008eee2f"}, + {file = "aiohttp-3.10.4-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:03c5a3143d4a82c43a3d82ac77d9cdef527a72f1c04dcca7b14770879f33d196"}, + {file = "aiohttp-3.10.4-cp38-cp38-win32.whl", hash = "sha256:b71722b527445e02168e2d1cf435772731874671a647fa159ad000feea7933b6"}, + {file = "aiohttp-3.10.4-cp38-cp38-win_amd64.whl", hash = "sha256:0fd1f57aac7d01c9c768675d531976d20d5b79d9da67fac87e55d41b4ade05f9"}, + {file = "aiohttp-3.10.4-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:15b36a644d1f44ea3d94a0bbb71e75d5f394a3135dc388a209466e22b711ce64"}, + {file = "aiohttp-3.10.4-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:394ddf9d216cf0bd429b223239a0ab628f01a7a1799c93ce4685eedcdd51b9bc"}, + {file = "aiohttp-3.10.4-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:dd33f4d571b4143fc9318c3d9256423579c7d183635acc458a6db81919ae5204"}, + {file = "aiohttp-3.10.4-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e5991b80886655e6c785aadf3114d4f86e6bec2da436e2bb62892b9f048450a4"}, + {file = "aiohttp-3.10.4-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:92021bf0a4b9ad16851a6c1ca3c86e5b09aecca4f7a2576430c6bbf3114922b1"}, + {file = "aiohttp-3.10.4-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:938e37fd337343c67471098736deb33066d72cec7d8927b9c1b6b4ea807ade9e"}, + {file = "aiohttp-3.10.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1d697023b16c62f9aeb3ffdfb8ec4ac3afd477388993b9164b47dadbd60e7062"}, + {file = "aiohttp-3.10.4-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c2f9f07fe6d0d51bd2a788cbb339f1570fd691449c53b5dec83ff838f117703e"}, + {file = "aiohttp-3.10.4-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:50ac670f3fc13ce95e4d6d5a299db9288cc84c663aa630142444ef504756fcf7"}, + {file = "aiohttp-3.10.4-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:9bcdd19398212785a9cb82a63a4b75a299998343f3f5732dfd37c1a4275463f9"}, + {file = "aiohttp-3.10.4-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:122c26f0976225aba46f381e3cabb5ef89a08af6503fc30493fb732e578cfa55"}, + {file = "aiohttp-3.10.4-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:d0665e2a346b6b66959f831ffffd8aa71dd07dd2300017d478f5b47573e66cfe"}, + {file = "aiohttp-3.10.4-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:625a4a9d4b9f80e7bbaaf2ace06341cf701b2fee54232843addf0bb7304597fb"}, + {file = "aiohttp-3.10.4-cp39-cp39-win32.whl", hash = "sha256:5115490112f39f16ae87c1b34dff3e2c95306cf456b1d2af5974c4ac7d2d1ec7"}, + {file = "aiohttp-3.10.4-cp39-cp39-win_amd64.whl", hash = "sha256:9b58b2ef7f28a2462ba86acbf3b20371bd80a1faa1cfd82f31968af4ac81ef25"}, + {file = "aiohttp-3.10.4.tar.gz", hash = "sha256:23a5f97e7dd22e181967fb6cb6c3b11653b0fdbbc4bb7739d9b6052890ccab96"}, ] [package.dependencies] @@ -121,24 +121,6 @@ files = [ [package.dependencies] frozenlist = ">=1.1.0" -[[package]] -name = "aiosqlite" -version = "0.20.0" -description = "asyncio bridge to the standard sqlite3 module" -optional = false -python-versions = ">=3.8" -files = [ - {file = "aiosqlite-0.20.0-py3-none-any.whl", hash = "sha256:36a1deaca0cac40ebe32aac9977a6e2bbc7f5189f23f4a54d5908986729e5bd6"}, - {file = "aiosqlite-0.20.0.tar.gz", hash = "sha256:6d35c8c256637f4672f843c31021464090805bf925385ac39473fb16eaaca3d7"}, -] - -[package.dependencies] -typing_extensions = ">=4.0" - -[package.extras] -dev = ["attribution (==1.7.0)", "black (==24.2.0)", "coverage[toml] (==7.4.1)", "flake8 (==7.0.0)", "flake8-bugbear (==24.2.6)", "flit (==3.9.0)", "mypy (==1.8.0)", "ufmt (==2.3.0)", "usort (==1.0.8.post1)"] -docs = ["sphinx (==7.2.6)", "sphinx-mdinclude (==0.5.3)"] - [[package]] name = "annotated-types" version = "0.7.0" @@ -670,17 +652,6 @@ click = "*" [package.extras] test = ["pytest"] -[[package]] -name = "cloudpickle" -version = "3.0.0" -description = "Pickler class to extend the standard pickle.Pickler functionality" -optional = false -python-versions = ">=3.8" -files = [ - {file = "cloudpickle-3.0.0-py3-none-any.whl", hash = "sha256:246ee7d0c295602a036e86369c77fecda4ab17b506496730f2f576d9016fd9c7"}, - {file = "cloudpickle-3.0.0.tar.gz", hash = "sha256:996d9a482c6fb4f33c1a35335cf8afd065d2a56e973270364840712d9131a882"}, -] - [[package]] name = "colorama" version = "0.4.6" @@ -757,51 +728,6 @@ files = [ [package.extras] develop = ["coverage", "invoke", "path.py", "pylint", "pytest (>=3.2)", "pytest-html (>=1.19.0)", "tox (>=2.9)"] -[[package]] -name = "dask" -version = "2024.8.0" -description = "Parallel PyData with Task Scheduling" -optional = false -python-versions = ">=3.9" -files = [ - {file = "dask-2024.8.0-py3-none-any.whl", hash = "sha256:250ea3df30d4a25958290eec4f252850091c6cfaed82d098179c3b25bba18309"}, - {file = "dask-2024.8.0.tar.gz", hash = "sha256:f1fec39373d2f101bc045529ad4e9b30e34e6eb33b7aa0fa7073aec7b1bf9eee"}, -] - -[package.dependencies] -click = ">=8.1" -cloudpickle = ">=1.5.0" -distributed = {version = "2024.8.0", optional = true, markers = "extra == \"distributed\""} -fsspec = ">=2021.09.0" -importlib-metadata = {version = ">=4.13.0", markers = "python_version < \"3.12\""} -packaging = ">=20.0" -partd = ">=1.4.0" -pyyaml = ">=5.3.1" -toolz = ">=0.10.0" - -[package.extras] -array = ["numpy (>=1.21)"] -complete = ["dask[array,dataframe,diagnostics,distributed]", "lz4 (>=4.3.2)", "pyarrow (>=7.0)", "pyarrow-hotfix"] -dataframe = ["dask-expr (>=1.1,<1.2)", "dask[array]", "pandas (>=2.0)"] -diagnostics = ["bokeh (>=2.4.2)", "jinja2 (>=2.10.3)"] -distributed = ["distributed (==2024.8.0)"] -test = ["pandas[test]", "pre-commit", "pytest", "pytest-cov", "pytest-rerunfailures", "pytest-timeout", "pytest-xdist"] - -[[package]] -name = "dataclasses-json" -version = "0.6.7" -description = "Easily serialize dataclasses to and from JSON." -optional = false -python-versions = "<4.0,>=3.7" -files = [ - {file = "dataclasses_json-0.6.7-py3-none-any.whl", hash = "sha256:0dbf33f26c8d5305befd61b39d2b3414e8a407bedc2834dea9b8d642666fb40a"}, - {file = "dataclasses_json-0.6.7.tar.gz", hash = "sha256:b6b3e528266ea45b9535223bc53ca645f5208833c29229e847b3f26a1cc55fc0"}, -] - -[package.dependencies] -marshmallow = ">=3.18.0,<4.0.0" -typing-inspect = ">=0.4.0,<1" - [[package]] name = "datamodel-code-generator" version = "0.25.9" @@ -872,17 +798,6 @@ files = [ {file = "decorator-5.1.1.tar.gz", hash = "sha256:637996211036b6385ef91435e4fae22989472f9d571faba8927ba8253acbc330"}, ] -[[package]] -name = "deepmerge" -version = "1.1.1" -description = "a toolset to deeply merge python dictionaries." -optional = false -python-versions = "*" -files = [ - {file = "deepmerge-1.1.1-py3-none-any.whl", hash = "sha256:7219dad9763f15be9dcd4bcb53e00f48e4eed6f5ed8f15824223eb934bb35977"}, - {file = "deepmerge-1.1.1.tar.gz", hash = "sha256:53a489dc9449636e480a784359ae2aab3191748c920649551c8e378622f0eca4"}, -] - [[package]] name = "defusedxml" version = "0.7.1" @@ -894,34 +809,6 @@ files = [ {file = "defusedxml-0.7.1.tar.gz", hash = "sha256:1bb3032db185915b62d7c6209c5a8792be6a32ab2fedacc84e01b52c51aa3e69"}, ] -[[package]] -name = "distributed" -version = "2024.8.0" -description = "Distributed scheduler for Dask" -optional = false -python-versions = ">=3.9" -files = [ - {file = "distributed-2024.8.0-py3-none-any.whl", hash = "sha256:11af55d22dd6e04eb868b87f166b8f59ef1b300f659f87c016643b7f98280ec6"}, - {file = "distributed-2024.8.0.tar.gz", hash = "sha256:b99caf0a7f257f59477a70a334e081c1241f7cd9860211cc669742e6450e1310"}, -] - -[package.dependencies] -click = ">=8.0" -cloudpickle = ">=1.5.0" -dask = "2024.8.0" -jinja2 = ">=2.10.3" -locket = ">=1.0.0" -msgpack = ">=1.0.0" -packaging = ">=20.0" -psutil = ">=5.7.2" -pyyaml = ">=5.3.1" -sortedcontainers = ">=2.0.5" -tblib = ">=1.6.0" -toolz = ">=0.10.0" -tornado = ">=6.0.4" -urllib3 = ">=1.24.3" -zict = ">=3.0.0" - [[package]] name = "distro" version = "1.9.0" @@ -1003,62 +890,25 @@ files = [ [package.extras] tests = ["asttokens (>=2.1.0)", "coverage", "coverage-enable-subprocess", "ipython", "littleutils", "pytest", "rich"] -[[package]] -name = "faiss-cpu" -version = "1.8.0" -description = "A library for efficient similarity search and clustering of dense vectors." -optional = false -python-versions = ">=3.8" -files = [ - {file = "faiss-cpu-1.8.0.tar.gz", hash = "sha256:3ee1549491728f37b65267c192a94661a907154a8ae0546ad50a564b8be0d82e"}, - {file = "faiss_cpu-1.8.0-cp310-cp310-macosx_10_14_x86_64.whl", hash = "sha256:134a064c7411acf7d1d863173a9d2605c5a59bd573639ab39a5ded5ca983b1b2"}, - {file = "faiss_cpu-1.8.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:ba8e6202d561ac57394c9d691ff17f8fa6eb9a077913a993fce0a154ec0176f1"}, - {file = "faiss_cpu-1.8.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a66e9fa7b70556a39681f06e0652f4124c8ddb0a1924afe4f0e40b6924dc845b"}, - {file = "faiss_cpu-1.8.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:51aaef5a1255d0ea88ea7e52a2415f98c5dd2dd9cec10348d55136541eeec99f"}, - {file = "faiss_cpu-1.8.0-cp310-cp310-win_amd64.whl", hash = "sha256:38152761242870ec7019e0397cbd0ed0b0716562029ce41a71bb38448bd6d5bc"}, - {file = "faiss_cpu-1.8.0-cp311-cp311-macosx_10_14_x86_64.whl", hash = "sha256:c9e6ad94b86626be1a0faff3e53c4ca169eba88aa156d7e90c5a2e9ba30558fb"}, - {file = "faiss_cpu-1.8.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:4601dbd81733bf1bc3bff690aac981289fb386dc8e60d0c4eec8a37ba6856d20"}, - {file = "faiss_cpu-1.8.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fa943d3b5e8c5c77cdd629d9c3c6f78d7da616e586fdd1b94aecbf2e5fa9ba06"}, - {file = "faiss_cpu-1.8.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b644b366c3b239b34fa3e08bf65bfc78a24eda1e1ea5b2b6d9be3e8fc73d8179"}, - {file = "faiss_cpu-1.8.0-cp311-cp311-win_amd64.whl", hash = "sha256:f85ecf3514850f93985be238351f5a70736133cfae784b372640aa17c6343a1b"}, - {file = "faiss_cpu-1.8.0-cp312-cp312-macosx_10_14_x86_64.whl", hash = "sha256:61abc0129a357ac00f17f5167f14dff41480de2cc852f306c3d4cd36b893ccbd"}, - {file = "faiss_cpu-1.8.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:b788186d6eb94e6333e1aa8bb6c84b66e967458ecdd1cee22e16f04c43ee674c"}, - {file = "faiss_cpu-1.8.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5658d90a202c62e4a69c5b065785e9ddcaf6986cb395c16afed8dbe4c58c31a2"}, - {file = "faiss_cpu-1.8.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5d460a372efce547e53d3c47d2c2a8a90b186ad245969048c10c1d7a1e5cf21b"}, - {file = "faiss_cpu-1.8.0-cp312-cp312-win_amd64.whl", hash = "sha256:9e6520324f0a6764dd267b3c32c76958bf2b1ec36752950f6fab31a7295980a0"}, - {file = "faiss_cpu-1.8.0-cp38-cp38-macosx_10_14_x86_64.whl", hash = "sha256:fc44be179d5b7f690484ef0d0caf817fea2698a5275a0c7fb6cbf406e5b2e4d1"}, - {file = "faiss_cpu-1.8.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:bbd6f0bc2e1424a12dc7e19d2cc95b53124867966b21110d26f909227e7ed1f1"}, - {file = "faiss_cpu-1.8.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:06e7add0c8a06ce8fb0443c38fcaf49c45fb74527ea633b819e56452608e64f5"}, - {file = "faiss_cpu-1.8.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b864e23c1817fa6cfe9bbec096fd7140d596002934f71aa89b196ffb1b9cd846"}, - {file = "faiss_cpu-1.8.0-cp38-cp38-win_amd64.whl", hash = "sha256:655433755845adbb6f0961e2f8980703640cb9faa96f1cd1ea190252149e0d0a"}, - {file = "faiss_cpu-1.8.0-cp39-cp39-macosx_10_14_x86_64.whl", hash = "sha256:e81fc376a3bcda213ffb395dda1018c953ce927c587731ad582f4e6c2b225363"}, - {file = "faiss_cpu-1.8.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:8c6fa6b7eaf558307b4ab118a236e8d1da79a8685222928e4dd52e277dba144a"}, - {file = "faiss_cpu-1.8.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:652f6812ef2e8b0f9b18209828c590bc618aca82e7f1c1b1888f52928258e406"}, - {file = "faiss_cpu-1.8.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:304da4e0d19044374b63a5b6467028572eac4bd3f32bc9e8783d800a03fb1f02"}, - {file = "faiss_cpu-1.8.0-cp39-cp39-win_amd64.whl", hash = "sha256:cb475d3f25f08c97ac64dfe026f113e2aeb9829b206b3b046256c3b40dd7eb62"}, -] - -[package.dependencies] -numpy = "*" - [[package]] name = "fastapi" -version = "0.110.3" +version = "0.112.1" description = "FastAPI framework, high performance, easy to learn, fast to code, ready for production" optional = false python-versions = ">=3.8" files = [ - {file = "fastapi-0.110.3-py3-none-any.whl", hash = "sha256:fd7600612f755e4050beb74001310b5a7e1796d149c2ee363124abdfa0289d32"}, - {file = "fastapi-0.110.3.tar.gz", hash = "sha256:555700b0159379e94fdbfc6bb66a0f1c43f4cf7060f25239af3d84b63a656626"}, + {file = "fastapi-0.112.1-py3-none-any.whl", hash = "sha256:bcbd45817fc2a1cd5da09af66815b84ec0d3d634eb173d1ab468ae3103e183e4"}, + {file = "fastapi-0.112.1.tar.gz", hash = "sha256:b2537146f8c23389a7faa8b03d0bd38d4986e6983874557d95eed2acc46448ef"}, ] [package.dependencies] pydantic = ">=1.7.4,<1.8 || >1.8,<1.8.1 || >1.8.1,<2.0.0 || >2.0.0,<2.0.1 || >2.0.1,<2.1.0 || >2.1.0,<3.0.0" -starlette = ">=0.37.2,<0.38.0" +starlette = ">=0.37.2,<0.39.0" typing-extensions = ">=4.8.0" [package.extras] -all = ["email_validator (>=2.0.0)", "httpx (>=0.23.0)", "itsdangerous (>=1.1.0)", "jinja2 (>=2.11.2)", "orjson (>=3.2.1)", "pydantic-extra-types (>=2.0.0)", "pydantic-settings (>=2.0.0)", "python-multipart (>=0.0.7)", "pyyaml (>=5.3.1)", "ujson (>=4.0.1,!=4.0.2,!=4.1.0,!=4.2.0,!=4.3.0,!=5.0.0,!=5.1.0)", "uvicorn[standard] (>=0.12.0)"] +all = ["email_validator (>=2.0.0)", "fastapi-cli[standard] (>=0.0.5)", "httpx (>=0.23.0)", "itsdangerous (>=1.1.0)", "jinja2 (>=2.11.2)", "orjson (>=3.2.1)", "pydantic-extra-types (>=2.0.0)", "pydantic-settings (>=2.0.0)", "python-multipart (>=0.0.7)", "pyyaml (>=5.3.1)", "ujson (>=4.0.1,!=4.0.2,!=4.1.0,!=4.2.0,!=4.3.0,!=5.0.0,!=5.1.0)", "uvicorn[standard] (>=0.12.0)"] +standard = ["email_validator (>=2.0.0)", "fastapi-cli[standard] (>=0.0.5)", "httpx (>=0.23.0)", "jinja2 (>=2.11.2)", "python-multipart (>=0.0.7)", "uvicorn[standard] (>=0.12.0)"] [[package]] name = "fastjsonschema" @@ -1251,77 +1101,6 @@ files = [ {file = "genson-1.3.0.tar.gz", hash = "sha256:e02db9ac2e3fd29e65b5286f7135762e2cd8a986537c075b06fc5f1517308e37"}, ] -[[package]] -name = "greenlet" -version = "3.0.3" -description = "Lightweight in-process concurrent programming" -optional = false -python-versions = ">=3.7" -files = [ - {file = "greenlet-3.0.3-cp310-cp310-macosx_11_0_universal2.whl", hash = "sha256:9da2bd29ed9e4f15955dd1595ad7bc9320308a3b766ef7f837e23ad4b4aac31a"}, - {file = "greenlet-3.0.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d353cadd6083fdb056bb46ed07e4340b0869c305c8ca54ef9da3421acbdf6881"}, - {file = "greenlet-3.0.3-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:dca1e2f3ca00b84a396bc1bce13dd21f680f035314d2379c4160c98153b2059b"}, - {file = "greenlet-3.0.3-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3ed7fb269f15dc662787f4119ec300ad0702fa1b19d2135a37c2c4de6fadfd4a"}, - {file = "greenlet-3.0.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dd4f49ae60e10adbc94b45c0b5e6a179acc1736cf7a90160b404076ee283cf83"}, - {file = "greenlet-3.0.3-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:73a411ef564e0e097dbe7e866bb2dda0f027e072b04da387282b02c308807405"}, - {file = "greenlet-3.0.3-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:7f362975f2d179f9e26928c5b517524e89dd48530a0202570d55ad6ca5d8a56f"}, - {file = "greenlet-3.0.3-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:649dde7de1a5eceb258f9cb00bdf50e978c9db1b996964cd80703614c86495eb"}, - {file = "greenlet-3.0.3-cp310-cp310-win_amd64.whl", hash = "sha256:68834da854554926fbedd38c76e60c4a2e3198c6fbed520b106a8986445caaf9"}, - {file = "greenlet-3.0.3-cp311-cp311-macosx_11_0_universal2.whl", hash = "sha256:b1b5667cced97081bf57b8fa1d6bfca67814b0afd38208d52538316e9422fc61"}, - {file = "greenlet-3.0.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:52f59dd9c96ad2fc0d5724107444f76eb20aaccb675bf825df6435acb7703559"}, - {file = "greenlet-3.0.3-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:afaff6cf5200befd5cec055b07d1c0a5a06c040fe5ad148abcd11ba6ab9b114e"}, - {file = "greenlet-3.0.3-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:fe754d231288e1e64323cfad462fcee8f0288654c10bdf4f603a39ed923bef33"}, - {file = "greenlet-3.0.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2797aa5aedac23af156bbb5a6aa2cd3427ada2972c828244eb7d1b9255846379"}, - {file = "greenlet-3.0.3-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b7f009caad047246ed379e1c4dbcb8b020f0a390667ea74d2387be2998f58a22"}, - {file = "greenlet-3.0.3-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:c5e1536de2aad7bf62e27baf79225d0d64360d4168cf2e6becb91baf1ed074f3"}, - {file = "greenlet-3.0.3-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:894393ce10ceac937e56ec00bb71c4c2f8209ad516e96033e4b3b1de270e200d"}, - {file = "greenlet-3.0.3-cp311-cp311-win_amd64.whl", hash = "sha256:1ea188d4f49089fc6fb283845ab18a2518d279c7cd9da1065d7a84e991748728"}, - {file = "greenlet-3.0.3-cp312-cp312-macosx_11_0_universal2.whl", hash = "sha256:70fb482fdf2c707765ab5f0b6655e9cfcf3780d8d87355a063547b41177599be"}, - {file = "greenlet-3.0.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d4d1ac74f5c0c0524e4a24335350edad7e5f03b9532da7ea4d3c54d527784f2e"}, - {file = "greenlet-3.0.3-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:149e94a2dd82d19838fe4b2259f1b6b9957d5ba1b25640d2380bea9c5df37676"}, - {file = "greenlet-3.0.3-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:15d79dd26056573940fcb8c7413d84118086f2ec1a8acdfa854631084393efcc"}, - {file = "greenlet-3.0.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:881b7db1ebff4ba09aaaeae6aa491daeb226c8150fc20e836ad00041bcb11230"}, - {file = "greenlet-3.0.3-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:fcd2469d6a2cf298f198f0487e0a5b1a47a42ca0fa4dfd1b6862c999f018ebbf"}, - {file = "greenlet-3.0.3-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:1f672519db1796ca0d8753f9e78ec02355e862d0998193038c7073045899f305"}, - {file = "greenlet-3.0.3-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:2516a9957eed41dd8f1ec0c604f1cdc86758b587d964668b5b196a9db5bfcde6"}, - {file = "greenlet-3.0.3-cp312-cp312-win_amd64.whl", hash = "sha256:bba5387a6975598857d86de9eac14210a49d554a77eb8261cc68b7d082f78ce2"}, - {file = "greenlet-3.0.3-cp37-cp37m-macosx_11_0_universal2.whl", hash = "sha256:5b51e85cb5ceda94e79d019ed36b35386e8c37d22f07d6a751cb659b180d5274"}, - {file = "greenlet-3.0.3-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:daf3cb43b7cf2ba96d614252ce1684c1bccee6b2183a01328c98d36fcd7d5cb0"}, - {file = "greenlet-3.0.3-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:99bf650dc5d69546e076f413a87481ee1d2d09aaaaaca058c9251b6d8c14783f"}, - {file = "greenlet-3.0.3-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2dd6e660effd852586b6a8478a1d244b8dc90ab5b1321751d2ea15deb49ed414"}, - {file = "greenlet-3.0.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e3391d1e16e2a5a1507d83e4a8b100f4ee626e8eca43cf2cadb543de69827c4c"}, - {file = "greenlet-3.0.3-cp37-cp37m-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:e1f145462f1fa6e4a4ae3c0f782e580ce44d57c8f2c7aae1b6fa88c0b2efdb41"}, - {file = "greenlet-3.0.3-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:1a7191e42732df52cb5f39d3527217e7ab73cae2cb3694d241e18f53d84ea9a7"}, - {file = "greenlet-3.0.3-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:0448abc479fab28b00cb472d278828b3ccca164531daab4e970a0458786055d6"}, - {file = "greenlet-3.0.3-cp37-cp37m-win32.whl", hash = "sha256:b542be2440edc2d48547b5923c408cbe0fc94afb9f18741faa6ae970dbcb9b6d"}, - {file = "greenlet-3.0.3-cp37-cp37m-win_amd64.whl", hash = "sha256:01bc7ea167cf943b4c802068e178bbf70ae2e8c080467070d01bfa02f337ee67"}, - {file = "greenlet-3.0.3-cp38-cp38-macosx_11_0_universal2.whl", hash = "sha256:1996cb9306c8595335bb157d133daf5cf9f693ef413e7673cb07e3e5871379ca"}, - {file = "greenlet-3.0.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3ddc0f794e6ad661e321caa8d2f0a55ce01213c74722587256fb6566049a8b04"}, - {file = "greenlet-3.0.3-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c9db1c18f0eaad2f804728c67d6c610778456e3e1cc4ab4bbd5eeb8e6053c6fc"}, - {file = "greenlet-3.0.3-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7170375bcc99f1a2fbd9c306f5be8764eaf3ac6b5cb968862cad4c7057756506"}, - {file = "greenlet-3.0.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6b66c9c1e7ccabad3a7d037b2bcb740122a7b17a53734b7d72a344ce39882a1b"}, - {file = "greenlet-3.0.3-cp38-cp38-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:098d86f528c855ead3479afe84b49242e174ed262456c342d70fc7f972bc13c4"}, - {file = "greenlet-3.0.3-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:81bb9c6d52e8321f09c3d165b2a78c680506d9af285bfccbad9fb7ad5a5da3e5"}, - {file = "greenlet-3.0.3-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:fd096eb7ffef17c456cfa587523c5f92321ae02427ff955bebe9e3c63bc9f0da"}, - {file = "greenlet-3.0.3-cp38-cp38-win32.whl", hash = "sha256:d46677c85c5ba00a9cb6f7a00b2bfa6f812192d2c9f7d9c4f6a55b60216712f3"}, - {file = "greenlet-3.0.3-cp38-cp38-win_amd64.whl", hash = "sha256:419b386f84949bf0e7c73e6032e3457b82a787c1ab4a0e43732898a761cc9dbf"}, - {file = "greenlet-3.0.3-cp39-cp39-macosx_11_0_universal2.whl", hash = "sha256:da70d4d51c8b306bb7a031d5cff6cc25ad253affe89b70352af5f1cb68e74b53"}, - {file = "greenlet-3.0.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:086152f8fbc5955df88382e8a75984e2bb1c892ad2e3c80a2508954e52295257"}, - {file = "greenlet-3.0.3-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d73a9fe764d77f87f8ec26a0c85144d6a951a6c438dfe50487df5595c6373eac"}, - {file = "greenlet-3.0.3-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b7dcbe92cc99f08c8dd11f930de4d99ef756c3591a5377d1d9cd7dd5e896da71"}, - {file = "greenlet-3.0.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1551a8195c0d4a68fac7a4325efac0d541b48def35feb49d803674ac32582f61"}, - {file = "greenlet-3.0.3-cp39-cp39-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:64d7675ad83578e3fc149b617a444fab8efdafc9385471f868eb5ff83e446b8b"}, - {file = "greenlet-3.0.3-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:b37eef18ea55f2ffd8f00ff8fe7c8d3818abd3e25fb73fae2ca3b672e333a7a6"}, - {file = "greenlet-3.0.3-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:77457465d89b8263bca14759d7c1684df840b6811b2499838cc5b040a8b5b113"}, - {file = "greenlet-3.0.3-cp39-cp39-win32.whl", hash = "sha256:57e8974f23e47dac22b83436bdcf23080ade568ce77df33159e019d161ce1d1e"}, - {file = "greenlet-3.0.3-cp39-cp39-win_amd64.whl", hash = "sha256:c5ee858cfe08f34712f548c3c363e807e7186f03ad7a5039ebadb29e8c6be067"}, - {file = "greenlet-3.0.3.tar.gz", hash = "sha256:43374442353259554ce33599da8b692d5aa96f8976d567d4badf263371fbe491"}, -] - -[package.extras] -docs = ["Sphinx", "furo"] -test = ["objgraph", "psutil"] - [[package]] name = "h11" version = "0.14.0" @@ -1356,13 +1135,13 @@ trio = ["trio (>=0.22.0,<0.26.0)"] [[package]] name = "httpx" -version = "0.26.0" +version = "0.27.0" description = "The next generation HTTP client." optional = false python-versions = ">=3.8" files = [ - {file = "httpx-0.26.0-py3-none-any.whl", hash = "sha256:8915f5a3627c4d47b73e8202457cb28f1266982d1159bd5779d86a80c0eab1cd"}, - {file = "httpx-0.26.0.tar.gz", hash = "sha256:451b55c30d5185ea6b23c2c793abf9bb237d2a7dfb901ced6ff69ad37ec1dfaf"}, + {file = "httpx-0.27.0-py3-none-any.whl", hash = "sha256:71d5465162c13681bff01ad59b2cc68dd838ea1f10e51574bac27103f00c91a5"}, + {file = "httpx-0.27.0.tar.gz", hash = "sha256:a0cb88a46f32dc874e04ee956e4c2764aba2aa228f650b06788ba6bda2962ab5"}, ] [package.dependencies] @@ -1731,34 +1510,6 @@ files = [ {file = "json5-0.9.25.tar.gz", hash = "sha256:548e41b9be043f9426776f05df8635a00fe06104ea51ed24b67f908856e151ae"}, ] -[[package]] -name = "jsonpatch" -version = "1.33" -description = "Apply JSON-Patches (RFC 6902)" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, !=3.6.*" -files = [ - {file = "jsonpatch-1.33-py2.py3-none-any.whl", hash = "sha256:0ae28c0cd062bbd8b8ecc26d7d164fbbea9652a1a3693f3b956c1eae5145dade"}, - {file = "jsonpatch-1.33.tar.gz", hash = "sha256:9fcd4009c41e6d12348b4a0ff2563ba56a2923a7dfee731d004e212e1ee5030c"}, -] - -[package.dependencies] -jsonpointer = ">=1.9" - -[[package]] -name = "jsonpath-ng" -version = "1.6.1" -description = "A final implementation of JSONPath for Python that aims to be standard compliant, including arithmetic and binary comparison operators and providing clear AST for metaprogramming." -optional = false -python-versions = "*" -files = [ - {file = "jsonpath-ng-1.6.1.tar.gz", hash = "sha256:086c37ba4917304850bd837aeab806670224d3f038fe2833ff593a672ef0a5fa"}, - {file = "jsonpath_ng-1.6.1-py3-none-any.whl", hash = "sha256:8f22cd8273d7772eea9aaa84d922e0841aa36fdb8a2c6b7f6c3791a16a9bc0be"}, -] - -[package.dependencies] -ply = "*" - [[package]] name = "jsonpointer" version = "3.0.0" @@ -1813,78 +1564,6 @@ files = [ [package.dependencies] referencing = ">=0.31.0" -[[package]] -name = "julep" -version = "0.2.14" -description = "Julep is a platform for creating agents with long-term memory" -optional = false -python-versions = "<3.14,>=3.8" -files = [ - {file = "julep-0.2.14-py3-none-any.whl", hash = "sha256:bc3edab590b7942309e4c03ef3300689d58aa92fb362dc3642046f341ccebf75"}, - {file = "julep-0.2.14.tar.gz", hash = "sha256:504ab31ec6e015f9dac1c5dc0d86a7f56ab1dba0228f215191ff5b016f159c82"}, -] - -[package.dependencies] -beartype = ">=0.14.0,<1.0.0" -environs = ">=9.0.0,<11.0.0" -httpx = ">=0.20.0,<1.0.0" -openai = ">=1.0.1,<2.0.0" -pydantic = ">=2.0.1,<3.0.0" -typing-extensions = ">=4.0.0,<5.0.0" - -[[package]] -name = "jupyter-ai" -version = "2.20.0" -description = "A generative AI extension for JupyterLab" -optional = false -python-versions = ">=3.8" -files = [ - {file = "jupyter_ai-2.20.0-py3-none-any.whl", hash = "sha256:e65fb9d3d566bd67e9846716fba0a712955f8ea9b2779dc0902c99e4d4766a3c"}, - {file = "jupyter_ai-2.20.0.tar.gz", hash = "sha256:3544c8906a1ea15aa012a862964832277bd899e9ca2e715b571ce9c3ea69fa23"}, -] - -[package.dependencies] -aiosqlite = ">=0.18" -dask = {version = "*", extras = ["distributed"]} -deepmerge = ">=1.0" -faiss-cpu = "<=1.8.0" -importlib-metadata = ">=5.2.0" -jupyter-ai-magics = ">=2.13.0" -jupyter-server = ">=1.6,<3" -jupyterlab = ">=4.0,<5.0" -traitlets = ">=5.0" -typing-extensions = ">=4.5.0" - -[package.extras] -all = ["arxiv", "jupyter-ai-magics[all]", "pypdf"] -dev = ["jupyter-ai-magics[dev]"] -test = ["coverage", "jupyter-server[test] (>=1.6,<3)", "pytest", "pytest-asyncio", "pytest-cov", "pytest-jupyter", "pytest-tornasync", "syrupy (>=4.0.8,<4.1.0)"] - -[[package]] -name = "jupyter-ai-magics" -version = "2.20.0" -description = "Jupyter AI magics Python package. Not published on NPM." -optional = false -python-versions = ">=3.8" -files = [ - {file = "jupyter_ai_magics-2.20.0-py3-none-any.whl", hash = "sha256:a25b759d40da59a8f1432cece66ba7cc73ef92b3416026b22a446061ab2bc606"}, - {file = "jupyter_ai_magics-2.20.0.tar.gz", hash = "sha256:b5cdee73b6f0bea56dce5b6b92be89960471c2d877ccfab4795d889d8b834fbf"}, -] - -[package.dependencies] -click = ">=8.0,<9.0" -importlib-metadata = ">=5.2.0" -ipython = "*" -jsonpath-ng = ">=1.5.3,<2" -langchain = ">=0.1.0,<0.3.0" -langchain-community = ">=0.1.0,<0.3.0" -typing-extensions = ">=4.5.0" - -[package.extras] -all = ["ai21", "boto3", "gpt4all", "huggingface-hub", "ipywidgets", "langchain-anthropic", "langchain-aws", "langchain-cohere", "langchain-google-genai", "langchain-mistralai", "langchain-nvidia-ai-endpoints", "langchain-openai", "pillow", "qianfan", "together"] -dev = ["pre-commit (>=3.3.3,<4)"] -test = ["coverage", "pytest", "pytest-asyncio", "pytest-cov"] - [[package]] name = "jupyter-client" version = "8.6.2" @@ -2101,118 +1780,6 @@ files = [ {file = "jupyterlab_widgets-3.0.11.tar.gz", hash = "sha256:dd5ac679593c969af29c9bed054c24f26842baa51352114736756bc035deee27"}, ] -[[package]] -name = "langchain" -version = "0.2.14" -description = "Building applications with LLMs through composability" -optional = false -python-versions = "<4.0,>=3.8.1" -files = [ - {file = "langchain-0.2.14-py3-none-any.whl", hash = "sha256:eed76194ee7d9c081037a3df7868d4de90e0410b51fc1ca933a8379e464bf40c"}, - {file = "langchain-0.2.14.tar.gz", hash = "sha256:dc2aa5a58882054fb5d043c39ab8332ebd055f88f17839da68e1c7fd0a4fefe2"}, -] - -[package.dependencies] -aiohttp = ">=3.8.3,<4.0.0" -langchain-core = ">=0.2.32,<0.3.0" -langchain-text-splitters = ">=0.2.0,<0.3.0" -langsmith = ">=0.1.17,<0.2.0" -numpy = {version = ">=1,<2", markers = "python_version < \"3.12\""} -pydantic = ">=1,<3" -PyYAML = ">=5.3" -requests = ">=2,<3" -SQLAlchemy = ">=1.4,<3" -tenacity = ">=8.1.0,<8.4.0 || >8.4.0,<9.0.0" - -[[package]] -name = "langchain-community" -version = "0.2.12" -description = "Community contributed LangChain integrations." -optional = false -python-versions = "<4.0,>=3.8.1" -files = [ - {file = "langchain_community-0.2.12-py3-none-any.whl", hash = "sha256:50e74473dd2309bdef561760afbbf0c5ea17ed91fc4dfa0d52279dd16d6d34e0"}, - {file = "langchain_community-0.2.12.tar.gz", hash = "sha256:d671cfc6a4f3b65f49a2e59ab420d0164f109d0a56fc4b4996518205c63b8c7e"}, -] - -[package.dependencies] -aiohttp = ">=3.8.3,<4.0.0" -dataclasses-json = ">=0.5.7,<0.7" -langchain = ">=0.2.13,<0.3.0" -langchain-core = ">=0.2.30,<0.3.0" -langsmith = ">=0.1.0,<0.2.0" -numpy = {version = ">=1,<2", markers = "python_version < \"3.12\""} -PyYAML = ">=5.3" -requests = ">=2,<3" -SQLAlchemy = ">=1.4,<3" -tenacity = ">=8.1.0,<8.4.0 || >8.4.0,<9.0.0" - -[[package]] -name = "langchain-core" -version = "0.2.32" -description = "Building applications with LLMs through composability" -optional = false -python-versions = "<4.0,>=3.8.1" -files = [ - {file = "langchain_core-0.2.32-py3-none-any.whl", hash = "sha256:1f5584cf0034909e35ea17010a847d4079417e0ddcb5a9eb3fbb2bd55f3268c0"}, - {file = "langchain_core-0.2.32.tar.gz", hash = "sha256:d82cdc350bbbe74261330d87056b7d9f1fb567828e9e03f708d23a48b941819e"}, -] - -[package.dependencies] -jsonpatch = ">=1.33,<2.0" -langsmith = ">=0.1.75,<0.2.0" -packaging = ">=23.2,<25" -pydantic = {version = ">=1,<3", markers = "python_full_version < \"3.12.4\""} -PyYAML = ">=5.3" -tenacity = ">=8.1.0,<8.4.0 || >8.4.0,<9.0.0" -typing-extensions = ">=4.7" - -[[package]] -name = "langchain-openai" -version = "0.1.21" -description = "An integration package connecting OpenAI and LangChain" -optional = false -python-versions = "<4.0,>=3.8.1" -files = [ - {file = "langchain_openai-0.1.21-py3-none-any.whl", hash = "sha256:44420f0c84859ae236a80c8ac8754a16d5b660c24377c27ba98308145d346352"}, - {file = "langchain_openai-0.1.21.tar.gz", hash = "sha256:2c65feaf12bb284eccf7bce35725fd06f3035fa751babad6aa84af2f99867f88"}, -] - -[package.dependencies] -langchain-core = ">=0.2.29,<0.3.0" -openai = ">=1.40.0,<2.0.0" -tiktoken = ">=0.7,<1" - -[[package]] -name = "langchain-text-splitters" -version = "0.2.2" -description = "LangChain text splitting utilities" -optional = false -python-versions = "<4.0,>=3.8.1" -files = [ - {file = "langchain_text_splitters-0.2.2-py3-none-any.whl", hash = "sha256:1c80d4b11b55e2995f02d2a326c0323ee1eeff24507329bb22924e420c782dff"}, - {file = "langchain_text_splitters-0.2.2.tar.gz", hash = "sha256:a1e45de10919fa6fb080ef0525deab56557e9552083600455cb9fa4238076140"}, -] - -[package.dependencies] -langchain-core = ">=0.2.10,<0.3.0" - -[[package]] -name = "langsmith" -version = "0.1.99" -description = "Client library to connect to the LangSmith LLM Tracing and Evaluation Platform." -optional = false -python-versions = "<4.0,>=3.8.1" -files = [ - {file = "langsmith-0.1.99-py3-none-any.whl", hash = "sha256:ef8d1d74a2674c514aa429b0171a9fbb661207dc3835142cca0e8f1bf97b26b0"}, - {file = "langsmith-0.1.99.tar.gz", hash = "sha256:b5c6a1f158abda61600a4a445081ee848b4a28b758d91f2793dc02aeffafcaf1"}, -] - -[package.dependencies] -orjson = ">=3.9.14,<4.0.0" -pydantic = {version = ">=1,<3", markers = "python_full_version < \"3.12.4\""} -requests = ">=2,<3" - [[package]] name = "libcst" version = "1.4.0" @@ -2255,13 +1822,13 @@ dev = ["Sphinx (>=5.1.1)", "black (==23.12.1)", "build (>=0.10.0)", "coverage (> [[package]] name = "litellm" -version = "1.43.13" +version = "1.43.18" description = "Library to easily interface with LLM API providers" optional = false python-versions = "!=2.7.*,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,!=3.7.*,>=3.8" files = [ - {file = "litellm-1.43.13-py3-none-any.whl", hash = "sha256:47c27c1c1b394d6098c68eec637008b07a254dadc4b82206b1a9f960621a8776"}, - {file = "litellm-1.43.13.tar.gz", hash = "sha256:b0273cbed3f7a35f197c98d92b1a13038b430e5e78d30db7d94d8237a3b98641"}, + {file = "litellm-1.43.18-py3-none-any.whl", hash = "sha256:68d853b4a0198a16e2260e4406a20f8d2e59bd903e019b7f3ba5a9f35ecc3e62"}, + {file = "litellm-1.43.18.tar.gz", hash = "sha256:e22b20065b62663dd060be9da1e84ca05903931c41c49d35a98649ed09e79d29"}, ] [package.dependencies] @@ -2281,17 +1848,6 @@ tokenizers = "*" extra-proxy = ["azure-identity (>=1.15.0,<2.0.0)", "azure-keyvault-secrets (>=4.8.0,<5.0.0)", "google-cloud-kms (>=2.21.3,<3.0.0)", "prisma (==0.11.0)", "pynacl (>=1.5.0,<2.0.0)", "resend (>=0.8.0,<0.9.0)"] proxy = ["PyJWT (>=2.8.0,<3.0.0)", "apscheduler (>=3.10.4,<4.0.0)", "backoff", "cryptography (>=42.0.5,<43.0.0)", "fastapi (>=0.111.0,<0.112.0)", "fastapi-sso (>=0.10.0,<0.11.0)", "gunicorn (>=22.0.0,<23.0.0)", "orjson (>=3.9.7,<4.0.0)", "python-multipart (>=0.0.9,<0.0.10)", "pyyaml (>=6.0.1,<7.0.0)", "rq", "uvicorn (>=0.22.0,<0.23.0)"] -[[package]] -name = "locket" -version = "1.0.0" -description = "File-based locks for Python on Linux and Windows" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" -files = [ - {file = "locket-1.0.0-py2.py3-none-any.whl", hash = "sha256:b6c819a722f7b6bd955b80781788e4a66a55628b858d347536b7e81325a3a5e3"}, - {file = "locket-1.0.0.tar.gz", hash = "sha256:5c0d4c052a8bbbf750e056a8e65ccd309086f4f0f18a2eac306a8dfa4112a632"}, -] - [[package]] name = "markdown-it-py" version = "3.0.0" @@ -2440,71 +1996,6 @@ files = [ {file = "mistune-3.0.2.tar.gz", hash = "sha256:fc7f93ded930c92394ef2cb6f04a8aabab4117a91449e72dcc8dfa646a508be8"}, ] -[[package]] -name = "msgpack" -version = "1.0.8" -description = "MessagePack serializer" -optional = false -python-versions = ">=3.8" -files = [ - {file = "msgpack-1.0.8-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:505fe3d03856ac7d215dbe005414bc28505d26f0c128906037e66d98c4e95868"}, - {file = "msgpack-1.0.8-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:e6b7842518a63a9f17107eb176320960ec095a8ee3b4420b5f688e24bf50c53c"}, - {file = "msgpack-1.0.8-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:376081f471a2ef24828b83a641a02c575d6103a3ad7fd7dade5486cad10ea659"}, - {file = "msgpack-1.0.8-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5e390971d082dba073c05dbd56322427d3280b7cc8b53484c9377adfbae67dc2"}, - {file = "msgpack-1.0.8-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:00e073efcba9ea99db5acef3959efa45b52bc67b61b00823d2a1a6944bf45982"}, - {file = "msgpack-1.0.8-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:82d92c773fbc6942a7a8b520d22c11cfc8fd83bba86116bfcf962c2f5c2ecdaa"}, - {file = "msgpack-1.0.8-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:9ee32dcb8e531adae1f1ca568822e9b3a738369b3b686d1477cbc643c4a9c128"}, - {file = "msgpack-1.0.8-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:e3aa7e51d738e0ec0afbed661261513b38b3014754c9459508399baf14ae0c9d"}, - {file = "msgpack-1.0.8-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:69284049d07fce531c17404fcba2bb1df472bc2dcdac642ae71a2d079d950653"}, - {file = "msgpack-1.0.8-cp310-cp310-win32.whl", hash = "sha256:13577ec9e247f8741c84d06b9ece5f654920d8365a4b636ce0e44f15e07ec693"}, - {file = "msgpack-1.0.8-cp310-cp310-win_amd64.whl", hash = "sha256:e532dbd6ddfe13946de050d7474e3f5fb6ec774fbb1a188aaf469b08cf04189a"}, - {file = "msgpack-1.0.8-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:9517004e21664f2b5a5fd6333b0731b9cf0817403a941b393d89a2f1dc2bd836"}, - {file = "msgpack-1.0.8-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:d16a786905034e7e34098634b184a7d81f91d4c3d246edc6bd7aefb2fd8ea6ad"}, - {file = "msgpack-1.0.8-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:e2872993e209f7ed04d963e4b4fbae72d034844ec66bc4ca403329db2074377b"}, - {file = "msgpack-1.0.8-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5c330eace3dd100bdb54b5653b966de7f51c26ec4a7d4e87132d9b4f738220ba"}, - {file = "msgpack-1.0.8-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:83b5c044f3eff2a6534768ccfd50425939e7a8b5cf9a7261c385de1e20dcfc85"}, - {file = "msgpack-1.0.8-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1876b0b653a808fcd50123b953af170c535027bf1d053b59790eebb0aeb38950"}, - {file = "msgpack-1.0.8-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:dfe1f0f0ed5785c187144c46a292b8c34c1295c01da12e10ccddfc16def4448a"}, - {file = "msgpack-1.0.8-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:3528807cbbb7f315bb81959d5961855e7ba52aa60a3097151cb21956fbc7502b"}, - {file = "msgpack-1.0.8-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:e2f879ab92ce502a1e65fce390eab619774dda6a6ff719718069ac94084098ce"}, - {file = "msgpack-1.0.8-cp311-cp311-win32.whl", hash = "sha256:26ee97a8261e6e35885c2ecd2fd4a6d38252246f94a2aec23665a4e66d066305"}, - {file = "msgpack-1.0.8-cp311-cp311-win_amd64.whl", hash = "sha256:eadb9f826c138e6cf3c49d6f8de88225a3c0ab181a9b4ba792e006e5292d150e"}, - {file = "msgpack-1.0.8-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:114be227f5213ef8b215c22dde19532f5da9652e56e8ce969bf0a26d7c419fee"}, - {file = "msgpack-1.0.8-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:d661dc4785affa9d0edfdd1e59ec056a58b3dbb9f196fa43587f3ddac654ac7b"}, - {file = "msgpack-1.0.8-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:d56fd9f1f1cdc8227d7b7918f55091349741904d9520c65f0139a9755952c9e8"}, - {file = "msgpack-1.0.8-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0726c282d188e204281ebd8de31724b7d749adebc086873a59efb8cf7ae27df3"}, - {file = "msgpack-1.0.8-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8db8e423192303ed77cff4dce3a4b88dbfaf43979d280181558af5e2c3c71afc"}, - {file = "msgpack-1.0.8-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:99881222f4a8c2f641f25703963a5cefb076adffd959e0558dc9f803a52d6a58"}, - {file = "msgpack-1.0.8-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:b5505774ea2a73a86ea176e8a9a4a7c8bf5d521050f0f6f8426afe798689243f"}, - {file = "msgpack-1.0.8-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:ef254a06bcea461e65ff0373d8a0dd1ed3aa004af48839f002a0c994a6f72d04"}, - {file = "msgpack-1.0.8-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:e1dd7839443592d00e96db831eddb4111a2a81a46b028f0facd60a09ebbdd543"}, - {file = "msgpack-1.0.8-cp312-cp312-win32.whl", hash = "sha256:64d0fcd436c5683fdd7c907eeae5e2cbb5eb872fafbc03a43609d7941840995c"}, - {file = "msgpack-1.0.8-cp312-cp312-win_amd64.whl", hash = "sha256:74398a4cf19de42e1498368c36eed45d9528f5fd0155241e82c4082b7e16cffd"}, - {file = "msgpack-1.0.8-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:0ceea77719d45c839fd73abcb190b8390412a890df2f83fb8cf49b2a4b5c2f40"}, - {file = "msgpack-1.0.8-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:1ab0bbcd4d1f7b6991ee7c753655b481c50084294218de69365f8f1970d4c151"}, - {file = "msgpack-1.0.8-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:1cce488457370ffd1f953846f82323cb6b2ad2190987cd4d70b2713e17268d24"}, - {file = "msgpack-1.0.8-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3923a1778f7e5ef31865893fdca12a8d7dc03a44b33e2a5f3295416314c09f5d"}, - {file = "msgpack-1.0.8-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a22e47578b30a3e199ab067a4d43d790249b3c0587d9a771921f86250c8435db"}, - {file = "msgpack-1.0.8-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:bd739c9251d01e0279ce729e37b39d49a08c0420d3fee7f2a4968c0576678f77"}, - {file = "msgpack-1.0.8-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:d3420522057ebab1728b21ad473aa950026d07cb09da41103f8e597dfbfaeb13"}, - {file = "msgpack-1.0.8-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:5845fdf5e5d5b78a49b826fcdc0eb2e2aa7191980e3d2cfd2a30303a74f212e2"}, - {file = "msgpack-1.0.8-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:6a0e76621f6e1f908ae52860bdcb58e1ca85231a9b0545e64509c931dd34275a"}, - {file = "msgpack-1.0.8-cp38-cp38-win32.whl", hash = "sha256:374a8e88ddab84b9ada695d255679fb99c53513c0a51778796fcf0944d6c789c"}, - {file = "msgpack-1.0.8-cp38-cp38-win_amd64.whl", hash = "sha256:f3709997b228685fe53e8c433e2df9f0cdb5f4542bd5114ed17ac3c0129b0480"}, - {file = "msgpack-1.0.8-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:f51bab98d52739c50c56658cc303f190785f9a2cd97b823357e7aeae54c8f68a"}, - {file = "msgpack-1.0.8-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:73ee792784d48aa338bba28063e19a27e8d989344f34aad14ea6e1b9bd83f596"}, - {file = "msgpack-1.0.8-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:f9904e24646570539a8950400602d66d2b2c492b9010ea7e965025cb71d0c86d"}, - {file = "msgpack-1.0.8-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e75753aeda0ddc4c28dce4c32ba2f6ec30b1b02f6c0b14e547841ba5b24f753f"}, - {file = "msgpack-1.0.8-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5dbf059fb4b7c240c873c1245ee112505be27497e90f7c6591261c7d3c3a8228"}, - {file = "msgpack-1.0.8-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4916727e31c28be8beaf11cf117d6f6f188dcc36daae4e851fee88646f5b6b18"}, - {file = "msgpack-1.0.8-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:7938111ed1358f536daf311be244f34df7bf3cdedb3ed883787aca97778b28d8"}, - {file = "msgpack-1.0.8-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:493c5c5e44b06d6c9268ce21b302c9ca055c1fd3484c25ba41d34476c76ee746"}, - {file = "msgpack-1.0.8-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:5fbb160554e319f7b22ecf530a80a3ff496d38e8e07ae763b9e82fadfe96f273"}, - {file = "msgpack-1.0.8-cp39-cp39-win32.whl", hash = "sha256:f9af38a89b6a5c04b7d18c492c8ccf2aee7048aff1ce8437c4683bb5a1df893d"}, - {file = "msgpack-1.0.8-cp39-cp39-win_amd64.whl", hash = "sha256:ed59dd52075f8fc91da6053b12e8c89e37aa043f8986efd89e61fae69dc1b011"}, - {file = "msgpack-1.0.8.tar.gz", hash = "sha256:95c02b0e27e706e48d0e5426d1710ca78e0f0628d6e89d5b5a5b91a5f12274f3"}, -] - [[package]] name = "msgspec" version = "0.18.6" @@ -2822,58 +2313,74 @@ test = ["pytest", "pytest-console-scripts", "pytest-jupyter", "pytest-tornasync" [[package]] name = "numpy" -version = "1.26.4" +version = "2.1.0" description = "Fundamental package for array computing in Python" optional = false -python-versions = ">=3.9" +python-versions = ">=3.10" files = [ - {file = "numpy-1.26.4-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:9ff0f4f29c51e2803569d7a51c2304de5554655a60c5d776e35b4a41413830d0"}, - {file = "numpy-1.26.4-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:2e4ee3380d6de9c9ec04745830fd9e2eccb3e6cf790d39d7b98ffd19b0dd754a"}, - {file = "numpy-1.26.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d209d8969599b27ad20994c8e41936ee0964e6da07478d6c35016bc386b66ad4"}, - {file = "numpy-1.26.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ffa75af20b44f8dba823498024771d5ac50620e6915abac414251bd971b4529f"}, - {file = "numpy-1.26.4-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:62b8e4b1e28009ef2846b4c7852046736bab361f7aeadeb6a5b89ebec3c7055a"}, - {file = "numpy-1.26.4-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:a4abb4f9001ad2858e7ac189089c42178fcce737e4169dc61321660f1a96c7d2"}, - {file = "numpy-1.26.4-cp310-cp310-win32.whl", hash = "sha256:bfe25acf8b437eb2a8b2d49d443800a5f18508cd811fea3181723922a8a82b07"}, - {file = "numpy-1.26.4-cp310-cp310-win_amd64.whl", hash = "sha256:b97fe8060236edf3662adfc2c633f56a08ae30560c56310562cb4f95500022d5"}, - {file = "numpy-1.26.4-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:4c66707fabe114439db9068ee468c26bbdf909cac0fb58686a42a24de1760c71"}, - {file = "numpy-1.26.4-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:edd8b5fe47dab091176d21bb6de568acdd906d1887a4584a15a9a96a1dca06ef"}, - {file = "numpy-1.26.4-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7ab55401287bfec946ced39700c053796e7cc0e3acbef09993a9ad2adba6ca6e"}, - {file = "numpy-1.26.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:666dbfb6ec68962c033a450943ded891bed2d54e6755e35e5835d63f4f6931d5"}, - {file = "numpy-1.26.4-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:96ff0b2ad353d8f990b63294c8986f1ec3cb19d749234014f4e7eb0112ceba5a"}, - {file = "numpy-1.26.4-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:60dedbb91afcbfdc9bc0b1f3f402804070deed7392c23eb7a7f07fa857868e8a"}, - {file = "numpy-1.26.4-cp311-cp311-win32.whl", hash = "sha256:1af303d6b2210eb850fcf03064d364652b7120803a0b872f5211f5234b399f20"}, - {file = "numpy-1.26.4-cp311-cp311-win_amd64.whl", hash = "sha256:cd25bcecc4974d09257ffcd1f098ee778f7834c3ad767fe5db785be9a4aa9cb2"}, - {file = "numpy-1.26.4-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:b3ce300f3644fb06443ee2222c2201dd3a89ea6040541412b8fa189341847218"}, - {file = "numpy-1.26.4-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:03a8c78d01d9781b28a6989f6fa1bb2c4f2d51201cf99d3dd875df6fbd96b23b"}, - {file = "numpy-1.26.4-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9fad7dcb1aac3c7f0584a5a8133e3a43eeb2fe127f47e3632d43d677c66c102b"}, - {file = "numpy-1.26.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:675d61ffbfa78604709862923189bad94014bef562cc35cf61d3a07bba02a7ed"}, - {file = "numpy-1.26.4-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:ab47dbe5cc8210f55aa58e4805fe224dac469cde56b9f731a4c098b91917159a"}, - {file = "numpy-1.26.4-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:1dda2e7b4ec9dd512f84935c5f126c8bd8b9f2fc001e9f54af255e8c5f16b0e0"}, - {file = "numpy-1.26.4-cp312-cp312-win32.whl", hash = "sha256:50193e430acfc1346175fcbdaa28ffec49947a06918b7b92130744e81e640110"}, - {file = "numpy-1.26.4-cp312-cp312-win_amd64.whl", hash = "sha256:08beddf13648eb95f8d867350f6a018a4be2e5ad54c8d8caed89ebca558b2818"}, - {file = "numpy-1.26.4-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:7349ab0fa0c429c82442a27a9673fc802ffdb7c7775fad780226cb234965e53c"}, - {file = "numpy-1.26.4-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:52b8b60467cd7dd1e9ed082188b4e6bb35aa5cdd01777621a1658910745b90be"}, - {file = "numpy-1.26.4-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d5241e0a80d808d70546c697135da2c613f30e28251ff8307eb72ba696945764"}, - {file = "numpy-1.26.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f870204a840a60da0b12273ef34f7051e98c3b5961b61b0c2c1be6dfd64fbcd3"}, - {file = "numpy-1.26.4-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:679b0076f67ecc0138fd2ede3a8fd196dddc2ad3254069bcb9faf9a79b1cebcd"}, - {file = "numpy-1.26.4-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:47711010ad8555514b434df65f7d7b076bb8261df1ca9bb78f53d3b2db02e95c"}, - {file = "numpy-1.26.4-cp39-cp39-win32.whl", hash = "sha256:a354325ee03388678242a4d7ebcd08b5c727033fcff3b2f536aea978e15ee9e6"}, - {file = "numpy-1.26.4-cp39-cp39-win_amd64.whl", hash = "sha256:3373d5d70a5fe74a2c1bb6d2cfd9609ecf686d47a2d7b1d37a8f3b6bf6003aea"}, - {file = "numpy-1.26.4-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:afedb719a9dcfc7eaf2287b839d8198e06dcd4cb5d276a3df279231138e83d30"}, - {file = "numpy-1.26.4-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:95a7476c59002f2f6c590b9b7b998306fba6a5aa646b1e22ddfeaf8f78c3a29c"}, - {file = "numpy-1.26.4-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:7e50d0a0cc3189f9cb0aeb3a6a6af18c16f59f004b866cd2be1c14b36134a4a0"}, - {file = "numpy-1.26.4.tar.gz", hash = "sha256:2a02aba9ed12e4ac4eb3ea9421c420301a0c6460d9830d74a9df87efa4912010"}, + {file = "numpy-2.1.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:6326ab99b52fafdcdeccf602d6286191a79fe2fda0ae90573c5814cd2b0bc1b8"}, + {file = "numpy-2.1.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:0937e54c09f7a9a68da6889362ddd2ff584c02d015ec92672c099b61555f8911"}, + {file = "numpy-2.1.0-cp310-cp310-macosx_14_0_arm64.whl", hash = "sha256:30014b234f07b5fec20f4146f69e13cfb1e33ee9a18a1879a0142fbb00d47673"}, + {file = "numpy-2.1.0-cp310-cp310-macosx_14_0_x86_64.whl", hash = "sha256:899da829b362ade41e1e7eccad2cf274035e1cb36ba73034946fccd4afd8606b"}, + {file = "numpy-2.1.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:08801848a40aea24ce16c2ecde3b756f9ad756586fb2d13210939eb69b023f5b"}, + {file = "numpy-2.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:398049e237d1aae53d82a416dade04defed1a47f87d18d5bd615b6e7d7e41d1f"}, + {file = "numpy-2.1.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:0abb3916a35d9090088a748636b2c06dc9a6542f99cd476979fb156a18192b84"}, + {file = "numpy-2.1.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:10e2350aea18d04832319aac0f887d5fcec1b36abd485d14f173e3e900b83e33"}, + {file = "numpy-2.1.0-cp310-cp310-win32.whl", hash = "sha256:f6b26e6c3b98adb648243670fddc8cab6ae17473f9dc58c51574af3e64d61211"}, + {file = "numpy-2.1.0-cp310-cp310-win_amd64.whl", hash = "sha256:f505264735ee074250a9c78247ee8618292091d9d1fcc023290e9ac67e8f1afa"}, + {file = "numpy-2.1.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:76368c788ccb4f4782cf9c842b316140142b4cbf22ff8db82724e82fe1205dce"}, + {file = "numpy-2.1.0-cp311-cp311-macosx_14_0_arm64.whl", hash = "sha256:f8e93a01a35be08d31ae33021e5268f157a2d60ebd643cfc15de6ab8e4722eb1"}, + {file = "numpy-2.1.0-cp311-cp311-macosx_14_0_x86_64.whl", hash = "sha256:9523f8b46485db6939bd069b28b642fec86c30909cea90ef550373787f79530e"}, + {file = "numpy-2.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:54139e0eb219f52f60656d163cbe67c31ede51d13236c950145473504fa208cb"}, + {file = "numpy-2.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f5ebbf9fbdabed208d4ecd2e1dfd2c0741af2f876e7ae522c2537d404ca895c3"}, + {file = "numpy-2.1.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:378cb4f24c7d93066ee4103204f73ed046eb88f9ad5bb2275bb9fa0f6a02bd36"}, + {file = "numpy-2.1.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:d8f699a709120b220dfe173f79c73cb2a2cab2c0b88dd59d7b49407d032b8ebd"}, + {file = "numpy-2.1.0-cp311-cp311-win32.whl", hash = "sha256:ffbd6faeb190aaf2b5e9024bac9622d2ee549b7ec89ef3a9373fa35313d44e0e"}, + {file = "numpy-2.1.0-cp311-cp311-win_amd64.whl", hash = "sha256:0af3a5987f59d9c529c022c8c2a64805b339b7ef506509fba7d0556649b9714b"}, + {file = "numpy-2.1.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:fe76d75b345dc045acdbc006adcb197cc680754afd6c259de60d358d60c93736"}, + {file = "numpy-2.1.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:f358ea9e47eb3c2d6eba121ab512dfff38a88db719c38d1e67349af210bc7529"}, + {file = "numpy-2.1.0-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:dd94ce596bda40a9618324547cfaaf6650b1a24f5390350142499aa4e34e53d1"}, + {file = "numpy-2.1.0-cp312-cp312-macosx_14_0_x86_64.whl", hash = "sha256:b47c551c6724960479cefd7353656498b86e7232429e3a41ab83be4da1b109e8"}, + {file = "numpy-2.1.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a0756a179afa766ad7cb6f036de622e8a8f16ffdd55aa31f296c870b5679d745"}, + {file = "numpy-2.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:24003ba8ff22ea29a8c306e61d316ac74111cebf942afbf692df65509a05f111"}, + {file = "numpy-2.1.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:b34fa5e3b5d6dc7e0a4243fa0f81367027cb6f4a7215a17852979634b5544ee0"}, + {file = "numpy-2.1.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:c4f982715e65036c34897eb598d64aef15150c447be2cfc6643ec7a11af06574"}, + {file = "numpy-2.1.0-cp312-cp312-win32.whl", hash = "sha256:c4cd94dfefbefec3f8b544f61286584292d740e6e9d4677769bc76b8f41deb02"}, + {file = "numpy-2.1.0-cp312-cp312-win_amd64.whl", hash = "sha256:a0cdef204199278f5c461a0bed6ed2e052998276e6d8ab2963d5b5c39a0500bc"}, + {file = "numpy-2.1.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:8ab81ccd753859ab89e67199b9da62c543850f819993761c1e94a75a814ed667"}, + {file = "numpy-2.1.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:442596f01913656d579309edcd179a2a2f9977d9a14ff41d042475280fc7f34e"}, + {file = "numpy-2.1.0-cp313-cp313-macosx_14_0_arm64.whl", hash = "sha256:848c6b5cad9898e4b9ef251b6f934fa34630371f2e916261070a4eb9092ffd33"}, + {file = "numpy-2.1.0-cp313-cp313-macosx_14_0_x86_64.whl", hash = "sha256:54c6a63e9d81efe64bfb7bcb0ec64332a87d0b87575f6009c8ba67ea6374770b"}, + {file = "numpy-2.1.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:652e92fc409e278abdd61e9505649e3938f6d04ce7ef1953f2ec598a50e7c195"}, + {file = "numpy-2.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0ab32eb9170bf8ffcbb14f11613f4a0b108d3ffee0832457c5d4808233ba8977"}, + {file = "numpy-2.1.0-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:8fb49a0ba4d8f41198ae2d52118b050fd34dace4b8f3fb0ee34e23eb4ae775b1"}, + {file = "numpy-2.1.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:44e44973262dc3ae79e9063a1284a73e09d01b894b534a769732ccd46c28cc62"}, + {file = "numpy-2.1.0-cp313-cp313-win32.whl", hash = "sha256:ab83adc099ec62e044b1fbb3a05499fa1e99f6d53a1dde102b2d85eff66ed324"}, + {file = "numpy-2.1.0-cp313-cp313-win_amd64.whl", hash = "sha256:de844aaa4815b78f6023832590d77da0e3b6805c644c33ce94a1e449f16d6ab5"}, + {file = "numpy-2.1.0-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:343e3e152bf5a087511cd325e3b7ecfd5b92d369e80e74c12cd87826e263ec06"}, + {file = "numpy-2.1.0-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:f07fa2f15dabe91259828ce7d71b5ca9e2eb7c8c26baa822c825ce43552f4883"}, + {file = "numpy-2.1.0-cp313-cp313t-macosx_14_0_arm64.whl", hash = "sha256:5474dad8c86ee9ba9bb776f4b99ef2d41b3b8f4e0d199d4f7304728ed34d0300"}, + {file = "numpy-2.1.0-cp313-cp313t-macosx_14_0_x86_64.whl", hash = "sha256:1f817c71683fd1bb5cff1529a1d085a57f02ccd2ebc5cd2c566f9a01118e3b7d"}, + {file = "numpy-2.1.0-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3a3336fbfa0d38d3deacd3fe7f3d07e13597f29c13abf4d15c3b6dc2291cbbdd"}, + {file = "numpy-2.1.0-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7a894c51fd8c4e834f00ac742abad73fc485df1062f1b875661a3c1e1fb1c2f6"}, + {file = "numpy-2.1.0-cp313-cp313t-musllinux_1_1_x86_64.whl", hash = "sha256:9156ca1f79fc4acc226696e95bfcc2b486f165a6a59ebe22b2c1f82ab190384a"}, + {file = "numpy-2.1.0-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:624884b572dff8ca8f60fab591413f077471de64e376b17d291b19f56504b2bb"}, + {file = "numpy-2.1.0-pp310-pypy310_pp73-macosx_10_15_x86_64.whl", hash = "sha256:15ef8b2177eeb7e37dd5ef4016f30b7659c57c2c0b57a779f1d537ff33a72c7b"}, + {file = "numpy-2.1.0-pp310-pypy310_pp73-macosx_14_0_x86_64.whl", hash = "sha256:e5f0642cdf4636198a4990de7a71b693d824c56a757862230454629cf62e323d"}, + {file = "numpy-2.1.0-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f15976718c004466406342789f31b6673776360f3b1e3c575f25302d7e789575"}, + {file = "numpy-2.1.0-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:6c1de77ded79fef664d5098a66810d4d27ca0224e9051906e634b3f7ead134c2"}, + {file = "numpy-2.1.0.tar.gz", hash = "sha256:7dc90da0081f7e1da49ec4e398ede6a8e9cc4f5ebe5f9e06b443ed889ee9aaa2"}, ] [[package]] name = "openai" -version = "1.40.8" +version = "1.41.0" description = "The official Python library for the openai API" optional = false python-versions = ">=3.7.1" files = [ - {file = "openai-1.40.8-py3-none-any.whl", hash = "sha256:3ed4ddad48e0dde059c9b4d3dc240e47781beca2811e52ba449ddc4a471a2fd4"}, - {file = "openai-1.40.8.tar.gz", hash = "sha256:e225f830b946378e214c5b2cfa8df28ba2aeb7e9d44f738cb2a926fd971f5bc0"}, + {file = "openai-1.41.0-py3-none-any.whl", hash = "sha256:3b6cca4571667f3e0800442ef8f2bfa6a6f3301c51776bc7626159a4d81c242c"}, + {file = "openai-1.41.0.tar.gz", hash = "sha256:26b81f39b49dce92ff5d30c373625ddb212c2f1050e1574e456d18423730cdd0"}, ] [package.dependencies] @@ -2889,72 +2396,6 @@ typing-extensions = ">=4.11,<5" [package.extras] datalib = ["numpy (>=1)", "pandas (>=1.2.3)", "pandas-stubs (>=1.1.0.11)"] -[[package]] -name = "orjson" -version = "3.10.7" -description = "Fast, correct Python JSON library supporting dataclasses, datetimes, and numpy" -optional = false -python-versions = ">=3.8" -files = [ - {file = "orjson-3.10.7-cp310-cp310-macosx_10_15_x86_64.macosx_11_0_arm64.macosx_10_15_universal2.whl", hash = "sha256:74f4544f5a6405b90da8ea724d15ac9c36da4d72a738c64685003337401f5c12"}, - {file = "orjson-3.10.7-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:34a566f22c28222b08875b18b0dfbf8a947e69df21a9ed5c51a6bf91cfb944ac"}, - {file = "orjson-3.10.7-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:bf6ba8ebc8ef5792e2337fb0419f8009729335bb400ece005606336b7fd7bab7"}, - {file = "orjson-3.10.7-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ac7cf6222b29fbda9e3a472b41e6a5538b48f2c8f99261eecd60aafbdb60690c"}, - {file = "orjson-3.10.7-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:de817e2f5fc75a9e7dd350c4b0f54617b280e26d1631811a43e7e968fa71e3e9"}, - {file = "orjson-3.10.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:348bdd16b32556cf8d7257b17cf2bdb7ab7976af4af41ebe79f9796c218f7e91"}, - {file = "orjson-3.10.7-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:479fd0844ddc3ca77e0fd99644c7fe2de8e8be1efcd57705b5c92e5186e8a250"}, - {file = "orjson-3.10.7-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:fdf5197a21dd660cf19dfd2a3ce79574588f8f5e2dbf21bda9ee2d2b46924d84"}, - {file = "orjson-3.10.7-cp310-none-win32.whl", hash = "sha256:d374d36726746c81a49f3ff8daa2898dccab6596864ebe43d50733275c629175"}, - {file = "orjson-3.10.7-cp310-none-win_amd64.whl", hash = "sha256:cb61938aec8b0ffb6eef484d480188a1777e67b05d58e41b435c74b9d84e0b9c"}, - {file = "orjson-3.10.7-cp311-cp311-macosx_10_15_x86_64.macosx_11_0_arm64.macosx_10_15_universal2.whl", hash = "sha256:7db8539039698ddfb9a524b4dd19508256107568cdad24f3682d5773e60504a2"}, - {file = "orjson-3.10.7-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:480f455222cb7a1dea35c57a67578848537d2602b46c464472c995297117fa09"}, - {file = "orjson-3.10.7-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:8a9c9b168b3a19e37fe2778c0003359f07822c90fdff8f98d9d2a91b3144d8e0"}, - {file = "orjson-3.10.7-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8de062de550f63185e4c1c54151bdddfc5625e37daf0aa1e75d2a1293e3b7d9a"}, - {file = "orjson-3.10.7-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:6b0dd04483499d1de9c8f6203f8975caf17a6000b9c0c54630cef02e44ee624e"}, - {file = "orjson-3.10.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b58d3795dafa334fc8fd46f7c5dc013e6ad06fd5b9a4cc98cb1456e7d3558bd6"}, - {file = "orjson-3.10.7-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:33cfb96c24034a878d83d1a9415799a73dc77480e6c40417e5dda0710d559ee6"}, - {file = "orjson-3.10.7-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:e724cebe1fadc2b23c6f7415bad5ee6239e00a69f30ee423f319c6af70e2a5c0"}, - {file = "orjson-3.10.7-cp311-none-win32.whl", hash = "sha256:82763b46053727a7168d29c772ed5c870fdae2f61aa8a25994c7984a19b1021f"}, - {file = "orjson-3.10.7-cp311-none-win_amd64.whl", hash = "sha256:eb8d384a24778abf29afb8e41d68fdd9a156cf6e5390c04cc07bbc24b89e98b5"}, - {file = "orjson-3.10.7-cp312-cp312-macosx_10_15_x86_64.macosx_11_0_arm64.macosx_10_15_universal2.whl", hash = "sha256:44a96f2d4c3af51bfac6bc4ef7b182aa33f2f054fd7f34cc0ee9a320d051d41f"}, - {file = "orjson-3.10.7-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:76ac14cd57df0572453543f8f2575e2d01ae9e790c21f57627803f5e79b0d3c3"}, - {file = "orjson-3.10.7-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:bdbb61dcc365dd9be94e8f7df91975edc9364d6a78c8f7adb69c1cdff318ec93"}, - {file = "orjson-3.10.7-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b48b3db6bb6e0a08fa8c83b47bc169623f801e5cc4f24442ab2b6617da3b5313"}, - {file = "orjson-3.10.7-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:23820a1563a1d386414fef15c249040042b8e5d07b40ab3fe3efbfbbcbcb8864"}, - {file = "orjson-3.10.7-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a0c6a008e91d10a2564edbb6ee5069a9e66df3fbe11c9a005cb411f441fd2c09"}, - {file = "orjson-3.10.7-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:d352ee8ac1926d6193f602cbe36b1643bbd1bbcb25e3c1a657a4390f3000c9a5"}, - {file = "orjson-3.10.7-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:d2d9f990623f15c0ae7ac608103c33dfe1486d2ed974ac3f40b693bad1a22a7b"}, - {file = "orjson-3.10.7-cp312-none-win32.whl", hash = "sha256:7c4c17f8157bd520cdb7195f75ddbd31671997cbe10aee559c2d613592e7d7eb"}, - {file = "orjson-3.10.7-cp312-none-win_amd64.whl", hash = "sha256:1d9c0e733e02ada3ed6098a10a8ee0052dd55774de3d9110d29868d24b17faa1"}, - {file = "orjson-3.10.7-cp313-cp313-macosx_10_15_x86_64.macosx_11_0_arm64.macosx_10_15_universal2.whl", hash = "sha256:77d325ed866876c0fa6492598ec01fe30e803272a6e8b10e992288b009cbe149"}, - {file = "orjson-3.10.7-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9ea2c232deedcb605e853ae1db2cc94f7390ac776743b699b50b071b02bea6fe"}, - {file = "orjson-3.10.7-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:3dcfbede6737fdbef3ce9c37af3fb6142e8e1ebc10336daa05872bfb1d87839c"}, - {file = "orjson-3.10.7-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:11748c135f281203f4ee695b7f80bb1358a82a63905f9f0b794769483ea854ad"}, - {file = "orjson-3.10.7-cp313-none-win32.whl", hash = "sha256:a7e19150d215c7a13f39eb787d84db274298d3f83d85463e61d277bbd7f401d2"}, - {file = "orjson-3.10.7-cp313-none-win_amd64.whl", hash = "sha256:eef44224729e9525d5261cc8d28d6b11cafc90e6bd0be2157bde69a52ec83024"}, - {file = "orjson-3.10.7-cp38-cp38-macosx_10_15_x86_64.macosx_11_0_arm64.macosx_10_15_universal2.whl", hash = "sha256:6ea2b2258eff652c82652d5e0f02bd5e0463a6a52abb78e49ac288827aaa1469"}, - {file = "orjson-3.10.7-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:430ee4d85841e1483d487e7b81401785a5dfd69db5de01314538f31f8fbf7ee1"}, - {file = "orjson-3.10.7-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:4b6146e439af4c2472c56f8540d799a67a81226e11992008cb47e1267a9b3225"}, - {file = "orjson-3.10.7-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:084e537806b458911137f76097e53ce7bf5806dda33ddf6aaa66a028f8d43a23"}, - {file = "orjson-3.10.7-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:4829cf2195838e3f93b70fd3b4292156fc5e097aac3739859ac0dcc722b27ac0"}, - {file = "orjson-3.10.7-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1193b2416cbad1a769f868b1749535d5da47626ac29445803dae7cc64b3f5c98"}, - {file = "orjson-3.10.7-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:4e6c3da13e5a57e4b3dca2de059f243ebec705857522f188f0180ae88badd354"}, - {file = "orjson-3.10.7-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:c31008598424dfbe52ce8c5b47e0752dca918a4fdc4a2a32004efd9fab41d866"}, - {file = "orjson-3.10.7-cp38-none-win32.whl", hash = "sha256:7122a99831f9e7fe977dc45784d3b2edc821c172d545e6420c375e5a935f5a1c"}, - {file = "orjson-3.10.7-cp38-none-win_amd64.whl", hash = "sha256:a763bc0e58504cc803739e7df040685816145a6f3c8a589787084b54ebc9f16e"}, - {file = "orjson-3.10.7-cp39-cp39-macosx_10_15_x86_64.macosx_11_0_arm64.macosx_10_15_universal2.whl", hash = "sha256:e76be12658a6fa376fcd331b1ea4e58f5a06fd0220653450f0d415b8fd0fbe20"}, - {file = "orjson-3.10.7-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ed350d6978d28b92939bfeb1a0570c523f6170efc3f0a0ef1f1df287cd4f4960"}, - {file = "orjson-3.10.7-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:144888c76f8520e39bfa121b31fd637e18d4cc2f115727865fdf9fa325b10412"}, - {file = "orjson-3.10.7-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:09b2d92fd95ad2402188cf51573acde57eb269eddabaa60f69ea0d733e789fe9"}, - {file = "orjson-3.10.7-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5b24a579123fa884f3a3caadaed7b75eb5715ee2b17ab5c66ac97d29b18fe57f"}, - {file = "orjson-3.10.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e72591bcfe7512353bd609875ab38050efe3d55e18934e2f18950c108334b4ff"}, - {file = "orjson-3.10.7-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:f4db56635b58cd1a200b0a23744ff44206ee6aa428185e2b6c4a65b3197abdcd"}, - {file = "orjson-3.10.7-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:0fa5886854673222618638c6df7718ea7fe2f3f2384c452c9ccedc70b4a510a5"}, - {file = "orjson-3.10.7-cp39-none-win32.whl", hash = "sha256:8272527d08450ab16eb405f47e0f4ef0e5ff5981c3d82afe0efd25dcbef2bcd2"}, - {file = "orjson-3.10.7-cp39-none-win_amd64.whl", hash = "sha256:974683d4618c0c7dbf4f69c95a979734bf183d0658611760017f6e70a145af58"}, - {file = "orjson-3.10.7.tar.gz", hash = "sha256:75ef0640403f945f3a1f9f6400686560dbfb0fb5b16589ad62cd477043c4eee3"}, -] - [[package]] name = "overrides" version = "7.7.0" @@ -3072,24 +2513,6 @@ files = [ qa = ["flake8 (==5.0.4)", "mypy (==0.971)", "types-setuptools (==67.2.0.1)"] testing = ["docopt", "pytest"] -[[package]] -name = "partd" -version = "1.4.2" -description = "Appendable key-value storage" -optional = false -python-versions = ">=3.9" -files = [ - {file = "partd-1.4.2-py3-none-any.whl", hash = "sha256:978e4ac767ec4ba5b86c6eaa52e5a2a3bc748a2ca839e8cc798f1cc6ce6efb0f"}, - {file = "partd-1.4.2.tar.gz", hash = "sha256:d022c33afbdc8405c226621b015e8067888173d85f7f5ecebb3cafed9a20f02c"}, -] - -[package.dependencies] -locket = "*" -toolz = "*" - -[package.extras] -complete = ["blosc", "numpy (>=1.20.0)", "pandas (>=1.3)", "pyzmq"] - [[package]] name = "pastel" version = "0.2.1" @@ -3157,17 +2580,6 @@ files = [ dev = ["pre-commit", "tox"] testing = ["pytest", "pytest-benchmark"] -[[package]] -name = "ply" -version = "3.11" -description = "Python Lex & Yacc" -optional = false -python-versions = "*" -files = [ - {file = "ply-3.11-py2.py3-none-any.whl", hash = "sha256:096f9b8350b65ebd2fd1346b12452efe5b9607f7482813ffca50c22722a807ce"}, - {file = "ply-3.11.tar.gz", hash = "sha256:00c7c1aaa88358b9c765b6d3000c6eec0ba42abca5351b095321aef446081da3"}, -] - [[package]] name = "poethepoet" version = "0.25.1" @@ -4171,22 +3583,23 @@ win32 = ["pywin32"] [[package]] name = "sentry-sdk" -version = "1.45.1" +version = "2.13.0" description = "Python client for Sentry (https://sentry.io)" optional = false -python-versions = "*" +python-versions = ">=3.6" files = [ - {file = "sentry_sdk-1.45.1-py2.py3-none-any.whl", hash = "sha256:608887855ccfe39032bfd03936e3a1c4f4fc99b3a4ac49ced54a4220de61c9c1"}, - {file = "sentry_sdk-1.45.1.tar.gz", hash = "sha256:a16c997c0f4e3df63c0fc5e4207ccb1ab37900433e0f72fef88315d317829a26"}, + {file = "sentry_sdk-2.13.0-py2.py3-none-any.whl", hash = "sha256:6beede8fc2ab4043da7f69d95534e320944690680dd9a963178a49de71d726c6"}, + {file = "sentry_sdk-2.13.0.tar.gz", hash = "sha256:8d4a576f7a98eb2fdb40e13106e41f330e5c79d72a68be1316e7852cf4995260"}, ] [package.dependencies] certifi = "*" fastapi = {version = ">=0.79.0", optional = true, markers = "extra == \"fastapi\""} -urllib3 = {version = ">=1.26.11", markers = "python_version >= \"3.6\""} +urllib3 = ">=1.26.11" [package.extras] aiohttp = ["aiohttp (>=3.5)"] +anthropic = ["anthropic (>=0.16)"] arq = ["arq (>=0.23)"] asyncpg = ["asyncpg (>=0.23)"] beam = ["apache-beam (>=2.12)"] @@ -4199,13 +3612,16 @@ django = ["django (>=1.8)"] falcon = ["falcon (>=1.4)"] fastapi = ["fastapi (>=0.79.0)"] flask = ["blinker (>=1.1)", "flask (>=0.11)", "markupsafe"] -grpcio = ["grpcio (>=1.21.1)"] +grpcio = ["grpcio (>=1.21.1)", "protobuf (>=3.8.0)"] httpx = ["httpx (>=0.16.0)"] huey = ["huey (>=2)"] +huggingface-hub = ["huggingface-hub (>=0.22)"] +langchain = ["langchain (>=0.0.210)"] +litestar = ["litestar (>=2.0.0)"] loguru = ["loguru (>=0.5)"] openai = ["openai (>=1.0.0)", "tiktoken (>=0.3.0)"] opentelemetry = ["opentelemetry-distro (>=0.35b0)"] -opentelemetry-experimental = ["opentelemetry-distro (>=0.40b0,<1.0)", "opentelemetry-instrumentation-aiohttp-client (>=0.40b0,<1.0)", "opentelemetry-instrumentation-django (>=0.40b0,<1.0)", "opentelemetry-instrumentation-fastapi (>=0.40b0,<1.0)", "opentelemetry-instrumentation-flask (>=0.40b0,<1.0)", "opentelemetry-instrumentation-requests (>=0.40b0,<1.0)", "opentelemetry-instrumentation-sqlite3 (>=0.40b0,<1.0)", "opentelemetry-instrumentation-urllib (>=0.40b0,<1.0)"] +opentelemetry-experimental = ["opentelemetry-distro"] pure-eval = ["asttokens", "executing", "pure-eval"] pymongo = ["pymongo (>=3.1)"] pyspark = ["pyspark (>=2.4.4)"] @@ -4215,7 +3631,7 @@ sanic = ["sanic (>=0.8)"] sqlalchemy = ["sqlalchemy (>=1.2)"] starlette = ["starlette (>=0.19.1)"] starlite = ["starlite (>=1.48)"] -tornado = ["tornado (>=5)"] +tornado = ["tornado (>=6)"] [[package]] name = "setuptools" @@ -4277,17 +3693,6 @@ files = [ {file = "sniffio-1.3.1.tar.gz", hash = "sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc"}, ] -[[package]] -name = "sortedcontainers" -version = "2.4.0" -description = "Sorted Containers -- Sorted List, Sorted Dict, Sorted Set" -optional = false -python-versions = "*" -files = [ - {file = "sortedcontainers-2.4.0-py2.py3-none-any.whl", hash = "sha256:a163dcaede0f1c021485e957a39245190e74249897e2ae4b2aa38595db237ee0"}, - {file = "sortedcontainers-2.4.0.tar.gz", hash = "sha256:25caa5a06cc30b6b83d11423433f65d1f9d76c4c6a0c90e3379eaa43b9bfdb88"}, -] - [[package]] name = "soupsieve" version = "2.6" @@ -4299,93 +3704,6 @@ files = [ {file = "soupsieve-2.6.tar.gz", hash = "sha256:e2e68417777af359ec65daac1057404a3c8a5455bb8abc36f1a9866ab1a51abb"}, ] -[[package]] -name = "sqlalchemy" -version = "2.0.32" -description = "Database Abstraction Library" -optional = false -python-versions = ">=3.7" -files = [ - {file = "SQLAlchemy-2.0.32-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:0c9045ecc2e4db59bfc97b20516dfdf8e41d910ac6fb667ebd3a79ea54084619"}, - {file = "SQLAlchemy-2.0.32-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:1467940318e4a860afd546ef61fefb98a14d935cd6817ed07a228c7f7c62f389"}, - {file = "SQLAlchemy-2.0.32-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5954463675cb15db8d4b521f3566a017c8789222b8316b1e6934c811018ee08b"}, - {file = "SQLAlchemy-2.0.32-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:167e7497035c303ae50651b351c28dc22a40bb98fbdb8468cdc971821b1ae533"}, - {file = "SQLAlchemy-2.0.32-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:b27dfb676ac02529fb6e343b3a482303f16e6bc3a4d868b73935b8792edb52d0"}, - {file = "SQLAlchemy-2.0.32-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:bf2360a5e0f7bd75fa80431bf8ebcfb920c9f885e7956c7efde89031695cafb8"}, - {file = "SQLAlchemy-2.0.32-cp310-cp310-win32.whl", hash = "sha256:306fe44e754a91cd9d600a6b070c1f2fadbb4a1a257b8781ccf33c7067fd3e4d"}, - {file = "SQLAlchemy-2.0.32-cp310-cp310-win_amd64.whl", hash = "sha256:99db65e6f3ab42e06c318f15c98f59a436f1c78179e6a6f40f529c8cc7100b22"}, - {file = "SQLAlchemy-2.0.32-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:21b053be28a8a414f2ddd401f1be8361e41032d2ef5884b2f31d31cb723e559f"}, - {file = "SQLAlchemy-2.0.32-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:b178e875a7a25b5938b53b006598ee7645172fccafe1c291a706e93f48499ff5"}, - {file = "SQLAlchemy-2.0.32-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:723a40ee2cc7ea653645bd4cf024326dea2076673fc9d3d33f20f6c81db83e1d"}, - {file = "SQLAlchemy-2.0.32-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:295ff8689544f7ee7e819529633d058bd458c1fd7f7e3eebd0f9268ebc56c2a0"}, - {file = "SQLAlchemy-2.0.32-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:49496b68cd190a147118af585173ee624114dfb2e0297558c460ad7495f9dfe2"}, - {file = "SQLAlchemy-2.0.32-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:acd9b73c5c15f0ec5ce18128b1fe9157ddd0044abc373e6ecd5ba376a7e5d961"}, - {file = "SQLAlchemy-2.0.32-cp311-cp311-win32.whl", hash = "sha256:9365a3da32dabd3e69e06b972b1ffb0c89668994c7e8e75ce21d3e5e69ddef28"}, - {file = "SQLAlchemy-2.0.32-cp311-cp311-win_amd64.whl", hash = "sha256:8bd63d051f4f313b102a2af1cbc8b80f061bf78f3d5bd0843ff70b5859e27924"}, - {file = "SQLAlchemy-2.0.32-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:6bab3db192a0c35e3c9d1560eb8332463e29e5507dbd822e29a0a3c48c0a8d92"}, - {file = "SQLAlchemy-2.0.32-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:19d98f4f58b13900d8dec4ed09dd09ef292208ee44cc9c2fe01c1f0a2fe440e9"}, - {file = "SQLAlchemy-2.0.32-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3cd33c61513cb1b7371fd40cf221256456d26a56284e7d19d1f0b9f1eb7dd7e8"}, - {file = "SQLAlchemy-2.0.32-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7d6ba0497c1d066dd004e0f02a92426ca2df20fac08728d03f67f6960271feec"}, - {file = "SQLAlchemy-2.0.32-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:2b6be53e4fde0065524f1a0a7929b10e9280987b320716c1509478b712a7688c"}, - {file = "SQLAlchemy-2.0.32-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:916a798f62f410c0b80b63683c8061f5ebe237b0f4ad778739304253353bc1cb"}, - {file = "SQLAlchemy-2.0.32-cp312-cp312-win32.whl", hash = "sha256:31983018b74908ebc6c996a16ad3690301a23befb643093fcfe85efd292e384d"}, - {file = "SQLAlchemy-2.0.32-cp312-cp312-win_amd64.whl", hash = "sha256:4363ed245a6231f2e2957cccdda3c776265a75851f4753c60f3004b90e69bfeb"}, - {file = "SQLAlchemy-2.0.32-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:b8afd5b26570bf41c35c0121801479958b4446751a3971fb9a480c1afd85558e"}, - {file = "SQLAlchemy-2.0.32-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c750987fc876813f27b60d619b987b057eb4896b81117f73bb8d9918c14f1cad"}, - {file = "SQLAlchemy-2.0.32-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ada0102afff4890f651ed91120c1120065663506b760da4e7823913ebd3258be"}, - {file = "SQLAlchemy-2.0.32-cp37-cp37m-musllinux_1_2_aarch64.whl", hash = "sha256:78c03d0f8a5ab4f3034c0e8482cfcc415a3ec6193491cfa1c643ed707d476f16"}, - {file = "SQLAlchemy-2.0.32-cp37-cp37m-musllinux_1_2_x86_64.whl", hash = "sha256:3bd1cae7519283ff525e64645ebd7a3e0283f3c038f461ecc1c7b040a0c932a1"}, - {file = "SQLAlchemy-2.0.32-cp37-cp37m-win32.whl", hash = "sha256:01438ebcdc566d58c93af0171c74ec28efe6a29184b773e378a385e6215389da"}, - {file = "SQLAlchemy-2.0.32-cp37-cp37m-win_amd64.whl", hash = "sha256:4979dc80fbbc9d2ef569e71e0896990bc94df2b9fdbd878290bd129b65ab579c"}, - {file = "SQLAlchemy-2.0.32-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:6c742be912f57586ac43af38b3848f7688863a403dfb220193a882ea60e1ec3a"}, - {file = "SQLAlchemy-2.0.32-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:62e23d0ac103bcf1c5555b6c88c114089587bc64d048fef5bbdb58dfd26f96da"}, - {file = "SQLAlchemy-2.0.32-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:251f0d1108aab8ea7b9aadbd07fb47fb8e3a5838dde34aa95a3349876b5a1f1d"}, - {file = "SQLAlchemy-2.0.32-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0ef18a84e5116340e38eca3e7f9eeaaef62738891422e7c2a0b80feab165905f"}, - {file = "SQLAlchemy-2.0.32-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:3eb6a97a1d39976f360b10ff208c73afb6a4de86dd2a6212ddf65c4a6a2347d5"}, - {file = "SQLAlchemy-2.0.32-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:0c1c9b673d21477cec17ab10bc4decb1322843ba35b481585facd88203754fc5"}, - {file = "SQLAlchemy-2.0.32-cp38-cp38-win32.whl", hash = "sha256:c41a2b9ca80ee555decc605bd3c4520cc6fef9abde8fd66b1cf65126a6922d65"}, - {file = "SQLAlchemy-2.0.32-cp38-cp38-win_amd64.whl", hash = "sha256:8a37e4d265033c897892279e8adf505c8b6b4075f2b40d77afb31f7185cd6ecd"}, - {file = "SQLAlchemy-2.0.32-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:52fec964fba2ef46476312a03ec8c425956b05c20220a1a03703537824b5e8e1"}, - {file = "SQLAlchemy-2.0.32-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:328429aecaba2aee3d71e11f2477c14eec5990fb6d0e884107935f7fb6001632"}, - {file = "SQLAlchemy-2.0.32-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:85a01b5599e790e76ac3fe3aa2f26e1feba56270023d6afd5550ed63c68552b3"}, - {file = "SQLAlchemy-2.0.32-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:aaf04784797dcdf4c0aa952c8d234fa01974c4729db55c45732520ce12dd95b4"}, - {file = "SQLAlchemy-2.0.32-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:4488120becf9b71b3ac718f4138269a6be99a42fe023ec457896ba4f80749525"}, - {file = "SQLAlchemy-2.0.32-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:14e09e083a5796d513918a66f3d6aedbc131e39e80875afe81d98a03312889e6"}, - {file = "SQLAlchemy-2.0.32-cp39-cp39-win32.whl", hash = "sha256:0d322cc9c9b2154ba7e82f7bf25ecc7c36fbe2d82e2933b3642fc095a52cfc78"}, - {file = "SQLAlchemy-2.0.32-cp39-cp39-win_amd64.whl", hash = "sha256:7dd8583df2f98dea28b5cd53a1beac963f4f9d087888d75f22fcc93a07cf8d84"}, - {file = "SQLAlchemy-2.0.32-py3-none-any.whl", hash = "sha256:e567a8793a692451f706b363ccf3c45e056b67d90ead58c3bc9471af5d212202"}, - {file = "SQLAlchemy-2.0.32.tar.gz", hash = "sha256:c1b88cc8b02b6a5f0efb0345a03672d4c897dc7d92585176f88c67346f565ea8"}, -] - -[package.dependencies] -greenlet = {version = "!=0.4.17", markers = "python_version < \"3.13\" and (platform_machine == \"aarch64\" or platform_machine == \"ppc64le\" or platform_machine == \"x86_64\" or platform_machine == \"amd64\" or platform_machine == \"AMD64\" or platform_machine == \"win32\" or platform_machine == \"WIN32\")"} -typing-extensions = ">=4.6.0" - -[package.extras] -aiomysql = ["aiomysql (>=0.2.0)", "greenlet (!=0.4.17)"] -aioodbc = ["aioodbc", "greenlet (!=0.4.17)"] -aiosqlite = ["aiosqlite", "greenlet (!=0.4.17)", "typing_extensions (!=3.10.0.1)"] -asyncio = ["greenlet (!=0.4.17)"] -asyncmy = ["asyncmy (>=0.2.3,!=0.2.4,!=0.2.6)", "greenlet (!=0.4.17)"] -mariadb-connector = ["mariadb (>=1.0.1,!=1.1.2,!=1.1.5)"] -mssql = ["pyodbc"] -mssql-pymssql = ["pymssql"] -mssql-pyodbc = ["pyodbc"] -mypy = ["mypy (>=0.910)"] -mysql = ["mysqlclient (>=1.4.0)"] -mysql-connector = ["mysql-connector-python"] -oracle = ["cx_oracle (>=8)"] -oracle-oracledb = ["oracledb (>=1.0.1)"] -postgresql = ["psycopg2 (>=2.7)"] -postgresql-asyncpg = ["asyncpg", "greenlet (!=0.4.17)"] -postgresql-pg8000 = ["pg8000 (>=1.29.1)"] -postgresql-psycopg = ["psycopg (>=3.0.7)"] -postgresql-psycopg2binary = ["psycopg2-binary"] -postgresql-psycopg2cffi = ["psycopg2cffi"] -postgresql-psycopgbinary = ["psycopg[binary] (>=3.0.7)"] -pymysql = ["pymysql"] -sqlcipher = ["sqlcipher3_binary"] - [[package]] name = "stack-data" version = "0.6.3" @@ -4407,13 +3725,13 @@ tests = ["cython", "littleutils", "pygments", "pytest", "typeguard"] [[package]] name = "starlette" -version = "0.37.2" +version = "0.38.2" description = "The little ASGI library that shines." optional = false python-versions = ">=3.8" files = [ - {file = "starlette-0.37.2-py3-none-any.whl", hash = "sha256:6fe59f29268538e5d0d182f2791a479a0c64638e6935d1c6989e63fb2699c6ee"}, - {file = "starlette-0.37.2.tar.gz", hash = "sha256:9af890290133b79fc3db55474ade20f6220a364a0402e0b556e7cd5e1e093823"}, + {file = "starlette-0.38.2-py3-none-any.whl", hash = "sha256:4ec6a59df6bbafdab5f567754481657f7ed90dc9d69b0c9ff017907dd54faeff"}, + {file = "starlette-0.38.2.tar.gz", hash = "sha256:c7c0441065252160993a1a37cf2a73bb64d271b17303e0b0c1eb7191cfb12d75"}, ] [package.dependencies] @@ -4436,17 +3754,6 @@ files = [ [package.extras] widechars = ["wcwidth"] -[[package]] -name = "tblib" -version = "3.0.0" -description = "Traceback serialization library." -optional = false -python-versions = ">=3.8" -files = [ - {file = "tblib-3.0.0-py3-none-any.whl", hash = "sha256:80a6c77e59b55e83911e1e607c649836a69c103963c5f28a46cbeef44acf8129"}, - {file = "tblib-3.0.0.tar.gz", hash = "sha256:93622790a0a29e04f0346458face1e144dc4d32f493714c6c3dff82a4adb77e6"}, -] - [[package]] name = "temporalio" version = "1.6.0" @@ -4473,13 +3780,13 @@ opentelemetry = ["opentelemetry-api (>=1.11.1,<2.0.0)", "opentelemetry-sdk (>=1. [[package]] name = "tenacity" -version = "8.5.0" +version = "9.0.0" description = "Retry code until it succeeds" optional = false python-versions = ">=3.8" files = [ - {file = "tenacity-8.5.0-py3-none-any.whl", hash = "sha256:b594c2a5945830c267ce6b79a166228323ed52718f30302c1359836112346687"}, - {file = "tenacity-8.5.0.tar.gz", hash = "sha256:8bc6c0c8a09b31e6cad13c47afbed1a567518250a9a171418582ed8d9c20ca78"}, + {file = "tenacity-9.0.0-py3-none-any.whl", hash = "sha256:93de0c98785b27fcf659856aa9f54bfbd399e29969b0621bc7f762bd441b4539"}, + {file = "tenacity-9.0.0.tar.gz", hash = "sha256:807f37ca97d62aa361264d497b0e31e92b8027044942bfa756160d908320d73b"}, ] [package.extras] @@ -4730,17 +4037,6 @@ files = [ {file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"}, ] -[[package]] -name = "toolz" -version = "0.12.1" -description = "List processing tools and functional utilities" -optional = false -python-versions = ">=3.7" -files = [ - {file = "toolz-0.12.1-py3-none-any.whl", hash = "sha256:d22731364c07d72eea0a0ad45bafb2c2937ab6fd38a3507bf55eae8744aa7d85"}, - {file = "toolz-0.12.1.tar.gz", hash = "sha256:ecca342664893f177a13dac0e6b41cbd8ac25a358e5f215316d43e2100224f4d"}, -] - [[package]] name = "tornado" version = "6.4.1" @@ -4798,13 +4094,13 @@ test = ["argcomplete (>=3.0.3)", "mypy (>=1.7.0)", "pre-commit", "pytest (>=7.0, [[package]] name = "typer" -version = "0.12.3" +version = "0.12.4" description = "Typer, build great CLIs. Easy to code. Based on Python type hints." optional = false python-versions = ">=3.7" files = [ - {file = "typer-0.12.3-py3-none-any.whl", hash = "sha256:070d7ca53f785acbccba8e7d28b08dcd88f79f1fbda035ade0aecec71ca5c914"}, - {file = "typer-0.12.3.tar.gz", hash = "sha256:49e73131481d804288ef62598d97a1ceef3058905aa536a1134f90891ba35482"}, + {file = "typer-0.12.4-py3-none-any.whl", hash = "sha256:819aa03699f438397e876aa12b0d63766864ecba1b579092cc9fe35d886e34b6"}, + {file = "typer-0.12.4.tar.gz", hash = "sha256:c9c1613ed6a166162705b3347b8d10b661ccc5d95692654d0fb628118f2c34e6"}, ] [package.dependencies] @@ -4846,21 +4142,6 @@ files = [ {file = "typing_extensions-4.12.2.tar.gz", hash = "sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8"}, ] -[[package]] -name = "typing-inspect" -version = "0.9.0" -description = "Runtime inspection utilities for typing module." -optional = false -python-versions = "*" -files = [ - {file = "typing_inspect-0.9.0-py3-none-any.whl", hash = "sha256:9ee6fc59062311ef8547596ab6b955e1b8aa46242d854bfc78f4f6b0eff35f9f"}, - {file = "typing_inspect-0.9.0.tar.gz", hash = "sha256:b23fc42ff6f6ef6954e4852c1fb512cdd18dbea03134f91f856a95ccc9461f78"}, -] - -[package.dependencies] -mypy-extensions = ">=0.3.0" -typing-extensions = ">=3.7.4" - [[package]] name = "tzdata" version = "2024.1" @@ -4905,13 +4186,13 @@ zstd = ["zstandard (>=0.18.0)"] [[package]] name = "uvicorn" -version = "0.23.2" +version = "0.30.6" description = "The lightning-fast ASGI server." optional = false python-versions = ">=3.8" files = [ - {file = "uvicorn-0.23.2-py3-none-any.whl", hash = "sha256:1f9be6558f01239d4fdf22ef8126c39cb1ad0addf76c40e760549d2c2f43ab53"}, - {file = "uvicorn-0.23.2.tar.gz", hash = "sha256:4d3cc12d7727ba72b64d12d3cc7743124074c0a69f7b201512fc50c3e3f1569a"}, + {file = "uvicorn-0.30.6-py3-none-any.whl", hash = "sha256:65fd46fe3fda5bdc1b03b94eb634923ff18cd35b2f084813ea79d1f103f711b5"}, + {file = "uvicorn-0.30.6.tar.gz", hash = "sha256:4b15decdda1e72be08209e860a1e10e92439ad5b97cf44cc945fcbee66fc5788"}, ] [package.dependencies] @@ -5120,17 +4401,6 @@ files = [ idna = ">=2.0" multidict = ">=4.0" -[[package]] -name = "zict" -version = "3.0.0" -description = "Mutable mapping tools" -optional = false -python-versions = ">=3.8" -files = [ - {file = "zict-3.0.0-py2.py3-none-any.whl", hash = "sha256:5796e36bd0e0cc8cf0fbc1ace6a68912611c1dbd74750a3f3026b9b9d6a327ae"}, - {file = "zict-3.0.0.tar.gz", hash = "sha256:e321e263b6a97aafc0790c3cfb3c04656b7066e6738c37fffcca95d803c9fba5"}, -] - [[package]] name = "zipp" version = "3.20.0" @@ -5149,4 +4419,4 @@ test = ["big-O", "importlib-resources", "jaraco.functools", "jaraco.itertools", [metadata] lock-version = "2.0" python-versions = ">=3.11,<3.12" -content-hash = "df48532534cbce05d6360e5c818a984efaa498b5d3f465a8669c0a1b05977bc4" +content-hash = "9ba28e1010a979afba89f2fa3924462e004f7f1bdf4e3a4a839b96241df04856" diff --git a/agents-api/pyproject.toml b/agents-api/pyproject.toml index 88068f962..e27a2c1f9 100644 --- a/agents-api/pyproject.toml +++ b/agents-api/pyproject.toml @@ -8,43 +8,40 @@ packages = [{include = "agents_api"}] [tool.poetry.dependencies] python = ">=3.11,<3.12" -fastapi = "^0.110.1" +fastapi = "^0.112.1" pycozo = {extras = ["embedded"], version = "^0.7.6"} -uvicorn = "^0.23.2" +uvicorn = "^0.30.6" fire = "^0.5.0" environs = "^10.3.0" -pandas = "^2.1.0" -openai = "^1.12.0" -httpx = "^0.26.0" -sentry-sdk = {extras = ["fastapi"], version = "^1.38.0"} -temporalio = "^1.4.0" -pydantic = "^2.5.3" +pandas = "^2.2.2" +openai = "^1.41.0" +httpx = "^0.27.0" +sentry-sdk = {extras = ["fastapi"], version = "^2.13.0"} +temporalio = "^1.6.0" +pydantic = "^2.8.2" arrow = "^1.3.0" -jinja2 = "^3.1.3" +jinja2 = "^3.1.4" jinja2schema = "^0.1.4" jsonschema = "^4.21.1" -litellm = "^1.43.3" -numpy = "^1.26.4" +litellm = "^1.43.18" +numpy = "^2.1.0" tiktoken = "^0.7.0" -tenacity = "^8.3.0" +tenacity = "^9.0.0" beartype = "^0.18.5" pydantic-partial = "^0.5.5" simpleeval = "^0.9.13" [tool.poetry.group.dev.dependencies] -ipython = "^8.18.1" +ipython = "^8.26.0" ruff = "^0.5.5" -datamodel-code-generator = "^0.25.8" +datamodel-code-generator = "^0.25.9" cozo-migrate = "^0.2.0" poethepoet = "^0.25.1" pytype = ">=2024.4.11" -julep = "^0.2.4" pyjwt = "^2.8.0" ward = "^0.68.0b0" -jupyterlab = "^4.1.8" -ipywidgets = "^8.1.2" -jupyter-ai = "^2.14.1" -langchain-openai = "^0.1.6" +jupyterlab = "^4.2.4" +ipywidgets = "^8.1.3" wat-inspector = "^0.2.1" [build-system] diff --git a/agents-api/tests/fixtures.py b/agents-api/tests/fixtures.py index 323369921..188fe352b 100644 --- a/agents-api/tests/fixtures.py +++ b/agents-api/tests/fixtures.py @@ -232,7 +232,7 @@ def test_task( "name": "test task", "description": "test task about", "input_schema": {"type": "object", "additionalProperties": True}, - "main": [], + "main": [{"evaluate": {"hello": '"world"'}}], } ), client=client, diff --git a/agents-api/tests/test_execution_workflow.py b/agents-api/tests/test_execution_workflow.py index 254841075..2f6d434a3 100644 --- a/agents-api/tests/test_execution_workflow.py +++ b/agents-api/tests/test_execution_workflow.py @@ -1,18 +1,274 @@ # Tests for task queries -from ward import test +import asyncio -from agents_api.autogen.openapi_model import CreateExecutionRequest +from google.protobuf.json_format import MessageToDict +from ward import raises, test + +from agents_api.autogen.openapi_model import CreateExecutionRequest, CreateTaskRequest +from agents_api.models.task.create_task import create_task from agents_api.routers.tasks.create_task_execution import start_execution -from .fixtures import cozo_client, test_developer_id, test_task +from .fixtures import cozo_client, test_agent, test_developer_id from .utils import patch_testing_temporal -@test("workflow: create task execution") -async def _(client=cozo_client, developer_id=test_developer_id, task=test_task): +@test("workflow: evaluate step single") +async def _( + client=cozo_client, + developer_id=test_developer_id, + agent=test_agent, +): + data = CreateExecutionRequest(input={"test": "input"}) + + task = create_task( + developer_id=developer_id, + agent_id=agent.id, + data=CreateTaskRequest( + **{ + "name": "test task", + "description": "test task about", + "input_schema": {"type": "object", "additionalProperties": True}, + "main": [{"evaluate": {"hello": '"world"'}}], + } + ), + client=client, + ) + + async with patch_testing_temporal() as (_, mock_run_task_execution_workflow): + execution, handle = await start_execution( + developer_id=developer_id, + task_id=task.id, + data=data, + client=client, + ) + + assert handle is not None + assert execution.task_id == task.id + assert execution.input == data.input + mock_run_task_execution_workflow.assert_called_once() + + result = await handle.result() + assert result["hello"] == "world" + + +@test("workflow: evaluate step multiple") +async def _( + client=cozo_client, + developer_id=test_developer_id, + agent=test_agent, +): + data = CreateExecutionRequest(input={"test": "input"}) + + task = create_task( + developer_id=developer_id, + agent_id=agent.id, + data=CreateTaskRequest( + **{ + "name": "test task", + "description": "test task about", + "input_schema": {"type": "object", "additionalProperties": True}, + "main": [ + {"evaluate": {"hello": '"nope"'}}, + {"evaluate": {"hello": '"world"'}}, + ], + } + ), + client=client, + ) + + async with patch_testing_temporal() as (_, mock_run_task_execution_workflow): + execution, handle = await start_execution( + developer_id=developer_id, + task_id=task.id, + data=data, + client=client, + ) + + assert handle is not None + assert execution.task_id == task.id + assert execution.input == data.input + mock_run_task_execution_workflow.assert_called_once() + + result = await handle.result() + assert result["hello"] == "world" + + +@test("workflow: variable access in expressions") +async def _( + client=cozo_client, + developer_id=test_developer_id, + agent=test_agent, +): + data = CreateExecutionRequest(input={"test": "input"}) + + task = create_task( + developer_id=developer_id, + agent_id=agent.id, + data=CreateTaskRequest( + **{ + "name": "test task", + "description": "test task about", + "input_schema": {"type": "object", "additionalProperties": True}, + "main": [ + # Testing that we can access the input + {"evaluate": {"hello": '_["test"]'}}, + ], + } + ), + client=client, + ) + + async with patch_testing_temporal() as (_, mock_run_task_execution_workflow): + execution, handle = await start_execution( + developer_id=developer_id, + task_id=task.id, + data=data, + client=client, + ) + + assert handle is not None + assert execution.task_id == task.id + assert execution.input == data.input + mock_run_task_execution_workflow.assert_called_once() + + result = await handle.result() + assert result["hello"] == data.input["test"] + + +@test("workflow: yield step") +async def _( + client=cozo_client, + developer_id=test_developer_id, + agent=test_agent, +): + data = CreateExecutionRequest(input={"test": "input"}) + + task = create_task( + developer_id=developer_id, + agent_id=agent.id, + data=CreateTaskRequest( + **{ + "name": "test task", + "description": "test task about", + "input_schema": {"type": "object", "additionalProperties": True}, + "other_workflow": [ + # Testing that we can access the input + {"evaluate": {"hello": '_["test"]'}}, + ], + "main": [ + # Testing that we can access the input + { + "workflow": "other_workflow", + "arguments": {"test": '_["test"]'}, + }, + ], + } + ), + client=client, + ) + + async with patch_testing_temporal() as (_, mock_run_task_execution_workflow): + execution, handle = await start_execution( + developer_id=developer_id, + task_id=task.id, + data=data, + client=client, + ) + + assert handle is not None + assert execution.task_id == task.id + assert execution.input == data.input + mock_run_task_execution_workflow.assert_called_once() + + result = await handle.result() + assert result["hello"] == data.input["test"] + + +@test("workflow: sleep step") +async def _( + client=cozo_client, + developer_id=test_developer_id, + agent=test_agent, +): + data = CreateExecutionRequest(input={"test": "input"}) + + task = create_task( + developer_id=developer_id, + agent_id=agent.id, + data=CreateTaskRequest( + **{ + "name": "test task", + "description": "test task about", + "input_schema": {"type": "object", "additionalProperties": True}, + "other_workflow": [ + # Testing that we can access the input + {"evaluate": {"hello": '_["test"]'}}, + {"sleep": {"days": 5}}, + ], + "main": [ + # Testing that we can access the input + { + "workflow": "other_workflow", + "arguments": {"test": '_["test"]'}, + }, + ], + } + ), + client=client, + ) + + async with patch_testing_temporal() as (_, mock_run_task_execution_workflow): + execution, handle = await start_execution( + developer_id=developer_id, + task_id=task.id, + data=data, + client=client, + ) + + assert handle is not None + assert execution.task_id == task.id + assert execution.input == data.input + mock_run_task_execution_workflow.assert_called_once() + + result = await handle.result() + assert result["hello"] == data.input["test"] + + +@test("workflow: return step") +async def _( + client=cozo_client, + developer_id=test_developer_id, + agent=test_agent, +): data = CreateExecutionRequest(input={"test": "input"}) + task = create_task( + developer_id=developer_id, + agent_id=agent.id, + data=CreateTaskRequest( + **{ + "name": "test task", + "description": "test task about", + "input_schema": {"type": "object", "additionalProperties": True}, + "other_workflow": [ + # Testing that we can access the input + {"evaluate": {"hello": '_["test"]'}}, + {"return": {"value": '_["hello"]'}}, + {"return": {"value": '"banana"'}}, + ], + "main": [ + # Testing that we can access the input + { + "workflow": "other_workflow", + "arguments": {"test": '_["test"]'}, + }, + ], + } + ), + client=client, + ) + async with patch_testing_temporal() as (_, mock_run_task_execution_workflow): execution, handle = await start_execution( developer_id=developer_id, @@ -25,3 +281,273 @@ async def _(client=cozo_client, developer_id=test_developer_id, task=test_task): assert execution.task_id == task.id assert execution.input == data.input mock_run_task_execution_workflow.assert_called_once() + + result = await handle.result() + assert result["value"] == data.input["test"] + + +@test("workflow: log step") +async def _( + client=cozo_client, + developer_id=test_developer_id, + agent=test_agent, +): + data = CreateExecutionRequest(input={"test": "input"}) + + task = create_task( + developer_id=developer_id, + agent_id=agent.id, + data=CreateTaskRequest( + **{ + "name": "test task", + "description": "test task about", + "input_schema": {"type": "object", "additionalProperties": True}, + "other_workflow": [ + # Testing that we can access the input + {"evaluate": {"hello": '_["test"]'}}, + {"log": '_["hello"]'}, + ], + "main": [ + # Testing that we can access the input + { + "workflow": "other_workflow", + "arguments": {"test": '_["test"]'}, + }, + ], + } + ), + client=client, + ) + + async with patch_testing_temporal() as (_, mock_run_task_execution_workflow): + execution, handle = await start_execution( + developer_id=developer_id, + task_id=task.id, + data=data, + client=client, + ) + + assert handle is not None + assert execution.task_id == task.id + assert execution.input == data.input + mock_run_task_execution_workflow.assert_called_once() + + result = await handle.result() + assert result["hello"] == data.input["test"] + + +@test("workflow: log step expression fail") +async def _( + client=cozo_client, + developer_id=test_developer_id, + agent=test_agent, +): + data = CreateExecutionRequest(input={"test": "input"}) + + task = create_task( + developer_id=developer_id, + agent_id=agent.id, + data=CreateTaskRequest( + **{ + "name": "test task", + "description": "test task about", + "input_schema": {"type": "object", "additionalProperties": True}, + "other_workflow": [ + # Testing that we can access the input + {"evaluate": {"hello": '_["test"]'}}, + {"log": '_["hell"]'}, # <--- The "hell" key does not exist + ], + "main": [ + # Testing that we can access the input + { + "workflow": "other_workflow", + "arguments": {"test": '_["test"]'}, + }, + ], + } + ), + client=client, + ) + + async with patch_testing_temporal() as (_, mock_run_task_execution_workflow): + with raises(BaseException): + execution, handle = await start_execution( + developer_id=developer_id, + task_id=task.id, + data=data, + client=client, + ) + + assert handle is not None + assert execution.task_id == task.id + assert execution.input == data.input + mock_run_task_execution_workflow.assert_called_once() + + result = await handle.result() + assert result["hello"] == data.input["test"] + + +@test("workflow: wait for input step start") +async def _( + client=cozo_client, + developer_id=test_developer_id, + agent=test_agent, +): + data = CreateExecutionRequest(input={"test": "input"}) + + task = create_task( + developer_id=developer_id, + agent_id=agent.id, + data=CreateTaskRequest( + **{ + "name": "test task", + "description": "test task about", + "input_schema": {"type": "object", "additionalProperties": True}, + "main": [ + {"wait_for_input": {"hi": '"bye"'}}, + ], + } + ), + client=client, + ) + + async with patch_testing_temporal() as (_, mock_run_task_execution_workflow): + execution, handle = await start_execution( + developer_id=developer_id, + task_id=task.id, + data=data, + client=client, + ) + + assert handle is not None + assert execution.task_id == task.id + assert execution.input == data.input + mock_run_task_execution_workflow.assert_called_once() + + # Let it run for a bit + await asyncio.sleep(1) + + # Get the history + history = await handle.fetch_history() + events = [MessageToDict(e) for e in history.events] + assert len(events) > 0 + + activities_scheduled = [ + event.get("activityTaskScheduledEventAttributes", {}) + .get("activityType", {}) + .get("name") + for event in events + if "ACTIVITY_TASK_SCHEDULED" in event["eventType"] + ] + activities_scheduled = [ + activity for activity in activities_scheduled if activity + ] + + assert activities_scheduled == [ + "wait_for_input_step", + "transition_step", + "raise_complete_async", + ] + + +@test("workflow: if-else step") +async def _( + client=cozo_client, + developer_id=test_developer_id, + agent=test_agent, +): + data = CreateExecutionRequest(input={"test": "input"}) + + task = create_task( + developer_id=developer_id, + agent_id=agent.id, + data=CreateTaskRequest( + **{ + "name": "test task", + "description": "test task about", + "input_schema": {"type": "object", "additionalProperties": True}, + "main": [ + { + "if": "True", + "then": {"evaluate": {"hello": '"world"'}}, + "else": {"evaluate": {"hello": '"nope"'}}, + }, + ], + } + ), + client=client, + ) + + async with patch_testing_temporal() as (_, mock_run_task_execution_workflow): + execution, handle = await start_execution( + developer_id=developer_id, + task_id=task.id, + data=data, + client=client, + ) + + assert handle is not None + assert execution.task_id == task.id + assert execution.input == data.input + + mock_run_task_execution_workflow.assert_called_once() + + result = await handle.result() + assert result["hello"] == "world" + + +@test("workflow: switch step") +async def _( + client=cozo_client, + developer_id=test_developer_id, + agent=test_agent, +): + data = CreateExecutionRequest(input={"test": "input"}) + + task = create_task( + developer_id=developer_id, + agent_id=agent.id, + data=CreateTaskRequest( + **{ + "name": "test task", + "description": "test task about", + "input_schema": {"type": "object", "additionalProperties": True}, + "main": [ + { + "switch": [ + { + "case": "False", + "then": {"evaluate": {"hello": '"bubbles"'}}, + }, + { + "case": "True", + "then": {"evaluate": {"hello": '"world"'}}, + }, + { + "case": "True", + "then": {"evaluate": {"hello": '"bye"'}}, + }, + ] + }, + ], + } + ), + client=client, + ) + + async with patch_testing_temporal() as (_, mock_run_task_execution_workflow): + execution, handle = await start_execution( + developer_id=developer_id, + task_id=task.id, + data=data, + client=client, + ) + + assert handle is not None + assert execution.task_id == task.id + assert execution.input == data.input + + mock_run_task_execution_workflow.assert_called_once() + + result = await handle.result() + assert result["hello"] == "world" diff --git a/agents-api/tests/utils.py b/agents-api/tests/utils.py index d1be73a49..cebe84a1c 100644 --- a/agents-api/tests/utils.py +++ b/agents-api/tests/utils.py @@ -20,9 +20,11 @@ async def patch_testing_temporal(): logger.setLevel(logging.ERROR) # Start a local Temporal environment - async with await WorkflowEnvironment.start_local() as env: - # Set the correct codec - env.client._config["data_converter"] = pydantic_data_converter + async with await WorkflowEnvironment.start_time_skipping( + data_converter=pydantic_data_converter + ) as env: + # # Set the correct codec + # env.client._config["data_converter"] = pydantic_data_converter # Create a worker with our workflows and start it worker = create_worker(client=env.client) diff --git a/sdks/python/julep/api/__init__.py b/sdks/python/julep/api/__init__.py index 69e133f76..d0e7b91b4 100644 --- a/sdks/python/julep/api/__init__.py +++ b/sdks/python/julep/api/__init__.py @@ -126,54 +126,118 @@ TaskExecutionsRouteListRequestSortBy, TaskExecutionsRouteListResponse, TasksBaseWorkflowStep, + TasksCaseThen, + TasksCaseThenThen, TasksCreateTaskRequest, TasksCreateTaskRequestMainItem, + TasksCreateTaskRequestMainItem_Embed, TasksCreateTaskRequestMainItem_Error, TasksCreateTaskRequestMainItem_Evaluate, + TasksCreateTaskRequestMainItem_Foreach, + TasksCreateTaskRequestMainItem_Get, TasksCreateTaskRequestMainItem_IfElse, + TasksCreateTaskRequestMainItem_Log, + TasksCreateTaskRequestMainItem_MapReduce, + TasksCreateTaskRequestMainItem_Parallel, TasksCreateTaskRequestMainItem_Prompt, + TasksCreateTaskRequestMainItem_Return, + TasksCreateTaskRequestMainItem_Search, + TasksCreateTaskRequestMainItem_Set, + TasksCreateTaskRequestMainItem_Sleep, + TasksCreateTaskRequestMainItem_Switch, TasksCreateTaskRequestMainItem_ToolCall, TasksCreateTaskRequestMainItem_WaitForInput, TasksCreateTaskRequestMainItem_Yield, + TasksEmbedStep, TasksErrorWorkflowStep, TasksEvaluateStep, + TasksForeachDo, + TasksForeachDoDoItem, + TasksForeachStep, + TasksGetStep, TasksIfElseWorkflowStep, TasksIfElseWorkflowStepElse, TasksIfElseWorkflowStepThen, + TasksLogStep, + TasksMapOver, + TasksMapReduceStep, + TasksParallelStep, + TasksParallelStepParallelItem, TasksPatchTaskRequestMainItem, + TasksPatchTaskRequestMainItem_Embed, TasksPatchTaskRequestMainItem_Error, TasksPatchTaskRequestMainItem_Evaluate, + TasksPatchTaskRequestMainItem_Foreach, + TasksPatchTaskRequestMainItem_Get, TasksPatchTaskRequestMainItem_IfElse, + TasksPatchTaskRequestMainItem_Log, + TasksPatchTaskRequestMainItem_MapReduce, + TasksPatchTaskRequestMainItem_Parallel, TasksPatchTaskRequestMainItem_Prompt, + TasksPatchTaskRequestMainItem_Return, + TasksPatchTaskRequestMainItem_Search, + TasksPatchTaskRequestMainItem_Set, + TasksPatchTaskRequestMainItem_Sleep, + TasksPatchTaskRequestMainItem_Switch, TasksPatchTaskRequestMainItem_ToolCall, TasksPatchTaskRequestMainItem_WaitForInput, TasksPatchTaskRequestMainItem_Yield, TasksPromptStep, TasksPromptStepPrompt, + TasksReturnStep, TasksRouteListRequestDirection, TasksRouteListRequestSortBy, TasksRouteListResponse, + TasksSearchStep, + TasksSearchStepSearch, + TasksSetKey, + TasksSetStep, + TasksSetStepSet, + TasksSleepFor, + TasksSleepStep, + TasksSwitchStep, TasksTask, TasksTaskMainItem, + TasksTaskMainItem_Embed, TasksTaskMainItem_Error, TasksTaskMainItem_Evaluate, + TasksTaskMainItem_Foreach, + TasksTaskMainItem_Get, TasksTaskMainItem_IfElse, + TasksTaskMainItem_Log, + TasksTaskMainItem_MapReduce, + TasksTaskMainItem_Parallel, TasksTaskMainItem_Prompt, + TasksTaskMainItem_Return, + TasksTaskMainItem_Search, + TasksTaskMainItem_Set, + TasksTaskMainItem_Sleep, + TasksTaskMainItem_Switch, TasksTaskMainItem_ToolCall, TasksTaskMainItem_WaitForInput, TasksTaskMainItem_Yield, TasksTaskTool, TasksToolCallStep, TasksUpdateTaskRequestMainItem, + TasksUpdateTaskRequestMainItem_Embed, TasksUpdateTaskRequestMainItem_Error, TasksUpdateTaskRequestMainItem_Evaluate, + TasksUpdateTaskRequestMainItem_Foreach, + TasksUpdateTaskRequestMainItem_Get, TasksUpdateTaskRequestMainItem_IfElse, + TasksUpdateTaskRequestMainItem_Log, + TasksUpdateTaskRequestMainItem_MapReduce, + TasksUpdateTaskRequestMainItem_Parallel, TasksUpdateTaskRequestMainItem_Prompt, + TasksUpdateTaskRequestMainItem_Return, + TasksUpdateTaskRequestMainItem_Search, + TasksUpdateTaskRequestMainItem_Set, + TasksUpdateTaskRequestMainItem_Sleep, + TasksUpdateTaskRequestMainItem_Switch, TasksUpdateTaskRequestMainItem_ToolCall, TasksUpdateTaskRequestMainItem_WaitForInput, TasksUpdateTaskRequestMainItem_Yield, TasksWaitForInputStep, - TasksWaitForInputStepInfo, TasksYieldStep, ToolsChosenFunctionCall, ToolsChosenToolCall, @@ -329,54 +393,118 @@ "TaskExecutionsRouteListRequestSortBy", "TaskExecutionsRouteListResponse", "TasksBaseWorkflowStep", + "TasksCaseThen", + "TasksCaseThenThen", "TasksCreateTaskRequest", "TasksCreateTaskRequestMainItem", + "TasksCreateTaskRequestMainItem_Embed", "TasksCreateTaskRequestMainItem_Error", "TasksCreateTaskRequestMainItem_Evaluate", + "TasksCreateTaskRequestMainItem_Foreach", + "TasksCreateTaskRequestMainItem_Get", "TasksCreateTaskRequestMainItem_IfElse", + "TasksCreateTaskRequestMainItem_Log", + "TasksCreateTaskRequestMainItem_MapReduce", + "TasksCreateTaskRequestMainItem_Parallel", "TasksCreateTaskRequestMainItem_Prompt", + "TasksCreateTaskRequestMainItem_Return", + "TasksCreateTaskRequestMainItem_Search", + "TasksCreateTaskRequestMainItem_Set", + "TasksCreateTaskRequestMainItem_Sleep", + "TasksCreateTaskRequestMainItem_Switch", "TasksCreateTaskRequestMainItem_ToolCall", "TasksCreateTaskRequestMainItem_WaitForInput", "TasksCreateTaskRequestMainItem_Yield", + "TasksEmbedStep", "TasksErrorWorkflowStep", "TasksEvaluateStep", + "TasksForeachDo", + "TasksForeachDoDoItem", + "TasksForeachStep", + "TasksGetStep", "TasksIfElseWorkflowStep", "TasksIfElseWorkflowStepElse", "TasksIfElseWorkflowStepThen", + "TasksLogStep", + "TasksMapOver", + "TasksMapReduceStep", + "TasksParallelStep", + "TasksParallelStepParallelItem", "TasksPatchTaskRequestMainItem", + "TasksPatchTaskRequestMainItem_Embed", "TasksPatchTaskRequestMainItem_Error", "TasksPatchTaskRequestMainItem_Evaluate", + "TasksPatchTaskRequestMainItem_Foreach", + "TasksPatchTaskRequestMainItem_Get", "TasksPatchTaskRequestMainItem_IfElse", + "TasksPatchTaskRequestMainItem_Log", + "TasksPatchTaskRequestMainItem_MapReduce", + "TasksPatchTaskRequestMainItem_Parallel", "TasksPatchTaskRequestMainItem_Prompt", + "TasksPatchTaskRequestMainItem_Return", + "TasksPatchTaskRequestMainItem_Search", + "TasksPatchTaskRequestMainItem_Set", + "TasksPatchTaskRequestMainItem_Sleep", + "TasksPatchTaskRequestMainItem_Switch", "TasksPatchTaskRequestMainItem_ToolCall", "TasksPatchTaskRequestMainItem_WaitForInput", "TasksPatchTaskRequestMainItem_Yield", "TasksPromptStep", "TasksPromptStepPrompt", + "TasksReturnStep", "TasksRouteListRequestDirection", "TasksRouteListRequestSortBy", "TasksRouteListResponse", + "TasksSearchStep", + "TasksSearchStepSearch", + "TasksSetKey", + "TasksSetStep", + "TasksSetStepSet", + "TasksSleepFor", + "TasksSleepStep", + "TasksSwitchStep", "TasksTask", "TasksTaskMainItem", + "TasksTaskMainItem_Embed", "TasksTaskMainItem_Error", "TasksTaskMainItem_Evaluate", + "TasksTaskMainItem_Foreach", + "TasksTaskMainItem_Get", "TasksTaskMainItem_IfElse", + "TasksTaskMainItem_Log", + "TasksTaskMainItem_MapReduce", + "TasksTaskMainItem_Parallel", "TasksTaskMainItem_Prompt", + "TasksTaskMainItem_Return", + "TasksTaskMainItem_Search", + "TasksTaskMainItem_Set", + "TasksTaskMainItem_Sleep", + "TasksTaskMainItem_Switch", "TasksTaskMainItem_ToolCall", "TasksTaskMainItem_WaitForInput", "TasksTaskMainItem_Yield", "TasksTaskTool", "TasksToolCallStep", "TasksUpdateTaskRequestMainItem", + "TasksUpdateTaskRequestMainItem_Embed", "TasksUpdateTaskRequestMainItem_Error", "TasksUpdateTaskRequestMainItem_Evaluate", + "TasksUpdateTaskRequestMainItem_Foreach", + "TasksUpdateTaskRequestMainItem_Get", "TasksUpdateTaskRequestMainItem_IfElse", + "TasksUpdateTaskRequestMainItem_Log", + "TasksUpdateTaskRequestMainItem_MapReduce", + "TasksUpdateTaskRequestMainItem_Parallel", "TasksUpdateTaskRequestMainItem_Prompt", + "TasksUpdateTaskRequestMainItem_Return", + "TasksUpdateTaskRequestMainItem_Search", + "TasksUpdateTaskRequestMainItem_Set", + "TasksUpdateTaskRequestMainItem_Sleep", + "TasksUpdateTaskRequestMainItem_Switch", "TasksUpdateTaskRequestMainItem_ToolCall", "TasksUpdateTaskRequestMainItem_WaitForInput", "TasksUpdateTaskRequestMainItem_Yield", "TasksWaitForInputStep", - "TasksWaitForInputStepInfo", "TasksYieldStep", "ToolsChosenFunctionCall", "ToolsChosenToolCall", diff --git a/sdks/python/julep/api/types/__init__.py b/sdks/python/julep/api/types/__init__.py index 575f35db9..5629f5dd0 100644 --- a/sdks/python/julep/api/types/__init__.py +++ b/sdks/python/julep/api/types/__init__.py @@ -161,44 +161,98 @@ ) from .task_executions_route_list_response import TaskExecutionsRouteListResponse from .tasks_base_workflow_step import TasksBaseWorkflowStep +from .tasks_case_then import TasksCaseThen +from .tasks_case_then_then import TasksCaseThenThen from .tasks_create_task_request import TasksCreateTaskRequest from .tasks_create_task_request_main_item import ( TasksCreateTaskRequestMainItem, + TasksCreateTaskRequestMainItem_Embed, TasksCreateTaskRequestMainItem_Error, TasksCreateTaskRequestMainItem_Evaluate, + TasksCreateTaskRequestMainItem_Foreach, + TasksCreateTaskRequestMainItem_Get, TasksCreateTaskRequestMainItem_IfElse, + TasksCreateTaskRequestMainItem_Log, + TasksCreateTaskRequestMainItem_MapReduce, + TasksCreateTaskRequestMainItem_Parallel, TasksCreateTaskRequestMainItem_Prompt, + TasksCreateTaskRequestMainItem_Return, + TasksCreateTaskRequestMainItem_Search, + TasksCreateTaskRequestMainItem_Set, + TasksCreateTaskRequestMainItem_Sleep, + TasksCreateTaskRequestMainItem_Switch, TasksCreateTaskRequestMainItem_ToolCall, TasksCreateTaskRequestMainItem_WaitForInput, TasksCreateTaskRequestMainItem_Yield, ) +from .tasks_embed_step import TasksEmbedStep from .tasks_error_workflow_step import TasksErrorWorkflowStep from .tasks_evaluate_step import TasksEvaluateStep +from .tasks_foreach_do import TasksForeachDo +from .tasks_foreach_do_do_item import TasksForeachDoDoItem +from .tasks_foreach_step import TasksForeachStep +from .tasks_get_step import TasksGetStep from .tasks_if_else_workflow_step import TasksIfElseWorkflowStep from .tasks_if_else_workflow_step_else import TasksIfElseWorkflowStepElse from .tasks_if_else_workflow_step_then import TasksIfElseWorkflowStepThen +from .tasks_log_step import TasksLogStep +from .tasks_map_over import TasksMapOver +from .tasks_map_reduce_step import TasksMapReduceStep +from .tasks_parallel_step import TasksParallelStep +from .tasks_parallel_step_parallel_item import TasksParallelStepParallelItem from .tasks_patch_task_request_main_item import ( TasksPatchTaskRequestMainItem, + TasksPatchTaskRequestMainItem_Embed, TasksPatchTaskRequestMainItem_Error, TasksPatchTaskRequestMainItem_Evaluate, + TasksPatchTaskRequestMainItem_Foreach, + TasksPatchTaskRequestMainItem_Get, TasksPatchTaskRequestMainItem_IfElse, + TasksPatchTaskRequestMainItem_Log, + TasksPatchTaskRequestMainItem_MapReduce, + TasksPatchTaskRequestMainItem_Parallel, TasksPatchTaskRequestMainItem_Prompt, + TasksPatchTaskRequestMainItem_Return, + TasksPatchTaskRequestMainItem_Search, + TasksPatchTaskRequestMainItem_Set, + TasksPatchTaskRequestMainItem_Sleep, + TasksPatchTaskRequestMainItem_Switch, TasksPatchTaskRequestMainItem_ToolCall, TasksPatchTaskRequestMainItem_WaitForInput, TasksPatchTaskRequestMainItem_Yield, ) from .tasks_prompt_step import TasksPromptStep from .tasks_prompt_step_prompt import TasksPromptStepPrompt +from .tasks_return_step import TasksReturnStep from .tasks_route_list_request_direction import TasksRouteListRequestDirection from .tasks_route_list_request_sort_by import TasksRouteListRequestSortBy from .tasks_route_list_response import TasksRouteListResponse +from .tasks_search_step import TasksSearchStep +from .tasks_search_step_search import TasksSearchStepSearch +from .tasks_set_key import TasksSetKey +from .tasks_set_step import TasksSetStep +from .tasks_set_step_set import TasksSetStepSet +from .tasks_sleep_for import TasksSleepFor +from .tasks_sleep_step import TasksSleepStep +from .tasks_switch_step import TasksSwitchStep from .tasks_task import TasksTask from .tasks_task_main_item import ( TasksTaskMainItem, + TasksTaskMainItem_Embed, TasksTaskMainItem_Error, TasksTaskMainItem_Evaluate, + TasksTaskMainItem_Foreach, + TasksTaskMainItem_Get, TasksTaskMainItem_IfElse, + TasksTaskMainItem_Log, + TasksTaskMainItem_MapReduce, + TasksTaskMainItem_Parallel, TasksTaskMainItem_Prompt, + TasksTaskMainItem_Return, + TasksTaskMainItem_Search, + TasksTaskMainItem_Set, + TasksTaskMainItem_Sleep, + TasksTaskMainItem_Switch, TasksTaskMainItem_ToolCall, TasksTaskMainItem_WaitForInput, TasksTaskMainItem_Yield, @@ -207,16 +261,26 @@ from .tasks_tool_call_step import TasksToolCallStep from .tasks_update_task_request_main_item import ( TasksUpdateTaskRequestMainItem, + TasksUpdateTaskRequestMainItem_Embed, TasksUpdateTaskRequestMainItem_Error, TasksUpdateTaskRequestMainItem_Evaluate, + TasksUpdateTaskRequestMainItem_Foreach, + TasksUpdateTaskRequestMainItem_Get, TasksUpdateTaskRequestMainItem_IfElse, + TasksUpdateTaskRequestMainItem_Log, + TasksUpdateTaskRequestMainItem_MapReduce, + TasksUpdateTaskRequestMainItem_Parallel, TasksUpdateTaskRequestMainItem_Prompt, + TasksUpdateTaskRequestMainItem_Return, + TasksUpdateTaskRequestMainItem_Search, + TasksUpdateTaskRequestMainItem_Set, + TasksUpdateTaskRequestMainItem_Sleep, + TasksUpdateTaskRequestMainItem_Switch, TasksUpdateTaskRequestMainItem_ToolCall, TasksUpdateTaskRequestMainItem_WaitForInput, TasksUpdateTaskRequestMainItem_Yield, ) from .tasks_wait_for_input_step import TasksWaitForInputStep -from .tasks_wait_for_input_step_info import TasksWaitForInputStepInfo from .tasks_yield_step import TasksYieldStep from .tools_chosen_function_call import ToolsChosenFunctionCall from .tools_chosen_tool_call import ToolsChosenToolCall, ToolsChosenToolCall_Function @@ -368,54 +432,118 @@ "TaskExecutionsRouteListRequestSortBy", "TaskExecutionsRouteListResponse", "TasksBaseWorkflowStep", + "TasksCaseThen", + "TasksCaseThenThen", "TasksCreateTaskRequest", "TasksCreateTaskRequestMainItem", + "TasksCreateTaskRequestMainItem_Embed", "TasksCreateTaskRequestMainItem_Error", "TasksCreateTaskRequestMainItem_Evaluate", + "TasksCreateTaskRequestMainItem_Foreach", + "TasksCreateTaskRequestMainItem_Get", "TasksCreateTaskRequestMainItem_IfElse", + "TasksCreateTaskRequestMainItem_Log", + "TasksCreateTaskRequestMainItem_MapReduce", + "TasksCreateTaskRequestMainItem_Parallel", "TasksCreateTaskRequestMainItem_Prompt", + "TasksCreateTaskRequestMainItem_Return", + "TasksCreateTaskRequestMainItem_Search", + "TasksCreateTaskRequestMainItem_Set", + "TasksCreateTaskRequestMainItem_Sleep", + "TasksCreateTaskRequestMainItem_Switch", "TasksCreateTaskRequestMainItem_ToolCall", "TasksCreateTaskRequestMainItem_WaitForInput", "TasksCreateTaskRequestMainItem_Yield", + "TasksEmbedStep", "TasksErrorWorkflowStep", "TasksEvaluateStep", + "TasksForeachDo", + "TasksForeachDoDoItem", + "TasksForeachStep", + "TasksGetStep", "TasksIfElseWorkflowStep", "TasksIfElseWorkflowStepElse", "TasksIfElseWorkflowStepThen", + "TasksLogStep", + "TasksMapOver", + "TasksMapReduceStep", + "TasksParallelStep", + "TasksParallelStepParallelItem", "TasksPatchTaskRequestMainItem", + "TasksPatchTaskRequestMainItem_Embed", "TasksPatchTaskRequestMainItem_Error", "TasksPatchTaskRequestMainItem_Evaluate", + "TasksPatchTaskRequestMainItem_Foreach", + "TasksPatchTaskRequestMainItem_Get", "TasksPatchTaskRequestMainItem_IfElse", + "TasksPatchTaskRequestMainItem_Log", + "TasksPatchTaskRequestMainItem_MapReduce", + "TasksPatchTaskRequestMainItem_Parallel", "TasksPatchTaskRequestMainItem_Prompt", + "TasksPatchTaskRequestMainItem_Return", + "TasksPatchTaskRequestMainItem_Search", + "TasksPatchTaskRequestMainItem_Set", + "TasksPatchTaskRequestMainItem_Sleep", + "TasksPatchTaskRequestMainItem_Switch", "TasksPatchTaskRequestMainItem_ToolCall", "TasksPatchTaskRequestMainItem_WaitForInput", "TasksPatchTaskRequestMainItem_Yield", "TasksPromptStep", "TasksPromptStepPrompt", + "TasksReturnStep", "TasksRouteListRequestDirection", "TasksRouteListRequestSortBy", "TasksRouteListResponse", + "TasksSearchStep", + "TasksSearchStepSearch", + "TasksSetKey", + "TasksSetStep", + "TasksSetStepSet", + "TasksSleepFor", + "TasksSleepStep", + "TasksSwitchStep", "TasksTask", "TasksTaskMainItem", + "TasksTaskMainItem_Embed", "TasksTaskMainItem_Error", "TasksTaskMainItem_Evaluate", + "TasksTaskMainItem_Foreach", + "TasksTaskMainItem_Get", "TasksTaskMainItem_IfElse", + "TasksTaskMainItem_Log", + "TasksTaskMainItem_MapReduce", + "TasksTaskMainItem_Parallel", "TasksTaskMainItem_Prompt", + "TasksTaskMainItem_Return", + "TasksTaskMainItem_Search", + "TasksTaskMainItem_Set", + "TasksTaskMainItem_Sleep", + "TasksTaskMainItem_Switch", "TasksTaskMainItem_ToolCall", "TasksTaskMainItem_WaitForInput", "TasksTaskMainItem_Yield", "TasksTaskTool", "TasksToolCallStep", "TasksUpdateTaskRequestMainItem", + "TasksUpdateTaskRequestMainItem_Embed", "TasksUpdateTaskRequestMainItem_Error", "TasksUpdateTaskRequestMainItem_Evaluate", + "TasksUpdateTaskRequestMainItem_Foreach", + "TasksUpdateTaskRequestMainItem_Get", "TasksUpdateTaskRequestMainItem_IfElse", + "TasksUpdateTaskRequestMainItem_Log", + "TasksUpdateTaskRequestMainItem_MapReduce", + "TasksUpdateTaskRequestMainItem_Parallel", "TasksUpdateTaskRequestMainItem_Prompt", + "TasksUpdateTaskRequestMainItem_Return", + "TasksUpdateTaskRequestMainItem_Search", + "TasksUpdateTaskRequestMainItem_Set", + "TasksUpdateTaskRequestMainItem_Sleep", + "TasksUpdateTaskRequestMainItem_Switch", "TasksUpdateTaskRequestMainItem_ToolCall", "TasksUpdateTaskRequestMainItem_WaitForInput", "TasksUpdateTaskRequestMainItem_Yield", "TasksWaitForInputStep", - "TasksWaitForInputStepInfo", "TasksYieldStep", "ToolsChosenFunctionCall", "ToolsChosenToolCall", diff --git a/sdks/python/julep/api/types/executions_transition_target.py b/sdks/python/julep/api/types/executions_transition_target.py index 30b348941..5efc68e37 100644 --- a/sdks/python/julep/api/types/executions_transition_target.py +++ b/sdks/python/julep/api/types/executions_transition_target.py @@ -5,11 +5,11 @@ from ..core.datetime_utils import serialize_datetime from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -from .common_valid_python_identifier import CommonValidPythonIdentifier +from .common_identifier_safe_unicode import CommonIdentifierSafeUnicode class ExecutionsTransitionTarget(pydantic_v1.BaseModel): - workflow: CommonValidPythonIdentifier + workflow: CommonIdentifierSafeUnicode step: int def json(self, **kwargs: typing.Any) -> str: diff --git a/sdks/python/julep/api/types/tasks_case_then.py b/sdks/python/julep/api/types/tasks_case_then.py new file mode 100644 index 000000000..1ab5ac484 --- /dev/null +++ b/sdks/python/julep/api/types/tasks_case_then.py @@ -0,0 +1,52 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .common_py_expression import CommonPyExpression +from .tasks_case_then_then import TasksCaseThenThen + + +class TasksCaseThen(pydantic_v1.BaseModel): + case: CommonPyExpression = pydantic_v1.Field() + """ + The condition to evaluate + """ + + then: TasksCaseThenThen = pydantic_v1.Field() + """ + The steps to run if the condition is true + """ + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tasks_case_then_then.py b/sdks/python/julep/api/types/tasks_case_then_then.py new file mode 100644 index 000000000..3680b8720 --- /dev/null +++ b/sdks/python/julep/api/types/tasks_case_then_then.py @@ -0,0 +1,32 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .tasks_embed_step import TasksEmbedStep +from .tasks_error_workflow_step import TasksErrorWorkflowStep +from .tasks_get_step import TasksGetStep +from .tasks_log_step import TasksLogStep +from .tasks_prompt_step import TasksPromptStep +from .tasks_return_step import TasksReturnStep +from .tasks_search_step import TasksSearchStep +from .tasks_set_step import TasksSetStep +from .tasks_sleep_step import TasksSleepStep +from .tasks_tool_call_step import TasksToolCallStep +from .tasks_wait_for_input_step import TasksWaitForInputStep +from .tasks_yield_step import TasksYieldStep + +TasksCaseThenThen = typing.Union[ + typing.Any, + TasksToolCallStep, + TasksYieldStep, + TasksPromptStep, + TasksErrorWorkflowStep, + TasksSleepStep, + TasksReturnStep, + TasksGetStep, + TasksSetStep, + TasksLogStep, + TasksEmbedStep, + TasksSearchStep, + TasksWaitForInputStep, +] diff --git a/sdks/python/julep/api/types/tasks_create_task_request_main_item.py b/sdks/python/julep/api/types/tasks_create_task_request_main_item.py index ae9916c31..5b85a9236 100644 --- a/sdks/python/julep/api/types/tasks_create_task_request_main_item.py +++ b/sdks/python/julep/api/types/tasks_create_task_request_main_item.py @@ -10,10 +10,17 @@ from .chat_chat_settings import ChatChatSettings from .common_py_expression import CommonPyExpression from .common_tool_ref import CommonToolRef +from .docs_embed_query_request import DocsEmbedQueryRequest +from .tasks_case_then import TasksCaseThen +from .tasks_foreach_do import TasksForeachDo from .tasks_if_else_workflow_step_else import TasksIfElseWorkflowStepElse from .tasks_if_else_workflow_step_then import TasksIfElseWorkflowStepThen +from .tasks_map_over import TasksMapOver +from .tasks_parallel_step_parallel_item import TasksParallelStepParallelItem from .tasks_prompt_step_prompt import TasksPromptStepPrompt -from .tasks_wait_for_input_step_info import TasksWaitForInputStepInfo +from .tasks_search_step_search import TasksSearchStepSearch +from .tasks_set_step_set import TasksSetStepSet +from .tasks_sleep_for import TasksSleepFor class TasksCreateTaskRequestMainItem_Evaluate(pydantic_v1.BaseModel): @@ -213,8 +220,274 @@ class Config: json_encoders = {dt.datetime: serialize_datetime} +class TasksCreateTaskRequestMainItem_Sleep(pydantic_v1.BaseModel): + sleep: TasksSleepFor + kind: typing.Literal["sleep"] = pydantic_v1.Field(alias="kind_", default="sleep") + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + +class TasksCreateTaskRequestMainItem_Return(pydantic_v1.BaseModel): + return_: typing.Dict[str, CommonPyExpression] = pydantic_v1.Field(alias="return") + kind: typing.Literal["return"] = pydantic_v1.Field(alias="kind_", default="return") + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + +class TasksCreateTaskRequestMainItem_Get(pydantic_v1.BaseModel): + get: str + kind: typing.Literal["get"] = pydantic_v1.Field(alias="kind_", default="get") + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + +class TasksCreateTaskRequestMainItem_Set(pydantic_v1.BaseModel): + set_: TasksSetStepSet = pydantic_v1.Field(alias="set") + kind: typing.Literal["set"] = pydantic_v1.Field(alias="kind_", default="set") + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + +class TasksCreateTaskRequestMainItem_Log(pydantic_v1.BaseModel): + log: CommonPyExpression + kind: typing.Literal["log"] = pydantic_v1.Field(alias="kind_", default="log") + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + +class TasksCreateTaskRequestMainItem_Embed(pydantic_v1.BaseModel): + embed: DocsEmbedQueryRequest + kind: typing.Literal["embed"] = pydantic_v1.Field(alias="kind_", default="embed") + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + +class TasksCreateTaskRequestMainItem_Search(pydantic_v1.BaseModel): + search: TasksSearchStepSearch + kind: typing.Literal["search"] = pydantic_v1.Field(alias="kind_", default="search") + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + class TasksCreateTaskRequestMainItem_WaitForInput(pydantic_v1.BaseModel): - info: TasksWaitForInputStepInfo + wait_for_input: typing.Dict[str, CommonPyExpression] kind: typing.Literal["wait_for_input"] = pydantic_v1.Field( alias="kind_", default="wait_for_input" ) @@ -295,12 +568,182 @@ class Config: json_encoders = {dt.datetime: serialize_datetime} +class TasksCreateTaskRequestMainItem_Switch(pydantic_v1.BaseModel): + switch: typing.List[TasksCaseThen] + kind: typing.Literal["switch"] = pydantic_v1.Field(alias="kind_", default="switch") + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + +class TasksCreateTaskRequestMainItem_Foreach(pydantic_v1.BaseModel): + foreach: TasksForeachDo + kind: typing.Literal["foreach"] = pydantic_v1.Field( + alias="kind_", default="foreach" + ) + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + +class TasksCreateTaskRequestMainItem_Parallel(pydantic_v1.BaseModel): + parallel: typing.List[TasksParallelStepParallelItem] + kind: typing.Literal["parallel"] = pydantic_v1.Field( + alias="kind_", default="parallel" + ) + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + +class TasksCreateTaskRequestMainItem_MapReduce(pydantic_v1.BaseModel): + map_: TasksMapOver = pydantic_v1.Field(alias="map") + reduce: CommonPyExpression + kind: typing.Literal["map_reduce"] = pydantic_v1.Field( + alias="kind_", default="map_reduce" + ) + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + TasksCreateTaskRequestMainItem = typing.Union[ TasksCreateTaskRequestMainItem_Evaluate, TasksCreateTaskRequestMainItem_ToolCall, TasksCreateTaskRequestMainItem_Yield, TasksCreateTaskRequestMainItem_Prompt, TasksCreateTaskRequestMainItem_Error, + TasksCreateTaskRequestMainItem_Sleep, + TasksCreateTaskRequestMainItem_Return, + TasksCreateTaskRequestMainItem_Get, + TasksCreateTaskRequestMainItem_Set, + TasksCreateTaskRequestMainItem_Log, + TasksCreateTaskRequestMainItem_Embed, + TasksCreateTaskRequestMainItem_Search, TasksCreateTaskRequestMainItem_WaitForInput, TasksCreateTaskRequestMainItem_IfElse, + TasksCreateTaskRequestMainItem_Switch, + TasksCreateTaskRequestMainItem_Foreach, + TasksCreateTaskRequestMainItem_Parallel, + TasksCreateTaskRequestMainItem_MapReduce, ] diff --git a/sdks/python/julep/api/types/tasks_embed_step.py b/sdks/python/julep/api/types/tasks_embed_step.py new file mode 100644 index 000000000..13e9bcfd8 --- /dev/null +++ b/sdks/python/julep/api/types/tasks_embed_step.py @@ -0,0 +1,49 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .docs_embed_query_request import DocsEmbedQueryRequest +from .tasks_base_workflow_step import TasksBaseWorkflowStep + + +class TasksEmbedStep(TasksBaseWorkflowStep): + embed: DocsEmbedQueryRequest = pydantic_v1.Field() + """ + The text to embed + """ + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tasks_foreach_do.py b/sdks/python/julep/api/types/tasks_foreach_do.py new file mode 100644 index 000000000..8ee662103 --- /dev/null +++ b/sdks/python/julep/api/types/tasks_foreach_do.py @@ -0,0 +1,54 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .common_py_expression import CommonPyExpression +from .tasks_foreach_do_do_item import TasksForeachDoDoItem + + +class TasksForeachDo(pydantic_v1.BaseModel): + in_: CommonPyExpression = pydantic_v1.Field(alias="in") + """ + The variable to iterate over + """ + + do: typing.List[TasksForeachDoDoItem] = pydantic_v1.Field() + """ + The steps to run for each iteration + """ + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tasks_foreach_do_do_item.py b/sdks/python/julep/api/types/tasks_foreach_do_do_item.py new file mode 100644 index 000000000..f8c2a90bf --- /dev/null +++ b/sdks/python/julep/api/types/tasks_foreach_do_do_item.py @@ -0,0 +1,32 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .tasks_embed_step import TasksEmbedStep +from .tasks_error_workflow_step import TasksErrorWorkflowStep +from .tasks_get_step import TasksGetStep +from .tasks_log_step import TasksLogStep +from .tasks_prompt_step import TasksPromptStep +from .tasks_return_step import TasksReturnStep +from .tasks_search_step import TasksSearchStep +from .tasks_set_step import TasksSetStep +from .tasks_sleep_step import TasksSleepStep +from .tasks_tool_call_step import TasksToolCallStep +from .tasks_wait_for_input_step import TasksWaitForInputStep +from .tasks_yield_step import TasksYieldStep + +TasksForeachDoDoItem = typing.Union[ + typing.Any, + TasksToolCallStep, + TasksYieldStep, + TasksPromptStep, + TasksErrorWorkflowStep, + TasksSleepStep, + TasksReturnStep, + TasksGetStep, + TasksSetStep, + TasksLogStep, + TasksEmbedStep, + TasksSearchStep, + TasksWaitForInputStep, +] diff --git a/sdks/python/julep/api/types/tasks_foreach_step.py b/sdks/python/julep/api/types/tasks_foreach_step.py new file mode 100644 index 000000000..03c86dce2 --- /dev/null +++ b/sdks/python/julep/api/types/tasks_foreach_step.py @@ -0,0 +1,49 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .tasks_base_workflow_step import TasksBaseWorkflowStep +from .tasks_foreach_do import TasksForeachDo + + +class TasksForeachStep(TasksBaseWorkflowStep): + foreach: TasksForeachDo = pydantic_v1.Field() + """ + The steps to run for each iteration + """ + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tasks_get_step.py b/sdks/python/julep/api/types/tasks_get_step.py new file mode 100644 index 000000000..c6fa9748e --- /dev/null +++ b/sdks/python/julep/api/types/tasks_get_step.py @@ -0,0 +1,48 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .tasks_base_workflow_step import TasksBaseWorkflowStep + + +class TasksGetStep(TasksBaseWorkflowStep): + get: str = pydantic_v1.Field() + """ + The key to get + """ + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tasks_if_else_workflow_step_else.py b/sdks/python/julep/api/types/tasks_if_else_workflow_step_else.py index 37d64c117..754449134 100644 --- a/sdks/python/julep/api/types/tasks_if_else_workflow_step_else.py +++ b/sdks/python/julep/api/types/tasks_if_else_workflow_step_else.py @@ -2,8 +2,15 @@ import typing +from .tasks_embed_step import TasksEmbedStep from .tasks_error_workflow_step import TasksErrorWorkflowStep +from .tasks_get_step import TasksGetStep +from .tasks_log_step import TasksLogStep from .tasks_prompt_step import TasksPromptStep +from .tasks_return_step import TasksReturnStep +from .tasks_search_step import TasksSearchStep +from .tasks_set_step import TasksSetStep +from .tasks_sleep_step import TasksSleepStep from .tasks_tool_call_step import TasksToolCallStep from .tasks_wait_for_input_step import TasksWaitForInputStep from .tasks_yield_step import TasksYieldStep @@ -14,5 +21,12 @@ TasksYieldStep, TasksPromptStep, TasksErrorWorkflowStep, + TasksSleepStep, + TasksReturnStep, + TasksGetStep, + TasksSetStep, + TasksLogStep, + TasksEmbedStep, + TasksSearchStep, TasksWaitForInputStep, ] diff --git a/sdks/python/julep/api/types/tasks_if_else_workflow_step_then.py b/sdks/python/julep/api/types/tasks_if_else_workflow_step_then.py index a706d4c86..9e914c54d 100644 --- a/sdks/python/julep/api/types/tasks_if_else_workflow_step_then.py +++ b/sdks/python/julep/api/types/tasks_if_else_workflow_step_then.py @@ -2,8 +2,15 @@ import typing +from .tasks_embed_step import TasksEmbedStep from .tasks_error_workflow_step import TasksErrorWorkflowStep +from .tasks_get_step import TasksGetStep +from .tasks_log_step import TasksLogStep from .tasks_prompt_step import TasksPromptStep +from .tasks_return_step import TasksReturnStep +from .tasks_search_step import TasksSearchStep +from .tasks_set_step import TasksSetStep +from .tasks_sleep_step import TasksSleepStep from .tasks_tool_call_step import TasksToolCallStep from .tasks_wait_for_input_step import TasksWaitForInputStep from .tasks_yield_step import TasksYieldStep @@ -14,5 +21,12 @@ TasksYieldStep, TasksPromptStep, TasksErrorWorkflowStep, + TasksSleepStep, + TasksReturnStep, + TasksGetStep, + TasksSetStep, + TasksLogStep, + TasksEmbedStep, + TasksSearchStep, TasksWaitForInputStep, ] diff --git a/sdks/python/julep/api/types/tasks_log_step.py b/sdks/python/julep/api/types/tasks_log_step.py new file mode 100644 index 000000000..649a8471d --- /dev/null +++ b/sdks/python/julep/api/types/tasks_log_step.py @@ -0,0 +1,49 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .common_py_expression import CommonPyExpression +from .tasks_base_workflow_step import TasksBaseWorkflowStep + + +class TasksLogStep(TasksBaseWorkflowStep): + log: CommonPyExpression = pydantic_v1.Field() + """ + The value to log + """ + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tasks_map_over.py b/sdks/python/julep/api/types/tasks_map_over.py new file mode 100644 index 000000000..d3377ff00 --- /dev/null +++ b/sdks/python/julep/api/types/tasks_map_over.py @@ -0,0 +1,51 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .common_py_expression import CommonPyExpression + + +class TasksMapOver(pydantic_v1.BaseModel): + over: CommonPyExpression = pydantic_v1.Field() + """ + The variable to iterate over + """ + + workflow: str = pydantic_v1.Field() + """ + The subworkflow to run for each iteration + """ + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tasks_map_reduce_step.py b/sdks/python/julep/api/types/tasks_map_reduce_step.py new file mode 100644 index 000000000..9d43304d5 --- /dev/null +++ b/sdks/python/julep/api/types/tasks_map_reduce_step.py @@ -0,0 +1,55 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .common_py_expression import CommonPyExpression +from .tasks_base_workflow_step import TasksBaseWorkflowStep +from .tasks_map_over import TasksMapOver + + +class TasksMapReduceStep(TasksBaseWorkflowStep): + map_: TasksMapOver = pydantic_v1.Field(alias="map") + """ + The steps to run for each iteration + """ + + reduce: CommonPyExpression = pydantic_v1.Field() + """ + The expression to reduce the results (`_` is a list of outputs) + """ + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tasks_parallel_step.py b/sdks/python/julep/api/types/tasks_parallel_step.py new file mode 100644 index 000000000..7f3ba3bad --- /dev/null +++ b/sdks/python/julep/api/types/tasks_parallel_step.py @@ -0,0 +1,49 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .tasks_base_workflow_step import TasksBaseWorkflowStep +from .tasks_parallel_step_parallel_item import TasksParallelStepParallelItem + + +class TasksParallelStep(TasksBaseWorkflowStep): + parallel: typing.List[TasksParallelStepParallelItem] = pydantic_v1.Field() + """ + The steps to run in parallel. Max concurrency will depend on the platform + """ + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tasks_parallel_step_parallel_item.py b/sdks/python/julep/api/types/tasks_parallel_step_parallel_item.py new file mode 100644 index 000000000..0b881fed7 --- /dev/null +++ b/sdks/python/julep/api/types/tasks_parallel_step_parallel_item.py @@ -0,0 +1,32 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .tasks_embed_step import TasksEmbedStep +from .tasks_error_workflow_step import TasksErrorWorkflowStep +from .tasks_get_step import TasksGetStep +from .tasks_log_step import TasksLogStep +from .tasks_prompt_step import TasksPromptStep +from .tasks_return_step import TasksReturnStep +from .tasks_search_step import TasksSearchStep +from .tasks_set_step import TasksSetStep +from .tasks_sleep_step import TasksSleepStep +from .tasks_tool_call_step import TasksToolCallStep +from .tasks_wait_for_input_step import TasksWaitForInputStep +from .tasks_yield_step import TasksYieldStep + +TasksParallelStepParallelItem = typing.Union[ + typing.Any, + TasksToolCallStep, + TasksYieldStep, + TasksPromptStep, + TasksErrorWorkflowStep, + TasksSleepStep, + TasksReturnStep, + TasksGetStep, + TasksSetStep, + TasksLogStep, + TasksEmbedStep, + TasksSearchStep, + TasksWaitForInputStep, +] diff --git a/sdks/python/julep/api/types/tasks_patch_task_request_main_item.py b/sdks/python/julep/api/types/tasks_patch_task_request_main_item.py index 6532321d0..112eeff32 100644 --- a/sdks/python/julep/api/types/tasks_patch_task_request_main_item.py +++ b/sdks/python/julep/api/types/tasks_patch_task_request_main_item.py @@ -10,10 +10,17 @@ from .chat_chat_settings import ChatChatSettings from .common_py_expression import CommonPyExpression from .common_tool_ref import CommonToolRef +from .docs_embed_query_request import DocsEmbedQueryRequest +from .tasks_case_then import TasksCaseThen +from .tasks_foreach_do import TasksForeachDo from .tasks_if_else_workflow_step_else import TasksIfElseWorkflowStepElse from .tasks_if_else_workflow_step_then import TasksIfElseWorkflowStepThen +from .tasks_map_over import TasksMapOver +from .tasks_parallel_step_parallel_item import TasksParallelStepParallelItem from .tasks_prompt_step_prompt import TasksPromptStepPrompt -from .tasks_wait_for_input_step_info import TasksWaitForInputStepInfo +from .tasks_search_step_search import TasksSearchStepSearch +from .tasks_set_step_set import TasksSetStepSet +from .tasks_sleep_for import TasksSleepFor class TasksPatchTaskRequestMainItem_Evaluate(pydantic_v1.BaseModel): @@ -213,8 +220,274 @@ class Config: json_encoders = {dt.datetime: serialize_datetime} +class TasksPatchTaskRequestMainItem_Sleep(pydantic_v1.BaseModel): + sleep: TasksSleepFor + kind: typing.Literal["sleep"] = pydantic_v1.Field(alias="kind_", default="sleep") + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + +class TasksPatchTaskRequestMainItem_Return(pydantic_v1.BaseModel): + return_: typing.Dict[str, CommonPyExpression] = pydantic_v1.Field(alias="return") + kind: typing.Literal["return"] = pydantic_v1.Field(alias="kind_", default="return") + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + +class TasksPatchTaskRequestMainItem_Get(pydantic_v1.BaseModel): + get: str + kind: typing.Literal["get"] = pydantic_v1.Field(alias="kind_", default="get") + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + +class TasksPatchTaskRequestMainItem_Set(pydantic_v1.BaseModel): + set_: TasksSetStepSet = pydantic_v1.Field(alias="set") + kind: typing.Literal["set"] = pydantic_v1.Field(alias="kind_", default="set") + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + +class TasksPatchTaskRequestMainItem_Log(pydantic_v1.BaseModel): + log: CommonPyExpression + kind: typing.Literal["log"] = pydantic_v1.Field(alias="kind_", default="log") + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + +class TasksPatchTaskRequestMainItem_Embed(pydantic_v1.BaseModel): + embed: DocsEmbedQueryRequest + kind: typing.Literal["embed"] = pydantic_v1.Field(alias="kind_", default="embed") + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + +class TasksPatchTaskRequestMainItem_Search(pydantic_v1.BaseModel): + search: TasksSearchStepSearch + kind: typing.Literal["search"] = pydantic_v1.Field(alias="kind_", default="search") + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + class TasksPatchTaskRequestMainItem_WaitForInput(pydantic_v1.BaseModel): - info: TasksWaitForInputStepInfo + wait_for_input: typing.Dict[str, CommonPyExpression] kind: typing.Literal["wait_for_input"] = pydantic_v1.Field( alias="kind_", default="wait_for_input" ) @@ -295,12 +568,182 @@ class Config: json_encoders = {dt.datetime: serialize_datetime} +class TasksPatchTaskRequestMainItem_Switch(pydantic_v1.BaseModel): + switch: typing.List[TasksCaseThen] + kind: typing.Literal["switch"] = pydantic_v1.Field(alias="kind_", default="switch") + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + +class TasksPatchTaskRequestMainItem_Foreach(pydantic_v1.BaseModel): + foreach: TasksForeachDo + kind: typing.Literal["foreach"] = pydantic_v1.Field( + alias="kind_", default="foreach" + ) + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + +class TasksPatchTaskRequestMainItem_Parallel(pydantic_v1.BaseModel): + parallel: typing.List[TasksParallelStepParallelItem] + kind: typing.Literal["parallel"] = pydantic_v1.Field( + alias="kind_", default="parallel" + ) + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + +class TasksPatchTaskRequestMainItem_MapReduce(pydantic_v1.BaseModel): + map_: TasksMapOver = pydantic_v1.Field(alias="map") + reduce: CommonPyExpression + kind: typing.Literal["map_reduce"] = pydantic_v1.Field( + alias="kind_", default="map_reduce" + ) + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + TasksPatchTaskRequestMainItem = typing.Union[ TasksPatchTaskRequestMainItem_Evaluate, TasksPatchTaskRequestMainItem_ToolCall, TasksPatchTaskRequestMainItem_Yield, TasksPatchTaskRequestMainItem_Prompt, TasksPatchTaskRequestMainItem_Error, + TasksPatchTaskRequestMainItem_Sleep, + TasksPatchTaskRequestMainItem_Return, + TasksPatchTaskRequestMainItem_Get, + TasksPatchTaskRequestMainItem_Set, + TasksPatchTaskRequestMainItem_Log, + TasksPatchTaskRequestMainItem_Embed, + TasksPatchTaskRequestMainItem_Search, TasksPatchTaskRequestMainItem_WaitForInput, TasksPatchTaskRequestMainItem_IfElse, + TasksPatchTaskRequestMainItem_Switch, + TasksPatchTaskRequestMainItem_Foreach, + TasksPatchTaskRequestMainItem_Parallel, + TasksPatchTaskRequestMainItem_MapReduce, ] diff --git a/sdks/python/julep/api/types/tasks_return_step.py b/sdks/python/julep/api/types/tasks_return_step.py new file mode 100644 index 000000000..33aed561e --- /dev/null +++ b/sdks/python/julep/api/types/tasks_return_step.py @@ -0,0 +1,49 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .common_py_expression import CommonPyExpression +from .tasks_base_workflow_step import TasksBaseWorkflowStep + + +class TasksReturnStep(TasksBaseWorkflowStep): + return_: typing.Dict[str, CommonPyExpression] = pydantic_v1.Field(alias="return") + """ + The value to return + """ + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tasks_search_step.py b/sdks/python/julep/api/types/tasks_search_step.py new file mode 100644 index 000000000..82d0a1658 --- /dev/null +++ b/sdks/python/julep/api/types/tasks_search_step.py @@ -0,0 +1,49 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .tasks_base_workflow_step import TasksBaseWorkflowStep +from .tasks_search_step_search import TasksSearchStepSearch + + +class TasksSearchStep(TasksBaseWorkflowStep): + search: TasksSearchStepSearch = pydantic_v1.Field() + """ + The search query + """ + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tasks_search_step_search.py b/sdks/python/julep/api/types/tasks_search_step_search.py new file mode 100644 index 000000000..678e79d5f --- /dev/null +++ b/sdks/python/julep/api/types/tasks_search_step_search.py @@ -0,0 +1,11 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .docs_hybrid_doc_search_request import DocsHybridDocSearchRequest +from .docs_text_only_doc_search_request import DocsTextOnlyDocSearchRequest +from .docs_vector_doc_search_request import DocsVectorDocSearchRequest + +TasksSearchStepSearch = typing.Union[ + DocsVectorDocSearchRequest, DocsTextOnlyDocSearchRequest, DocsHybridDocSearchRequest +] diff --git a/sdks/python/julep/api/types/tasks_set_key.py b/sdks/python/julep/api/types/tasks_set_key.py new file mode 100644 index 000000000..c925599a2 --- /dev/null +++ b/sdks/python/julep/api/types/tasks_set_key.py @@ -0,0 +1,51 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .common_py_expression import CommonPyExpression + + +class TasksSetKey(pydantic_v1.BaseModel): + key: str = pydantic_v1.Field() + """ + The key to set + """ + + value: CommonPyExpression = pydantic_v1.Field() + """ + The value to set + """ + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tasks_set_step.py b/sdks/python/julep/api/types/tasks_set_step.py new file mode 100644 index 000000000..c718d4e7a --- /dev/null +++ b/sdks/python/julep/api/types/tasks_set_step.py @@ -0,0 +1,49 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .tasks_base_workflow_step import TasksBaseWorkflowStep +from .tasks_set_step_set import TasksSetStepSet + + +class TasksSetStep(TasksBaseWorkflowStep): + set_: TasksSetStepSet = pydantic_v1.Field(alias="set") + """ + The value to set + """ + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tasks_set_step_set.py b/sdks/python/julep/api/types/tasks_set_step_set.py new file mode 100644 index 000000000..0b5c955c1 --- /dev/null +++ b/sdks/python/julep/api/types/tasks_set_step_set.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .tasks_set_key import TasksSetKey + +TasksSetStepSet = typing.Union[TasksSetKey, typing.List[TasksSetKey]] diff --git a/sdks/python/julep/api/types/tasks_sleep_for.py b/sdks/python/julep/api/types/tasks_sleep_for.py new file mode 100644 index 000000000..44a3acd32 --- /dev/null +++ b/sdks/python/julep/api/types/tasks_sleep_for.py @@ -0,0 +1,60 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 + + +class TasksSleepFor(pydantic_v1.BaseModel): + seconds: int = pydantic_v1.Field() + """ + The number of seconds to sleep for + """ + + minutes: int = pydantic_v1.Field() + """ + The number of minutes to sleep for + """ + + hours: int = pydantic_v1.Field() + """ + The number of hours to sleep for + """ + + days: int = pydantic_v1.Field() + """ + The number of days to sleep for + """ + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tasks_sleep_step.py b/sdks/python/julep/api/types/tasks_sleep_step.py new file mode 100644 index 000000000..5261bad5f --- /dev/null +++ b/sdks/python/julep/api/types/tasks_sleep_step.py @@ -0,0 +1,49 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .tasks_base_workflow_step import TasksBaseWorkflowStep +from .tasks_sleep_for import TasksSleepFor + + +class TasksSleepStep(TasksBaseWorkflowStep): + sleep: TasksSleepFor = pydantic_v1.Field() + """ + The duration to sleep for + """ + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tasks_switch_step.py b/sdks/python/julep/api/types/tasks_switch_step.py new file mode 100644 index 000000000..0a83a8185 --- /dev/null +++ b/sdks/python/julep/api/types/tasks_switch_step.py @@ -0,0 +1,49 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .tasks_base_workflow_step import TasksBaseWorkflowStep +from .tasks_case_then import TasksCaseThen + + +class TasksSwitchStep(TasksBaseWorkflowStep): + switch: typing.List[TasksCaseThen] = pydantic_v1.Field() + """ + The cond tree + """ + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tasks_task_main_item.py b/sdks/python/julep/api/types/tasks_task_main_item.py index 41cda3d7d..4446fe298 100644 --- a/sdks/python/julep/api/types/tasks_task_main_item.py +++ b/sdks/python/julep/api/types/tasks_task_main_item.py @@ -10,10 +10,17 @@ from .chat_chat_settings import ChatChatSettings from .common_py_expression import CommonPyExpression from .common_tool_ref import CommonToolRef +from .docs_embed_query_request import DocsEmbedQueryRequest +from .tasks_case_then import TasksCaseThen +from .tasks_foreach_do import TasksForeachDo from .tasks_if_else_workflow_step_else import TasksIfElseWorkflowStepElse from .tasks_if_else_workflow_step_then import TasksIfElseWorkflowStepThen +from .tasks_map_over import TasksMapOver +from .tasks_parallel_step_parallel_item import TasksParallelStepParallelItem from .tasks_prompt_step_prompt import TasksPromptStepPrompt -from .tasks_wait_for_input_step_info import TasksWaitForInputStepInfo +from .tasks_search_step_search import TasksSearchStepSearch +from .tasks_set_step_set import TasksSetStepSet +from .tasks_sleep_for import TasksSleepFor class TasksTaskMainItem_Evaluate(pydantic_v1.BaseModel): @@ -213,8 +220,274 @@ class Config: json_encoders = {dt.datetime: serialize_datetime} +class TasksTaskMainItem_Sleep(pydantic_v1.BaseModel): + sleep: TasksSleepFor + kind: typing.Literal["sleep"] = pydantic_v1.Field(alias="kind_", default="sleep") + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + +class TasksTaskMainItem_Return(pydantic_v1.BaseModel): + return_: typing.Dict[str, CommonPyExpression] = pydantic_v1.Field(alias="return") + kind: typing.Literal["return"] = pydantic_v1.Field(alias="kind_", default="return") + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + +class TasksTaskMainItem_Get(pydantic_v1.BaseModel): + get: str + kind: typing.Literal["get"] = pydantic_v1.Field(alias="kind_", default="get") + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + +class TasksTaskMainItem_Set(pydantic_v1.BaseModel): + set_: TasksSetStepSet = pydantic_v1.Field(alias="set") + kind: typing.Literal["set"] = pydantic_v1.Field(alias="kind_", default="set") + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + +class TasksTaskMainItem_Log(pydantic_v1.BaseModel): + log: CommonPyExpression + kind: typing.Literal["log"] = pydantic_v1.Field(alias="kind_", default="log") + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + +class TasksTaskMainItem_Embed(pydantic_v1.BaseModel): + embed: DocsEmbedQueryRequest + kind: typing.Literal["embed"] = pydantic_v1.Field(alias="kind_", default="embed") + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + +class TasksTaskMainItem_Search(pydantic_v1.BaseModel): + search: TasksSearchStepSearch + kind: typing.Literal["search"] = pydantic_v1.Field(alias="kind_", default="search") + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + class TasksTaskMainItem_WaitForInput(pydantic_v1.BaseModel): - info: TasksWaitForInputStepInfo + wait_for_input: typing.Dict[str, CommonPyExpression] kind: typing.Literal["wait_for_input"] = pydantic_v1.Field( alias="kind_", default="wait_for_input" ) @@ -295,12 +568,182 @@ class Config: json_encoders = {dt.datetime: serialize_datetime} +class TasksTaskMainItem_Switch(pydantic_v1.BaseModel): + switch: typing.List[TasksCaseThen] + kind: typing.Literal["switch"] = pydantic_v1.Field(alias="kind_", default="switch") + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + +class TasksTaskMainItem_Foreach(pydantic_v1.BaseModel): + foreach: TasksForeachDo + kind: typing.Literal["foreach"] = pydantic_v1.Field( + alias="kind_", default="foreach" + ) + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + +class TasksTaskMainItem_Parallel(pydantic_v1.BaseModel): + parallel: typing.List[TasksParallelStepParallelItem] + kind: typing.Literal["parallel"] = pydantic_v1.Field( + alias="kind_", default="parallel" + ) + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + +class TasksTaskMainItem_MapReduce(pydantic_v1.BaseModel): + map_: TasksMapOver = pydantic_v1.Field(alias="map") + reduce: CommonPyExpression + kind: typing.Literal["map_reduce"] = pydantic_v1.Field( + alias="kind_", default="map_reduce" + ) + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + TasksTaskMainItem = typing.Union[ TasksTaskMainItem_Evaluate, TasksTaskMainItem_ToolCall, TasksTaskMainItem_Yield, TasksTaskMainItem_Prompt, TasksTaskMainItem_Error, + TasksTaskMainItem_Sleep, + TasksTaskMainItem_Return, + TasksTaskMainItem_Get, + TasksTaskMainItem_Set, + TasksTaskMainItem_Log, + TasksTaskMainItem_Embed, + TasksTaskMainItem_Search, TasksTaskMainItem_WaitForInput, TasksTaskMainItem_IfElse, + TasksTaskMainItem_Switch, + TasksTaskMainItem_Foreach, + TasksTaskMainItem_Parallel, + TasksTaskMainItem_MapReduce, ] diff --git a/sdks/python/julep/api/types/tasks_update_task_request_main_item.py b/sdks/python/julep/api/types/tasks_update_task_request_main_item.py index 730545283..5d50ee656 100644 --- a/sdks/python/julep/api/types/tasks_update_task_request_main_item.py +++ b/sdks/python/julep/api/types/tasks_update_task_request_main_item.py @@ -10,10 +10,17 @@ from .chat_chat_settings import ChatChatSettings from .common_py_expression import CommonPyExpression from .common_tool_ref import CommonToolRef +from .docs_embed_query_request import DocsEmbedQueryRequest +from .tasks_case_then import TasksCaseThen +from .tasks_foreach_do import TasksForeachDo from .tasks_if_else_workflow_step_else import TasksIfElseWorkflowStepElse from .tasks_if_else_workflow_step_then import TasksIfElseWorkflowStepThen +from .tasks_map_over import TasksMapOver +from .tasks_parallel_step_parallel_item import TasksParallelStepParallelItem from .tasks_prompt_step_prompt import TasksPromptStepPrompt -from .tasks_wait_for_input_step_info import TasksWaitForInputStepInfo +from .tasks_search_step_search import TasksSearchStepSearch +from .tasks_set_step_set import TasksSetStepSet +from .tasks_sleep_for import TasksSleepFor class TasksUpdateTaskRequestMainItem_Evaluate(pydantic_v1.BaseModel): @@ -213,8 +220,274 @@ class Config: json_encoders = {dt.datetime: serialize_datetime} +class TasksUpdateTaskRequestMainItem_Sleep(pydantic_v1.BaseModel): + sleep: TasksSleepFor + kind: typing.Literal["sleep"] = pydantic_v1.Field(alias="kind_", default="sleep") + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + +class TasksUpdateTaskRequestMainItem_Return(pydantic_v1.BaseModel): + return_: typing.Dict[str, CommonPyExpression] = pydantic_v1.Field(alias="return") + kind: typing.Literal["return"] = pydantic_v1.Field(alias="kind_", default="return") + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + +class TasksUpdateTaskRequestMainItem_Get(pydantic_v1.BaseModel): + get: str + kind: typing.Literal["get"] = pydantic_v1.Field(alias="kind_", default="get") + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + +class TasksUpdateTaskRequestMainItem_Set(pydantic_v1.BaseModel): + set_: TasksSetStepSet = pydantic_v1.Field(alias="set") + kind: typing.Literal["set"] = pydantic_v1.Field(alias="kind_", default="set") + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + +class TasksUpdateTaskRequestMainItem_Log(pydantic_v1.BaseModel): + log: CommonPyExpression + kind: typing.Literal["log"] = pydantic_v1.Field(alias="kind_", default="log") + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + +class TasksUpdateTaskRequestMainItem_Embed(pydantic_v1.BaseModel): + embed: DocsEmbedQueryRequest + kind: typing.Literal["embed"] = pydantic_v1.Field(alias="kind_", default="embed") + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + +class TasksUpdateTaskRequestMainItem_Search(pydantic_v1.BaseModel): + search: TasksSearchStepSearch + kind: typing.Literal["search"] = pydantic_v1.Field(alias="kind_", default="search") + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + class TasksUpdateTaskRequestMainItem_WaitForInput(pydantic_v1.BaseModel): - info: TasksWaitForInputStepInfo + wait_for_input: typing.Dict[str, CommonPyExpression] kind: typing.Literal["wait_for_input"] = pydantic_v1.Field( alias="kind_", default="wait_for_input" ) @@ -295,12 +568,182 @@ class Config: json_encoders = {dt.datetime: serialize_datetime} +class TasksUpdateTaskRequestMainItem_Switch(pydantic_v1.BaseModel): + switch: typing.List[TasksCaseThen] + kind: typing.Literal["switch"] = pydantic_v1.Field(alias="kind_", default="switch") + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + +class TasksUpdateTaskRequestMainItem_Foreach(pydantic_v1.BaseModel): + foreach: TasksForeachDo + kind: typing.Literal["foreach"] = pydantic_v1.Field( + alias="kind_", default="foreach" + ) + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + +class TasksUpdateTaskRequestMainItem_Parallel(pydantic_v1.BaseModel): + parallel: typing.List[TasksParallelStepParallelItem] + kind: typing.Literal["parallel"] = pydantic_v1.Field( + alias="kind_", default="parallel" + ) + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + +class TasksUpdateTaskRequestMainItem_MapReduce(pydantic_v1.BaseModel): + map_: TasksMapOver = pydantic_v1.Field(alias="map") + reduce: CommonPyExpression + kind: typing.Literal["map_reduce"] = pydantic_v1.Field( + alias="kind_", default="map_reduce" + ) + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + TasksUpdateTaskRequestMainItem = typing.Union[ TasksUpdateTaskRequestMainItem_Evaluate, TasksUpdateTaskRequestMainItem_ToolCall, TasksUpdateTaskRequestMainItem_Yield, TasksUpdateTaskRequestMainItem_Prompt, TasksUpdateTaskRequestMainItem_Error, + TasksUpdateTaskRequestMainItem_Sleep, + TasksUpdateTaskRequestMainItem_Return, + TasksUpdateTaskRequestMainItem_Get, + TasksUpdateTaskRequestMainItem_Set, + TasksUpdateTaskRequestMainItem_Log, + TasksUpdateTaskRequestMainItem_Embed, + TasksUpdateTaskRequestMainItem_Search, TasksUpdateTaskRequestMainItem_WaitForInput, TasksUpdateTaskRequestMainItem_IfElse, + TasksUpdateTaskRequestMainItem_Switch, + TasksUpdateTaskRequestMainItem_Foreach, + TasksUpdateTaskRequestMainItem_Parallel, + TasksUpdateTaskRequestMainItem_MapReduce, ] diff --git a/sdks/python/julep/api/types/tasks_wait_for_input_step.py b/sdks/python/julep/api/types/tasks_wait_for_input_step.py index 4ef962fb9..d3394fcf9 100644 --- a/sdks/python/julep/api/types/tasks_wait_for_input_step.py +++ b/sdks/python/julep/api/types/tasks_wait_for_input_step.py @@ -5,12 +5,12 @@ from ..core.datetime_utils import serialize_datetime from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .common_py_expression import CommonPyExpression from .tasks_base_workflow_step import TasksBaseWorkflowStep -from .tasks_wait_for_input_step_info import TasksWaitForInputStepInfo class TasksWaitForInputStep(TasksBaseWorkflowStep): - info: TasksWaitForInputStepInfo = pydantic_v1.Field() + wait_for_input: typing.Dict[str, CommonPyExpression] = pydantic_v1.Field() """ Any additional info or data """ diff --git a/sdks/python/julep/api/types/tasks_wait_for_input_step_info.py b/sdks/python/julep/api/types/tasks_wait_for_input_step_info.py deleted file mode 100644 index 275a35d28..000000000 --- a/sdks/python/julep/api/types/tasks_wait_for_input_step_info.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -TasksWaitForInputStepInfo = typing.Union[str, typing.Dict[str, typing.Any]] diff --git a/sdks/python/poetry.lock b/sdks/python/poetry.lock index 9b612ca30..cb99f66f7 100644 --- a/sdks/python/poetry.lock +++ b/sdks/python/poetry.lock @@ -848,13 +848,13 @@ test = ["flufl.flake8", "importlib-resources (>=1.3)", "jaraco.test (>=5.4)", "p [[package]] name = "importlib-resources" -version = "6.4.2" +version = "6.4.3" description = "Read resources from Python packages" optional = false python-versions = ">=3.8" files = [ - {file = "importlib_resources-6.4.2-py3-none-any.whl", hash = "sha256:8bba8c54a8a3afaa1419910845fa26ebd706dc716dd208d9b158b4b6966f5c5c"}, - {file = "importlib_resources-6.4.2.tar.gz", hash = "sha256:6cbfbefc449cc6e2095dd184691b7a12a04f40bc75dd4c55d31c34f174cdf57a"}, + {file = "importlib_resources-6.4.3-py3-none-any.whl", hash = "sha256:2d6dfe3b9e055f72495c2085890837fc8c758984e209115c8792bddcb762cd93"}, + {file = "importlib_resources-6.4.3.tar.gz", hash = "sha256:4a202b9b9d38563b46da59221d77bb73862ab5d79d461307bcb826d725448b98"}, ] [package.dependencies] @@ -1749,15 +1749,76 @@ files = [ {file = "numpy-2.0.1.tar.gz", hash = "sha256:485b87235796410c3519a699cfe1faab097e509e90ebb05dcd098db2ae87e7b3"}, ] +[[package]] +name = "numpy" +version = "2.1.0" +description = "Fundamental package for array computing in Python" +optional = false +python-versions = ">=3.10" +files = [ + {file = "numpy-2.1.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:6326ab99b52fafdcdeccf602d6286191a79fe2fda0ae90573c5814cd2b0bc1b8"}, + {file = "numpy-2.1.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:0937e54c09f7a9a68da6889362ddd2ff584c02d015ec92672c099b61555f8911"}, + {file = "numpy-2.1.0-cp310-cp310-macosx_14_0_arm64.whl", hash = "sha256:30014b234f07b5fec20f4146f69e13cfb1e33ee9a18a1879a0142fbb00d47673"}, + {file = "numpy-2.1.0-cp310-cp310-macosx_14_0_x86_64.whl", hash = "sha256:899da829b362ade41e1e7eccad2cf274035e1cb36ba73034946fccd4afd8606b"}, + {file = "numpy-2.1.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:08801848a40aea24ce16c2ecde3b756f9ad756586fb2d13210939eb69b023f5b"}, + {file = "numpy-2.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:398049e237d1aae53d82a416dade04defed1a47f87d18d5bd615b6e7d7e41d1f"}, + {file = "numpy-2.1.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:0abb3916a35d9090088a748636b2c06dc9a6542f99cd476979fb156a18192b84"}, + {file = "numpy-2.1.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:10e2350aea18d04832319aac0f887d5fcec1b36abd485d14f173e3e900b83e33"}, + {file = "numpy-2.1.0-cp310-cp310-win32.whl", hash = "sha256:f6b26e6c3b98adb648243670fddc8cab6ae17473f9dc58c51574af3e64d61211"}, + {file = "numpy-2.1.0-cp310-cp310-win_amd64.whl", hash = "sha256:f505264735ee074250a9c78247ee8618292091d9d1fcc023290e9ac67e8f1afa"}, + {file = "numpy-2.1.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:76368c788ccb4f4782cf9c842b316140142b4cbf22ff8db82724e82fe1205dce"}, + {file = "numpy-2.1.0-cp311-cp311-macosx_14_0_arm64.whl", hash = "sha256:f8e93a01a35be08d31ae33021e5268f157a2d60ebd643cfc15de6ab8e4722eb1"}, + {file = "numpy-2.1.0-cp311-cp311-macosx_14_0_x86_64.whl", hash = "sha256:9523f8b46485db6939bd069b28b642fec86c30909cea90ef550373787f79530e"}, + {file = "numpy-2.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:54139e0eb219f52f60656d163cbe67c31ede51d13236c950145473504fa208cb"}, + {file = "numpy-2.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f5ebbf9fbdabed208d4ecd2e1dfd2c0741af2f876e7ae522c2537d404ca895c3"}, + {file = "numpy-2.1.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:378cb4f24c7d93066ee4103204f73ed046eb88f9ad5bb2275bb9fa0f6a02bd36"}, + {file = "numpy-2.1.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:d8f699a709120b220dfe173f79c73cb2a2cab2c0b88dd59d7b49407d032b8ebd"}, + {file = "numpy-2.1.0-cp311-cp311-win32.whl", hash = "sha256:ffbd6faeb190aaf2b5e9024bac9622d2ee549b7ec89ef3a9373fa35313d44e0e"}, + {file = "numpy-2.1.0-cp311-cp311-win_amd64.whl", hash = "sha256:0af3a5987f59d9c529c022c8c2a64805b339b7ef506509fba7d0556649b9714b"}, + {file = "numpy-2.1.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:fe76d75b345dc045acdbc006adcb197cc680754afd6c259de60d358d60c93736"}, + {file = "numpy-2.1.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:f358ea9e47eb3c2d6eba121ab512dfff38a88db719c38d1e67349af210bc7529"}, + {file = "numpy-2.1.0-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:dd94ce596bda40a9618324547cfaaf6650b1a24f5390350142499aa4e34e53d1"}, + {file = "numpy-2.1.0-cp312-cp312-macosx_14_0_x86_64.whl", hash = "sha256:b47c551c6724960479cefd7353656498b86e7232429e3a41ab83be4da1b109e8"}, + {file = "numpy-2.1.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a0756a179afa766ad7cb6f036de622e8a8f16ffdd55aa31f296c870b5679d745"}, + {file = "numpy-2.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:24003ba8ff22ea29a8c306e61d316ac74111cebf942afbf692df65509a05f111"}, + {file = "numpy-2.1.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:b34fa5e3b5d6dc7e0a4243fa0f81367027cb6f4a7215a17852979634b5544ee0"}, + {file = "numpy-2.1.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:c4f982715e65036c34897eb598d64aef15150c447be2cfc6643ec7a11af06574"}, + {file = "numpy-2.1.0-cp312-cp312-win32.whl", hash = "sha256:c4cd94dfefbefec3f8b544f61286584292d740e6e9d4677769bc76b8f41deb02"}, + {file = "numpy-2.1.0-cp312-cp312-win_amd64.whl", hash = "sha256:a0cdef204199278f5c461a0bed6ed2e052998276e6d8ab2963d5b5c39a0500bc"}, + {file = "numpy-2.1.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:8ab81ccd753859ab89e67199b9da62c543850f819993761c1e94a75a814ed667"}, + {file = "numpy-2.1.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:442596f01913656d579309edcd179a2a2f9977d9a14ff41d042475280fc7f34e"}, + {file = "numpy-2.1.0-cp313-cp313-macosx_14_0_arm64.whl", hash = "sha256:848c6b5cad9898e4b9ef251b6f934fa34630371f2e916261070a4eb9092ffd33"}, + {file = "numpy-2.1.0-cp313-cp313-macosx_14_0_x86_64.whl", hash = "sha256:54c6a63e9d81efe64bfb7bcb0ec64332a87d0b87575f6009c8ba67ea6374770b"}, + {file = "numpy-2.1.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:652e92fc409e278abdd61e9505649e3938f6d04ce7ef1953f2ec598a50e7c195"}, + {file = "numpy-2.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0ab32eb9170bf8ffcbb14f11613f4a0b108d3ffee0832457c5d4808233ba8977"}, + {file = "numpy-2.1.0-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:8fb49a0ba4d8f41198ae2d52118b050fd34dace4b8f3fb0ee34e23eb4ae775b1"}, + {file = "numpy-2.1.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:44e44973262dc3ae79e9063a1284a73e09d01b894b534a769732ccd46c28cc62"}, + {file = "numpy-2.1.0-cp313-cp313-win32.whl", hash = "sha256:ab83adc099ec62e044b1fbb3a05499fa1e99f6d53a1dde102b2d85eff66ed324"}, + {file = "numpy-2.1.0-cp313-cp313-win_amd64.whl", hash = "sha256:de844aaa4815b78f6023832590d77da0e3b6805c644c33ce94a1e449f16d6ab5"}, + {file = "numpy-2.1.0-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:343e3e152bf5a087511cd325e3b7ecfd5b92d369e80e74c12cd87826e263ec06"}, + {file = "numpy-2.1.0-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:f07fa2f15dabe91259828ce7d71b5ca9e2eb7c8c26baa822c825ce43552f4883"}, + {file = "numpy-2.1.0-cp313-cp313t-macosx_14_0_arm64.whl", hash = "sha256:5474dad8c86ee9ba9bb776f4b99ef2d41b3b8f4e0d199d4f7304728ed34d0300"}, + {file = "numpy-2.1.0-cp313-cp313t-macosx_14_0_x86_64.whl", hash = "sha256:1f817c71683fd1bb5cff1529a1d085a57f02ccd2ebc5cd2c566f9a01118e3b7d"}, + {file = "numpy-2.1.0-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3a3336fbfa0d38d3deacd3fe7f3d07e13597f29c13abf4d15c3b6dc2291cbbdd"}, + {file = "numpy-2.1.0-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7a894c51fd8c4e834f00ac742abad73fc485df1062f1b875661a3c1e1fb1c2f6"}, + {file = "numpy-2.1.0-cp313-cp313t-musllinux_1_1_x86_64.whl", hash = "sha256:9156ca1f79fc4acc226696e95bfcc2b486f165a6a59ebe22b2c1f82ab190384a"}, + {file = "numpy-2.1.0-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:624884b572dff8ca8f60fab591413f077471de64e376b17d291b19f56504b2bb"}, + {file = "numpy-2.1.0-pp310-pypy310_pp73-macosx_10_15_x86_64.whl", hash = "sha256:15ef8b2177eeb7e37dd5ef4016f30b7659c57c2c0b57a779f1d537ff33a72c7b"}, + {file = "numpy-2.1.0-pp310-pypy310_pp73-macosx_14_0_x86_64.whl", hash = "sha256:e5f0642cdf4636198a4990de7a71b693d824c56a757862230454629cf62e323d"}, + {file = "numpy-2.1.0-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f15976718c004466406342789f31b6673776360f3b1e3c575f25302d7e789575"}, + {file = "numpy-2.1.0-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:6c1de77ded79fef664d5098a66810d4d27ca0224e9051906e634b3f7ead134c2"}, + {file = "numpy-2.1.0.tar.gz", hash = "sha256:7dc90da0081f7e1da49ec4e398ede6a8e9cc4f5ebe5f9e06b443ed889ee9aaa2"}, +] + [[package]] name = "openai" -version = "1.40.8" +version = "1.41.0" description = "The official Python library for the openai API" optional = false python-versions = ">=3.7.1" files = [ - {file = "openai-1.40.8-py3-none-any.whl", hash = "sha256:3ed4ddad48e0dde059c9b4d3dc240e47781beca2811e52ba449ddc4a471a2fd4"}, - {file = "openai-1.40.8.tar.gz", hash = "sha256:e225f830b946378e214c5b2cfa8df28ba2aeb7e9d44f738cb2a926fd971f5bc0"}, + {file = "openai-1.41.0-py3-none-any.whl", hash = "sha256:3b6cca4571667f3e0800442ef8f2bfa6a6f3301c51776bc7626159a4d81c242c"}, + {file = "openai-1.41.0.tar.gz", hash = "sha256:26b81f39b49dce92ff5d30c373625ddb212c2f1050e1574e456d18423730cdd0"}, ] [package.dependencies] diff --git a/sdks/ts/src/api/index.ts b/sdks/ts/src/api/index.ts index d92686f43..64ca78e83 100644 --- a/sdks/ts/src/api/index.ts +++ b/sdks/ts/src/api/index.ts @@ -96,13 +96,29 @@ export type { Sessions_SingleAgentNoUserSession } from "./models/Sessions_Single export type { Sessions_SingleAgentSingleUserSession } from "./models/Sessions_SingleAgentSingleUserSession"; export type { Sessions_UpdateSessionRequest } from "./models/Sessions_UpdateSessionRequest"; export type { Tasks_BaseWorkflowStep } from "./models/Tasks_BaseWorkflowStep"; +export type { Tasks_CaseThen } from "./models/Tasks_CaseThen"; export type { Tasks_CreateOrUpdateTaskRequest_id } from "./models/Tasks_CreateOrUpdateTaskRequest_id"; export type { Tasks_CreateTaskRequest } from "./models/Tasks_CreateTaskRequest"; +export type { Tasks_EmbedStep } from "./models/Tasks_EmbedStep"; export type { Tasks_ErrorWorkflowStep } from "./models/Tasks_ErrorWorkflowStep"; export type { Tasks_EvaluateStep } from "./models/Tasks_EvaluateStep"; +export type { Tasks_ForeachDo } from "./models/Tasks_ForeachDo"; +export type { Tasks_ForeachStep } from "./models/Tasks_ForeachStep"; +export type { Tasks_GetStep } from "./models/Tasks_GetStep"; export type { Tasks_IfElseWorkflowStep } from "./models/Tasks_IfElseWorkflowStep"; +export type { Tasks_LogStep } from "./models/Tasks_LogStep"; +export type { Tasks_MapOver } from "./models/Tasks_MapOver"; +export type { Tasks_MapReduceStep } from "./models/Tasks_MapReduceStep"; +export type { Tasks_ParallelStep } from "./models/Tasks_ParallelStep"; export type { Tasks_PatchTaskRequest } from "./models/Tasks_PatchTaskRequest"; export type { Tasks_PromptStep } from "./models/Tasks_PromptStep"; +export type { Tasks_ReturnStep } from "./models/Tasks_ReturnStep"; +export type { Tasks_SearchStep } from "./models/Tasks_SearchStep"; +export type { Tasks_SetKey } from "./models/Tasks_SetKey"; +export type { Tasks_SetStep } from "./models/Tasks_SetStep"; +export type { Tasks_SleepFor } from "./models/Tasks_SleepFor"; +export type { Tasks_SleepStep } from "./models/Tasks_SleepStep"; +export type { Tasks_SwitchStep } from "./models/Tasks_SwitchStep"; export type { Tasks_Task } from "./models/Tasks_Task"; export type { Tasks_TaskTool } from "./models/Tasks_TaskTool"; export type { Tasks_ToolCallStep } from "./models/Tasks_ToolCallStep"; @@ -215,13 +231,29 @@ export { $Sessions_SingleAgentNoUserSession } from "./schemas/$Sessions_SingleAg export { $Sessions_SingleAgentSingleUserSession } from "./schemas/$Sessions_SingleAgentSingleUserSession"; export { $Sessions_UpdateSessionRequest } from "./schemas/$Sessions_UpdateSessionRequest"; export { $Tasks_BaseWorkflowStep } from "./schemas/$Tasks_BaseWorkflowStep"; +export { $Tasks_CaseThen } from "./schemas/$Tasks_CaseThen"; export { $Tasks_CreateOrUpdateTaskRequest_id } from "./schemas/$Tasks_CreateOrUpdateTaskRequest_id"; export { $Tasks_CreateTaskRequest } from "./schemas/$Tasks_CreateTaskRequest"; +export { $Tasks_EmbedStep } from "./schemas/$Tasks_EmbedStep"; export { $Tasks_ErrorWorkflowStep } from "./schemas/$Tasks_ErrorWorkflowStep"; export { $Tasks_EvaluateStep } from "./schemas/$Tasks_EvaluateStep"; +export { $Tasks_ForeachDo } from "./schemas/$Tasks_ForeachDo"; +export { $Tasks_ForeachStep } from "./schemas/$Tasks_ForeachStep"; +export { $Tasks_GetStep } from "./schemas/$Tasks_GetStep"; export { $Tasks_IfElseWorkflowStep } from "./schemas/$Tasks_IfElseWorkflowStep"; +export { $Tasks_LogStep } from "./schemas/$Tasks_LogStep"; +export { $Tasks_MapOver } from "./schemas/$Tasks_MapOver"; +export { $Tasks_MapReduceStep } from "./schemas/$Tasks_MapReduceStep"; +export { $Tasks_ParallelStep } from "./schemas/$Tasks_ParallelStep"; export { $Tasks_PatchTaskRequest } from "./schemas/$Tasks_PatchTaskRequest"; export { $Tasks_PromptStep } from "./schemas/$Tasks_PromptStep"; +export { $Tasks_ReturnStep } from "./schemas/$Tasks_ReturnStep"; +export { $Tasks_SearchStep } from "./schemas/$Tasks_SearchStep"; +export { $Tasks_SetKey } from "./schemas/$Tasks_SetKey"; +export { $Tasks_SetStep } from "./schemas/$Tasks_SetStep"; +export { $Tasks_SleepFor } from "./schemas/$Tasks_SleepFor"; +export { $Tasks_SleepStep } from "./schemas/$Tasks_SleepStep"; +export { $Tasks_SwitchStep } from "./schemas/$Tasks_SwitchStep"; export { $Tasks_Task } from "./schemas/$Tasks_Task"; export { $Tasks_TaskTool } from "./schemas/$Tasks_TaskTool"; export { $Tasks_ToolCallStep } from "./schemas/$Tasks_ToolCallStep"; diff --git a/sdks/ts/src/api/models/Executions_TransitionTarget.ts b/sdks/ts/src/api/models/Executions_TransitionTarget.ts index 804d89dcd..fa511c40d 100644 --- a/sdks/ts/src/api/models/Executions_TransitionTarget.ts +++ b/sdks/ts/src/api/models/Executions_TransitionTarget.ts @@ -2,8 +2,8 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { Common_validPythonIdentifier } from "./Common_validPythonIdentifier"; +import type { Common_identifierSafeUnicode } from "./Common_identifierSafeUnicode"; export type Executions_TransitionTarget = { - workflow: Common_validPythonIdentifier; + workflow: Common_identifierSafeUnicode; step: number; }; diff --git a/sdks/ts/src/api/models/Tasks_BaseWorkflowStep.ts b/sdks/ts/src/api/models/Tasks_BaseWorkflowStep.ts index c399bcaa8..10be91186 100644 --- a/sdks/ts/src/api/models/Tasks_BaseWorkflowStep.ts +++ b/sdks/ts/src/api/models/Tasks_BaseWorkflowStep.ts @@ -8,10 +8,21 @@ export type Tasks_BaseWorkflowStep = { */ kind_: | "tool_call" - | "yield" | "prompt" | "evaluate" - | "if_else" | "wait_for_input" + | "log" + | "embed" + | "search" + | "set" + | "get" + | "foreach" + | "map_reduce" + | "parallel" + | "switch" + | "if_else" + | "sleep" + | "return" + | "yield" | "error"; }; diff --git a/sdks/ts/src/api/models/Tasks_CaseThen.ts b/sdks/ts/src/api/models/Tasks_CaseThen.ts new file mode 100644 index 000000000..43bc0d588 --- /dev/null +++ b/sdks/ts/src/api/models/Tasks_CaseThen.ts @@ -0,0 +1,39 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_PyExpression } from "./Common_PyExpression"; +import type { Tasks_EmbedStep } from "./Tasks_EmbedStep"; +import type { Tasks_ErrorWorkflowStep } from "./Tasks_ErrorWorkflowStep"; +import type { Tasks_GetStep } from "./Tasks_GetStep"; +import type { Tasks_LogStep } from "./Tasks_LogStep"; +import type { Tasks_PromptStep } from "./Tasks_PromptStep"; +import type { Tasks_ReturnStep } from "./Tasks_ReturnStep"; +import type { Tasks_SearchStep } from "./Tasks_SearchStep"; +import type { Tasks_SetStep } from "./Tasks_SetStep"; +import type { Tasks_SleepStep } from "./Tasks_SleepStep"; +import type { Tasks_ToolCallStep } from "./Tasks_ToolCallStep"; +import type { Tasks_WaitForInputStep } from "./Tasks_WaitForInputStep"; +import type { Tasks_YieldStep } from "./Tasks_YieldStep"; +export type Tasks_CaseThen = { + /** + * The condition to evaluate + */ + case: Common_PyExpression; + /** + * The steps to run if the condition is true + */ + then: + | Tasks_ToolCallStep + | Tasks_YieldStep + | Tasks_PromptStep + | Tasks_ErrorWorkflowStep + | Tasks_SleepStep + | Tasks_ReturnStep + | Tasks_GetStep + | Tasks_SetStep + | Tasks_LogStep + | Tasks_EmbedStep + | Tasks_SearchStep + | Tasks_WaitForInputStep; +}; diff --git a/sdks/ts/src/api/models/Tasks_CreateTaskRequest.ts b/sdks/ts/src/api/models/Tasks_CreateTaskRequest.ts index 369cae664..274f27b8a 100644 --- a/sdks/ts/src/api/models/Tasks_CreateTaskRequest.ts +++ b/sdks/ts/src/api/models/Tasks_CreateTaskRequest.ts @@ -2,10 +2,21 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +import type { Tasks_EmbedStep } from "./Tasks_EmbedStep"; import type { Tasks_ErrorWorkflowStep } from "./Tasks_ErrorWorkflowStep"; import type { Tasks_EvaluateStep } from "./Tasks_EvaluateStep"; +import type { Tasks_ForeachStep } from "./Tasks_ForeachStep"; +import type { Tasks_GetStep } from "./Tasks_GetStep"; import type { Tasks_IfElseWorkflowStep } from "./Tasks_IfElseWorkflowStep"; +import type { Tasks_LogStep } from "./Tasks_LogStep"; +import type { Tasks_MapReduceStep } from "./Tasks_MapReduceStep"; +import type { Tasks_ParallelStep } from "./Tasks_ParallelStep"; import type { Tasks_PromptStep } from "./Tasks_PromptStep"; +import type { Tasks_ReturnStep } from "./Tasks_ReturnStep"; +import type { Tasks_SearchStep } from "./Tasks_SearchStep"; +import type { Tasks_SetStep } from "./Tasks_SetStep"; +import type { Tasks_SleepStep } from "./Tasks_SleepStep"; +import type { Tasks_SwitchStep } from "./Tasks_SwitchStep"; import type { Tasks_ToolCallStep } from "./Tasks_ToolCallStep"; import type { Tasks_WaitForInputStep } from "./Tasks_WaitForInputStep"; import type { Tasks_YieldStep } from "./Tasks_YieldStep"; @@ -20,7 +31,18 @@ export type Tasks_CreateTaskRequest = Record< | Tasks_YieldStep | Tasks_PromptStep | Tasks_ErrorWorkflowStep + | Tasks_SleepStep + | Tasks_ReturnStep + | Tasks_GetStep + | Tasks_SetStep + | Tasks_LogStep + | Tasks_EmbedStep + | Tasks_SearchStep | Tasks_WaitForInputStep | Tasks_IfElseWorkflowStep + | Tasks_SwitchStep + | Tasks_ForeachStep + | Tasks_ParallelStep + | Tasks_MapReduceStep > >; diff --git a/sdks/ts/src/api/models/Tasks_EmbedStep.ts b/sdks/ts/src/api/models/Tasks_EmbedStep.ts new file mode 100644 index 000000000..2036ceead --- /dev/null +++ b/sdks/ts/src/api/models/Tasks_EmbedStep.ts @@ -0,0 +1,13 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Docs_EmbedQueryRequest } from "./Docs_EmbedQueryRequest"; +import type { Tasks_BaseWorkflowStep } from "./Tasks_BaseWorkflowStep"; +export type Tasks_EmbedStep = Tasks_BaseWorkflowStep & { + kind_: "embed"; + /** + * The text to embed + */ + embed: Docs_EmbedQueryRequest; +}; diff --git a/sdks/ts/src/api/models/Tasks_ForeachDo.ts b/sdks/ts/src/api/models/Tasks_ForeachDo.ts new file mode 100644 index 000000000..f035536f5 --- /dev/null +++ b/sdks/ts/src/api/models/Tasks_ForeachDo.ts @@ -0,0 +1,40 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_PyExpression } from "./Common_PyExpression"; +import type { Tasks_EmbedStep } from "./Tasks_EmbedStep"; +import type { Tasks_ErrorWorkflowStep } from "./Tasks_ErrorWorkflowStep"; +import type { Tasks_GetStep } from "./Tasks_GetStep"; +import type { Tasks_LogStep } from "./Tasks_LogStep"; +import type { Tasks_PromptStep } from "./Tasks_PromptStep"; +import type { Tasks_ReturnStep } from "./Tasks_ReturnStep"; +import type { Tasks_SearchStep } from "./Tasks_SearchStep"; +import type { Tasks_SetStep } from "./Tasks_SetStep"; +import type { Tasks_SleepStep } from "./Tasks_SleepStep"; +import type { Tasks_ToolCallStep } from "./Tasks_ToolCallStep"; +import type { Tasks_WaitForInputStep } from "./Tasks_WaitForInputStep"; +import type { Tasks_YieldStep } from "./Tasks_YieldStep"; +export type Tasks_ForeachDo = { + /** + * The variable to iterate over + */ + in: Common_PyExpression; + /** + * The steps to run for each iteration + */ + do: Array< + | Tasks_ToolCallStep + | Tasks_YieldStep + | Tasks_PromptStep + | Tasks_ErrorWorkflowStep + | Tasks_SleepStep + | Tasks_ReturnStep + | Tasks_GetStep + | Tasks_SetStep + | Tasks_LogStep + | Tasks_EmbedStep + | Tasks_SearchStep + | Tasks_WaitForInputStep + >; +}; diff --git a/sdks/ts/src/api/models/Tasks_ForeachStep.ts b/sdks/ts/src/api/models/Tasks_ForeachStep.ts new file mode 100644 index 000000000..31989f782 --- /dev/null +++ b/sdks/ts/src/api/models/Tasks_ForeachStep.ts @@ -0,0 +1,13 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Tasks_BaseWorkflowStep } from "./Tasks_BaseWorkflowStep"; +import type { Tasks_ForeachDo } from "./Tasks_ForeachDo"; +export type Tasks_ForeachStep = Tasks_BaseWorkflowStep & { + kind_: "foreach"; + /** + * The steps to run for each iteration + */ + foreach: Tasks_ForeachDo; +}; diff --git a/sdks/ts/src/api/models/Tasks_GetStep.ts b/sdks/ts/src/api/models/Tasks_GetStep.ts new file mode 100644 index 000000000..a8d20ecbd --- /dev/null +++ b/sdks/ts/src/api/models/Tasks_GetStep.ts @@ -0,0 +1,12 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Tasks_BaseWorkflowStep } from "./Tasks_BaseWorkflowStep"; +export type Tasks_GetStep = Tasks_BaseWorkflowStep & { + kind_: "get"; + /** + * The key to get + */ + get: string; +}; diff --git a/sdks/ts/src/api/models/Tasks_IfElseWorkflowStep.ts b/sdks/ts/src/api/models/Tasks_IfElseWorkflowStep.ts index d07ce4d07..dc2212143 100644 --- a/sdks/ts/src/api/models/Tasks_IfElseWorkflowStep.ts +++ b/sdks/ts/src/api/models/Tasks_IfElseWorkflowStep.ts @@ -4,8 +4,15 @@ /* eslint-disable */ import type { Common_PyExpression } from "./Common_PyExpression"; import type { Tasks_BaseWorkflowStep } from "./Tasks_BaseWorkflowStep"; +import type { Tasks_EmbedStep } from "./Tasks_EmbedStep"; import type { Tasks_ErrorWorkflowStep } from "./Tasks_ErrorWorkflowStep"; +import type { Tasks_GetStep } from "./Tasks_GetStep"; +import type { Tasks_LogStep } from "./Tasks_LogStep"; import type { Tasks_PromptStep } from "./Tasks_PromptStep"; +import type { Tasks_ReturnStep } from "./Tasks_ReturnStep"; +import type { Tasks_SearchStep } from "./Tasks_SearchStep"; +import type { Tasks_SetStep } from "./Tasks_SetStep"; +import type { Tasks_SleepStep } from "./Tasks_SleepStep"; import type { Tasks_ToolCallStep } from "./Tasks_ToolCallStep"; import type { Tasks_WaitForInputStep } from "./Tasks_WaitForInputStep"; import type { Tasks_YieldStep } from "./Tasks_YieldStep"; @@ -23,6 +30,13 @@ export type Tasks_IfElseWorkflowStep = Tasks_BaseWorkflowStep & { | Tasks_YieldStep | Tasks_PromptStep | Tasks_ErrorWorkflowStep + | Tasks_SleepStep + | Tasks_ReturnStep + | Tasks_GetStep + | Tasks_SetStep + | Tasks_LogStep + | Tasks_EmbedStep + | Tasks_SearchStep | Tasks_WaitForInputStep; /** * The steps to run if the condition is false @@ -32,5 +46,12 @@ export type Tasks_IfElseWorkflowStep = Tasks_BaseWorkflowStep & { | Tasks_YieldStep | Tasks_PromptStep | Tasks_ErrorWorkflowStep + | Tasks_SleepStep + | Tasks_ReturnStep + | Tasks_GetStep + | Tasks_SetStep + | Tasks_LogStep + | Tasks_EmbedStep + | Tasks_SearchStep | Tasks_WaitForInputStep; }; diff --git a/sdks/ts/src/api/models/Tasks_LogStep.ts b/sdks/ts/src/api/models/Tasks_LogStep.ts new file mode 100644 index 000000000..483628b36 --- /dev/null +++ b/sdks/ts/src/api/models/Tasks_LogStep.ts @@ -0,0 +1,13 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_PyExpression } from "./Common_PyExpression"; +import type { Tasks_BaseWorkflowStep } from "./Tasks_BaseWorkflowStep"; +export type Tasks_LogStep = Tasks_BaseWorkflowStep & { + kind_: "log"; + /** + * The value to log + */ + log: Common_PyExpression; +}; diff --git a/sdks/ts/src/api/models/Tasks_MapOver.ts b/sdks/ts/src/api/models/Tasks_MapOver.ts new file mode 100644 index 000000000..d293474c3 --- /dev/null +++ b/sdks/ts/src/api/models/Tasks_MapOver.ts @@ -0,0 +1,15 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_PyExpression } from "./Common_PyExpression"; +export type Tasks_MapOver = { + /** + * The variable to iterate over + */ + over: Common_PyExpression; + /** + * The subworkflow to run for each iteration + */ + workflow: string; +}; diff --git a/sdks/ts/src/api/models/Tasks_MapReduceStep.ts b/sdks/ts/src/api/models/Tasks_MapReduceStep.ts new file mode 100644 index 000000000..be542f460 --- /dev/null +++ b/sdks/ts/src/api/models/Tasks_MapReduceStep.ts @@ -0,0 +1,18 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_PyExpression } from "./Common_PyExpression"; +import type { Tasks_BaseWorkflowStep } from "./Tasks_BaseWorkflowStep"; +import type { Tasks_MapOver } from "./Tasks_MapOver"; +export type Tasks_MapReduceStep = Tasks_BaseWorkflowStep & { + kind_: "map_reduce"; + /** + * The steps to run for each iteration + */ + map: Tasks_MapOver; + /** + * The expression to reduce the results (`_` is a list of outputs) + */ + reduce: Common_PyExpression; +}; diff --git a/sdks/ts/src/api/models/Tasks_ParallelStep.ts b/sdks/ts/src/api/models/Tasks_ParallelStep.ts new file mode 100644 index 000000000..a094a3eca --- /dev/null +++ b/sdks/ts/src/api/models/Tasks_ParallelStep.ts @@ -0,0 +1,37 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Tasks_BaseWorkflowStep } from "./Tasks_BaseWorkflowStep"; +import type { Tasks_EmbedStep } from "./Tasks_EmbedStep"; +import type { Tasks_ErrorWorkflowStep } from "./Tasks_ErrorWorkflowStep"; +import type { Tasks_GetStep } from "./Tasks_GetStep"; +import type { Tasks_LogStep } from "./Tasks_LogStep"; +import type { Tasks_PromptStep } from "./Tasks_PromptStep"; +import type { Tasks_ReturnStep } from "./Tasks_ReturnStep"; +import type { Tasks_SearchStep } from "./Tasks_SearchStep"; +import type { Tasks_SetStep } from "./Tasks_SetStep"; +import type { Tasks_SleepStep } from "./Tasks_SleepStep"; +import type { Tasks_ToolCallStep } from "./Tasks_ToolCallStep"; +import type { Tasks_WaitForInputStep } from "./Tasks_WaitForInputStep"; +import type { Tasks_YieldStep } from "./Tasks_YieldStep"; +export type Tasks_ParallelStep = Tasks_BaseWorkflowStep & { + kind_: "parallel"; + /** + * The steps to run in parallel. Max concurrency will depend on the platform + */ + parallel: Array< + | Tasks_ToolCallStep + | Tasks_YieldStep + | Tasks_PromptStep + | Tasks_ErrorWorkflowStep + | Tasks_SleepStep + | Tasks_ReturnStep + | Tasks_GetStep + | Tasks_SetStep + | Tasks_LogStep + | Tasks_EmbedStep + | Tasks_SearchStep + | Tasks_WaitForInputStep + >; +}; diff --git a/sdks/ts/src/api/models/Tasks_PatchTaskRequest.ts b/sdks/ts/src/api/models/Tasks_PatchTaskRequest.ts index c5493e70c..0b5b917e1 100644 --- a/sdks/ts/src/api/models/Tasks_PatchTaskRequest.ts +++ b/sdks/ts/src/api/models/Tasks_PatchTaskRequest.ts @@ -2,10 +2,21 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +import type { Tasks_EmbedStep } from "./Tasks_EmbedStep"; import type { Tasks_ErrorWorkflowStep } from "./Tasks_ErrorWorkflowStep"; import type { Tasks_EvaluateStep } from "./Tasks_EvaluateStep"; +import type { Tasks_ForeachStep } from "./Tasks_ForeachStep"; +import type { Tasks_GetStep } from "./Tasks_GetStep"; import type { Tasks_IfElseWorkflowStep } from "./Tasks_IfElseWorkflowStep"; +import type { Tasks_LogStep } from "./Tasks_LogStep"; +import type { Tasks_MapReduceStep } from "./Tasks_MapReduceStep"; +import type { Tasks_ParallelStep } from "./Tasks_ParallelStep"; import type { Tasks_PromptStep } from "./Tasks_PromptStep"; +import type { Tasks_ReturnStep } from "./Tasks_ReturnStep"; +import type { Tasks_SearchStep } from "./Tasks_SearchStep"; +import type { Tasks_SetStep } from "./Tasks_SetStep"; +import type { Tasks_SleepStep } from "./Tasks_SleepStep"; +import type { Tasks_SwitchStep } from "./Tasks_SwitchStep"; import type { Tasks_ToolCallStep } from "./Tasks_ToolCallStep"; import type { Tasks_WaitForInputStep } from "./Tasks_WaitForInputStep"; import type { Tasks_YieldStep } from "./Tasks_YieldStep"; @@ -20,7 +31,18 @@ export type Tasks_PatchTaskRequest = Record< | Tasks_YieldStep | Tasks_PromptStep | Tasks_ErrorWorkflowStep + | Tasks_SleepStep + | Tasks_ReturnStep + | Tasks_GetStep + | Tasks_SetStep + | Tasks_LogStep + | Tasks_EmbedStep + | Tasks_SearchStep | Tasks_WaitForInputStep | Tasks_IfElseWorkflowStep + | Tasks_SwitchStep + | Tasks_ForeachStep + | Tasks_ParallelStep + | Tasks_MapReduceStep > >; diff --git a/sdks/ts/src/api/models/Tasks_ReturnStep.ts b/sdks/ts/src/api/models/Tasks_ReturnStep.ts new file mode 100644 index 000000000..97488f129 --- /dev/null +++ b/sdks/ts/src/api/models/Tasks_ReturnStep.ts @@ -0,0 +1,13 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_PyExpression } from "./Common_PyExpression"; +import type { Tasks_BaseWorkflowStep } from "./Tasks_BaseWorkflowStep"; +export type Tasks_ReturnStep = Tasks_BaseWorkflowStep & { + kind_: "return"; + /** + * The value to return + */ + return: Record; +}; diff --git a/sdks/ts/src/api/models/Tasks_SearchStep.ts b/sdks/ts/src/api/models/Tasks_SearchStep.ts new file mode 100644 index 000000000..eabe9b707 --- /dev/null +++ b/sdks/ts/src/api/models/Tasks_SearchStep.ts @@ -0,0 +1,18 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Docs_HybridDocSearchRequest } from "./Docs_HybridDocSearchRequest"; +import type { Docs_TextOnlyDocSearchRequest } from "./Docs_TextOnlyDocSearchRequest"; +import type { Docs_VectorDocSearchRequest } from "./Docs_VectorDocSearchRequest"; +import type { Tasks_BaseWorkflowStep } from "./Tasks_BaseWorkflowStep"; +export type Tasks_SearchStep = Tasks_BaseWorkflowStep & { + kind_: "search"; + /** + * The search query + */ + search: + | Docs_VectorDocSearchRequest + | Docs_TextOnlyDocSearchRequest + | Docs_HybridDocSearchRequest; +}; diff --git a/sdks/ts/src/api/models/Tasks_SetKey.ts b/sdks/ts/src/api/models/Tasks_SetKey.ts new file mode 100644 index 000000000..a7cef005d --- /dev/null +++ b/sdks/ts/src/api/models/Tasks_SetKey.ts @@ -0,0 +1,15 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_PyExpression } from "./Common_PyExpression"; +export type Tasks_SetKey = { + /** + * The key to set + */ + key: string; + /** + * The value to set + */ + value: Common_PyExpression; +}; diff --git a/sdks/ts/src/api/models/Tasks_SetStep.ts b/sdks/ts/src/api/models/Tasks_SetStep.ts new file mode 100644 index 000000000..a4425ecc3 --- /dev/null +++ b/sdks/ts/src/api/models/Tasks_SetStep.ts @@ -0,0 +1,13 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Tasks_BaseWorkflowStep } from "./Tasks_BaseWorkflowStep"; +import type { Tasks_SetKey } from "./Tasks_SetKey"; +export type Tasks_SetStep = Tasks_BaseWorkflowStep & { + kind_: "set"; + /** + * The value to set + */ + set: Tasks_SetKey | Array; +}; diff --git a/sdks/ts/src/api/models/Tasks_SleepFor.ts b/sdks/ts/src/api/models/Tasks_SleepFor.ts new file mode 100644 index 000000000..85b1ef55f --- /dev/null +++ b/sdks/ts/src/api/models/Tasks_SleepFor.ts @@ -0,0 +1,22 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type Tasks_SleepFor = { + /** + * The number of seconds to sleep for + */ + seconds: number; + /** + * The number of minutes to sleep for + */ + minutes: number; + /** + * The number of hours to sleep for + */ + hours: number; + /** + * The number of days to sleep for + */ + days: number; +}; diff --git a/sdks/ts/src/api/models/Tasks_SleepStep.ts b/sdks/ts/src/api/models/Tasks_SleepStep.ts new file mode 100644 index 000000000..c2a14b9b5 --- /dev/null +++ b/sdks/ts/src/api/models/Tasks_SleepStep.ts @@ -0,0 +1,13 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Tasks_BaseWorkflowStep } from "./Tasks_BaseWorkflowStep"; +import type { Tasks_SleepFor } from "./Tasks_SleepFor"; +export type Tasks_SleepStep = Tasks_BaseWorkflowStep & { + kind_: "sleep"; + /** + * The duration to sleep for + */ + sleep: Tasks_SleepFor; +}; diff --git a/sdks/ts/src/api/models/Tasks_SwitchStep.ts b/sdks/ts/src/api/models/Tasks_SwitchStep.ts new file mode 100644 index 000000000..27d68c6be --- /dev/null +++ b/sdks/ts/src/api/models/Tasks_SwitchStep.ts @@ -0,0 +1,13 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Tasks_BaseWorkflowStep } from "./Tasks_BaseWorkflowStep"; +import type { Tasks_CaseThen } from "./Tasks_CaseThen"; +export type Tasks_SwitchStep = Tasks_BaseWorkflowStep & { + kind_: "switch"; + /** + * The cond tree + */ + switch: Array; +}; diff --git a/sdks/ts/src/api/models/Tasks_Task.ts b/sdks/ts/src/api/models/Tasks_Task.ts index 9b273fc4a..fe307a4e8 100644 --- a/sdks/ts/src/api/models/Tasks_Task.ts +++ b/sdks/ts/src/api/models/Tasks_Task.ts @@ -2,10 +2,21 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +import type { Tasks_EmbedStep } from "./Tasks_EmbedStep"; import type { Tasks_ErrorWorkflowStep } from "./Tasks_ErrorWorkflowStep"; import type { Tasks_EvaluateStep } from "./Tasks_EvaluateStep"; +import type { Tasks_ForeachStep } from "./Tasks_ForeachStep"; +import type { Tasks_GetStep } from "./Tasks_GetStep"; import type { Tasks_IfElseWorkflowStep } from "./Tasks_IfElseWorkflowStep"; +import type { Tasks_LogStep } from "./Tasks_LogStep"; +import type { Tasks_MapReduceStep } from "./Tasks_MapReduceStep"; +import type { Tasks_ParallelStep } from "./Tasks_ParallelStep"; import type { Tasks_PromptStep } from "./Tasks_PromptStep"; +import type { Tasks_ReturnStep } from "./Tasks_ReturnStep"; +import type { Tasks_SearchStep } from "./Tasks_SearchStep"; +import type { Tasks_SetStep } from "./Tasks_SetStep"; +import type { Tasks_SleepStep } from "./Tasks_SleepStep"; +import type { Tasks_SwitchStep } from "./Tasks_SwitchStep"; import type { Tasks_ToolCallStep } from "./Tasks_ToolCallStep"; import type { Tasks_WaitForInputStep } from "./Tasks_WaitForInputStep"; import type { Tasks_YieldStep } from "./Tasks_YieldStep"; @@ -20,7 +31,18 @@ export type Tasks_Task = Record< | Tasks_YieldStep | Tasks_PromptStep | Tasks_ErrorWorkflowStep + | Tasks_SleepStep + | Tasks_ReturnStep + | Tasks_GetStep + | Tasks_SetStep + | Tasks_LogStep + | Tasks_EmbedStep + | Tasks_SearchStep | Tasks_WaitForInputStep | Tasks_IfElseWorkflowStep + | Tasks_SwitchStep + | Tasks_ForeachStep + | Tasks_ParallelStep + | Tasks_MapReduceStep > >; diff --git a/sdks/ts/src/api/models/Tasks_UpdateTaskRequest.ts b/sdks/ts/src/api/models/Tasks_UpdateTaskRequest.ts index e823f29a4..a6346d173 100644 --- a/sdks/ts/src/api/models/Tasks_UpdateTaskRequest.ts +++ b/sdks/ts/src/api/models/Tasks_UpdateTaskRequest.ts @@ -2,10 +2,21 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +import type { Tasks_EmbedStep } from "./Tasks_EmbedStep"; import type { Tasks_ErrorWorkflowStep } from "./Tasks_ErrorWorkflowStep"; import type { Tasks_EvaluateStep } from "./Tasks_EvaluateStep"; +import type { Tasks_ForeachStep } from "./Tasks_ForeachStep"; +import type { Tasks_GetStep } from "./Tasks_GetStep"; import type { Tasks_IfElseWorkflowStep } from "./Tasks_IfElseWorkflowStep"; +import type { Tasks_LogStep } from "./Tasks_LogStep"; +import type { Tasks_MapReduceStep } from "./Tasks_MapReduceStep"; +import type { Tasks_ParallelStep } from "./Tasks_ParallelStep"; import type { Tasks_PromptStep } from "./Tasks_PromptStep"; +import type { Tasks_ReturnStep } from "./Tasks_ReturnStep"; +import type { Tasks_SearchStep } from "./Tasks_SearchStep"; +import type { Tasks_SetStep } from "./Tasks_SetStep"; +import type { Tasks_SleepStep } from "./Tasks_SleepStep"; +import type { Tasks_SwitchStep } from "./Tasks_SwitchStep"; import type { Tasks_ToolCallStep } from "./Tasks_ToolCallStep"; import type { Tasks_WaitForInputStep } from "./Tasks_WaitForInputStep"; import type { Tasks_YieldStep } from "./Tasks_YieldStep"; @@ -20,7 +31,18 @@ export type Tasks_UpdateTaskRequest = Record< | Tasks_YieldStep | Tasks_PromptStep | Tasks_ErrorWorkflowStep + | Tasks_SleepStep + | Tasks_ReturnStep + | Tasks_GetStep + | Tasks_SetStep + | Tasks_LogStep + | Tasks_EmbedStep + | Tasks_SearchStep | Tasks_WaitForInputStep | Tasks_IfElseWorkflowStep + | Tasks_SwitchStep + | Tasks_ForeachStep + | Tasks_ParallelStep + | Tasks_MapReduceStep > >; diff --git a/sdks/ts/src/api/models/Tasks_WaitForInputStep.ts b/sdks/ts/src/api/models/Tasks_WaitForInputStep.ts index d47196144..7f8e16817 100644 --- a/sdks/ts/src/api/models/Tasks_WaitForInputStep.ts +++ b/sdks/ts/src/api/models/Tasks_WaitForInputStep.ts @@ -2,11 +2,12 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +import type { Common_PyExpression } from "./Common_PyExpression"; import type { Tasks_BaseWorkflowStep } from "./Tasks_BaseWorkflowStep"; export type Tasks_WaitForInputStep = Tasks_BaseWorkflowStep & { kind_: "wait_for_input"; /** * Any additional info or data */ - info: string | Record; + wait_for_input: Record; }; diff --git a/sdks/ts/src/api/schemas/$Executions_TransitionTarget.ts b/sdks/ts/src/api/schemas/$Executions_TransitionTarget.ts index d1ead50a5..62d5b4962 100644 --- a/sdks/ts/src/api/schemas/$Executions_TransitionTarget.ts +++ b/sdks/ts/src/api/schemas/$Executions_TransitionTarget.ts @@ -5,7 +5,7 @@ export const $Executions_TransitionTarget = { properties: { workflow: { - type: "Common_validPythonIdentifier", + type: "Common_identifierSafeUnicode", isRequired: true, }, step: { diff --git a/sdks/ts/src/api/schemas/$Tasks_CaseThen.ts b/sdks/ts/src/api/schemas/$Tasks_CaseThen.ts new file mode 100644 index 000000000..0e8eceebc --- /dev/null +++ b/sdks/ts/src/api/schemas/$Tasks_CaseThen.ts @@ -0,0 +1,61 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Tasks_CaseThen = { + properties: { + case: { + type: "all-of", + description: `The condition to evaluate`, + contains: [ + { + type: "Common_PyExpression", + }, + ], + isRequired: true, + }, + then: { + type: "any-of", + description: `The steps to run if the condition is true`, + contains: [ + { + type: "Tasks_ToolCallStep", + }, + { + type: "Tasks_YieldStep", + }, + { + type: "Tasks_PromptStep", + }, + { + type: "Tasks_ErrorWorkflowStep", + }, + { + type: "Tasks_SleepStep", + }, + { + type: "Tasks_ReturnStep", + }, + { + type: "Tasks_GetStep", + }, + { + type: "Tasks_SetStep", + }, + { + type: "Tasks_LogStep", + }, + { + type: "Tasks_EmbedStep", + }, + { + type: "Tasks_SearchStep", + }, + { + type: "Tasks_WaitForInputStep", + }, + ], + isRequired: true, + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$Tasks_CreateTaskRequest.ts b/sdks/ts/src/api/schemas/$Tasks_CreateTaskRequest.ts index 7c15a448d..1116b0b5f 100644 --- a/sdks/ts/src/api/schemas/$Tasks_CreateTaskRequest.ts +++ b/sdks/ts/src/api/schemas/$Tasks_CreateTaskRequest.ts @@ -24,12 +24,45 @@ export const $Tasks_CreateTaskRequest = { { type: "Tasks_ErrorWorkflowStep", }, + { + type: "Tasks_SleepStep", + }, + { + type: "Tasks_ReturnStep", + }, + { + type: "Tasks_GetStep", + }, + { + type: "Tasks_SetStep", + }, + { + type: "Tasks_LogStep", + }, + { + type: "Tasks_EmbedStep", + }, + { + type: "Tasks_SearchStep", + }, { type: "Tasks_WaitForInputStep", }, { type: "Tasks_IfElseWorkflowStep", }, + { + type: "Tasks_SwitchStep", + }, + { + type: "Tasks_ForeachStep", + }, + { + type: "Tasks_ParallelStep", + }, + { + type: "Tasks_MapReduceStep", + }, ], }, }, diff --git a/sdks/ts/src/api/schemas/$Tasks_EmbedStep.ts b/sdks/ts/src/api/schemas/$Tasks_EmbedStep.ts new file mode 100644 index 000000000..11cae473c --- /dev/null +++ b/sdks/ts/src/api/schemas/$Tasks_EmbedStep.ts @@ -0,0 +1,30 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Tasks_EmbedStep = { + type: "all-of", + contains: [ + { + type: "Tasks_BaseWorkflowStep", + }, + { + properties: { + kind_: { + type: "Enum", + isRequired: true, + }, + embed: { + type: "all-of", + description: `The text to embed`, + contains: [ + { + type: "Docs_EmbedQueryRequest", + }, + ], + isRequired: true, + }, + }, + }, + ], +} as const; diff --git a/sdks/ts/src/api/schemas/$Tasks_ForeachDo.ts b/sdks/ts/src/api/schemas/$Tasks_ForeachDo.ts new file mode 100644 index 000000000..ef7102320 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Tasks_ForeachDo.ts @@ -0,0 +1,63 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Tasks_ForeachDo = { + properties: { + in: { + type: "all-of", + description: `The variable to iterate over`, + contains: [ + { + type: "Common_PyExpression", + }, + ], + isRequired: true, + }, + do: { + type: "array", + contains: { + type: "any-of", + contains: [ + { + type: "Tasks_ToolCallStep", + }, + { + type: "Tasks_YieldStep", + }, + { + type: "Tasks_PromptStep", + }, + { + type: "Tasks_ErrorWorkflowStep", + }, + { + type: "Tasks_SleepStep", + }, + { + type: "Tasks_ReturnStep", + }, + { + type: "Tasks_GetStep", + }, + { + type: "Tasks_SetStep", + }, + { + type: "Tasks_LogStep", + }, + { + type: "Tasks_EmbedStep", + }, + { + type: "Tasks_SearchStep", + }, + { + type: "Tasks_WaitForInputStep", + }, + ], + }, + isRequired: true, + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$Tasks_ForeachStep.ts b/sdks/ts/src/api/schemas/$Tasks_ForeachStep.ts new file mode 100644 index 000000000..3deb761b5 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Tasks_ForeachStep.ts @@ -0,0 +1,30 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Tasks_ForeachStep = { + type: "all-of", + contains: [ + { + type: "Tasks_BaseWorkflowStep", + }, + { + properties: { + kind_: { + type: "Enum", + isRequired: true, + }, + foreach: { + type: "all-of", + description: `The steps to run for each iteration`, + contains: [ + { + type: "Tasks_ForeachDo", + }, + ], + isRequired: true, + }, + }, + }, + ], +} as const; diff --git a/sdks/ts/src/api/schemas/$Tasks_GetStep.ts b/sdks/ts/src/api/schemas/$Tasks_GetStep.ts new file mode 100644 index 000000000..19da398f8 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Tasks_GetStep.ts @@ -0,0 +1,25 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Tasks_GetStep = { + type: "all-of", + contains: [ + { + type: "Tasks_BaseWorkflowStep", + }, + { + properties: { + kind_: { + type: "Enum", + isRequired: true, + }, + get: { + type: "string", + description: `The key to get`, + isRequired: true, + }, + }, + }, + ], +} as const; diff --git a/sdks/ts/src/api/schemas/$Tasks_IfElseWorkflowStep.ts b/sdks/ts/src/api/schemas/$Tasks_IfElseWorkflowStep.ts index ae1c3bbaf..a1def86dc 100644 --- a/sdks/ts/src/api/schemas/$Tasks_IfElseWorkflowStep.ts +++ b/sdks/ts/src/api/schemas/$Tasks_IfElseWorkflowStep.ts @@ -40,6 +40,27 @@ export const $Tasks_IfElseWorkflowStep = { { type: "Tasks_ErrorWorkflowStep", }, + { + type: "Tasks_SleepStep", + }, + { + type: "Tasks_ReturnStep", + }, + { + type: "Tasks_GetStep", + }, + { + type: "Tasks_SetStep", + }, + { + type: "Tasks_LogStep", + }, + { + type: "Tasks_EmbedStep", + }, + { + type: "Tasks_SearchStep", + }, { type: "Tasks_WaitForInputStep", }, @@ -62,6 +83,27 @@ export const $Tasks_IfElseWorkflowStep = { { type: "Tasks_ErrorWorkflowStep", }, + { + type: "Tasks_SleepStep", + }, + { + type: "Tasks_ReturnStep", + }, + { + type: "Tasks_GetStep", + }, + { + type: "Tasks_SetStep", + }, + { + type: "Tasks_LogStep", + }, + { + type: "Tasks_EmbedStep", + }, + { + type: "Tasks_SearchStep", + }, { type: "Tasks_WaitForInputStep", }, diff --git a/sdks/ts/src/api/schemas/$Tasks_LogStep.ts b/sdks/ts/src/api/schemas/$Tasks_LogStep.ts new file mode 100644 index 000000000..3565c937c --- /dev/null +++ b/sdks/ts/src/api/schemas/$Tasks_LogStep.ts @@ -0,0 +1,30 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Tasks_LogStep = { + type: "all-of", + contains: [ + { + type: "Tasks_BaseWorkflowStep", + }, + { + properties: { + kind_: { + type: "Enum", + isRequired: true, + }, + log: { + type: "all-of", + description: `The value to log`, + contains: [ + { + type: "Common_PyExpression", + }, + ], + isRequired: true, + }, + }, + }, + ], +} as const; diff --git a/sdks/ts/src/api/schemas/$Tasks_MapOver.ts b/sdks/ts/src/api/schemas/$Tasks_MapOver.ts new file mode 100644 index 000000000..b12b438c1 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Tasks_MapOver.ts @@ -0,0 +1,23 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Tasks_MapOver = { + properties: { + over: { + type: "all-of", + description: `The variable to iterate over`, + contains: [ + { + type: "Common_PyExpression", + }, + ], + isRequired: true, + }, + workflow: { + type: "string", + description: `The subworkflow to run for each iteration`, + isRequired: true, + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$Tasks_MapReduceStep.ts b/sdks/ts/src/api/schemas/$Tasks_MapReduceStep.ts new file mode 100644 index 000000000..a88a4b6d7 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Tasks_MapReduceStep.ts @@ -0,0 +1,40 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Tasks_MapReduceStep = { + type: "all-of", + contains: [ + { + type: "Tasks_BaseWorkflowStep", + }, + { + properties: { + kind_: { + type: "Enum", + isRequired: true, + }, + map: { + type: "all-of", + description: `The steps to run for each iteration`, + contains: [ + { + type: "Tasks_MapOver", + }, + ], + isRequired: true, + }, + reduce: { + type: "all-of", + description: `The expression to reduce the results (\`_\` is a list of outputs)`, + contains: [ + { + type: "Common_PyExpression", + }, + ], + isRequired: true, + }, + }, + }, + ], +} as const; diff --git a/sdks/ts/src/api/schemas/$Tasks_ParallelStep.ts b/sdks/ts/src/api/schemas/$Tasks_ParallelStep.ts new file mode 100644 index 000000000..cf1f97820 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Tasks_ParallelStep.ts @@ -0,0 +1,65 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Tasks_ParallelStep = { + type: "all-of", + contains: [ + { + type: "Tasks_BaseWorkflowStep", + }, + { + properties: { + kind_: { + type: "Enum", + isRequired: true, + }, + parallel: { + type: "array", + contains: { + type: "any-of", + contains: [ + { + type: "Tasks_ToolCallStep", + }, + { + type: "Tasks_YieldStep", + }, + { + type: "Tasks_PromptStep", + }, + { + type: "Tasks_ErrorWorkflowStep", + }, + { + type: "Tasks_SleepStep", + }, + { + type: "Tasks_ReturnStep", + }, + { + type: "Tasks_GetStep", + }, + { + type: "Tasks_SetStep", + }, + { + type: "Tasks_LogStep", + }, + { + type: "Tasks_EmbedStep", + }, + { + type: "Tasks_SearchStep", + }, + { + type: "Tasks_WaitForInputStep", + }, + ], + }, + isRequired: true, + }, + }, + }, + ], +} as const; diff --git a/sdks/ts/src/api/schemas/$Tasks_PatchTaskRequest.ts b/sdks/ts/src/api/schemas/$Tasks_PatchTaskRequest.ts index 50c6201fe..561808f01 100644 --- a/sdks/ts/src/api/schemas/$Tasks_PatchTaskRequest.ts +++ b/sdks/ts/src/api/schemas/$Tasks_PatchTaskRequest.ts @@ -24,12 +24,45 @@ export const $Tasks_PatchTaskRequest = { { type: "Tasks_ErrorWorkflowStep", }, + { + type: "Tasks_SleepStep", + }, + { + type: "Tasks_ReturnStep", + }, + { + type: "Tasks_GetStep", + }, + { + type: "Tasks_SetStep", + }, + { + type: "Tasks_LogStep", + }, + { + type: "Tasks_EmbedStep", + }, + { + type: "Tasks_SearchStep", + }, { type: "Tasks_WaitForInputStep", }, { type: "Tasks_IfElseWorkflowStep", }, + { + type: "Tasks_SwitchStep", + }, + { + type: "Tasks_ForeachStep", + }, + { + type: "Tasks_ParallelStep", + }, + { + type: "Tasks_MapReduceStep", + }, ], }, }, diff --git a/sdks/ts/src/api/schemas/$Tasks_ReturnStep.ts b/sdks/ts/src/api/schemas/$Tasks_ReturnStep.ts new file mode 100644 index 000000000..04f7d4ab1 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Tasks_ReturnStep.ts @@ -0,0 +1,27 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Tasks_ReturnStep = { + type: "all-of", + contains: [ + { + type: "Tasks_BaseWorkflowStep", + }, + { + properties: { + kind_: { + type: "Enum", + isRequired: true, + }, + return: { + type: "dictionary", + contains: { + type: "Common_PyExpression", + }, + isRequired: true, + }, + }, + }, + ], +} as const; diff --git a/sdks/ts/src/api/schemas/$Tasks_SearchStep.ts b/sdks/ts/src/api/schemas/$Tasks_SearchStep.ts new file mode 100644 index 000000000..7c2ae3cb6 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Tasks_SearchStep.ts @@ -0,0 +1,36 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Tasks_SearchStep = { + type: "all-of", + contains: [ + { + type: "Tasks_BaseWorkflowStep", + }, + { + properties: { + kind_: { + type: "Enum", + isRequired: true, + }, + search: { + type: "any-of", + description: `The search query`, + contains: [ + { + type: "Docs_VectorDocSearchRequest", + }, + { + type: "Docs_TextOnlyDocSearchRequest", + }, + { + type: "Docs_HybridDocSearchRequest", + }, + ], + isRequired: true, + }, + }, + }, + ], +} as const; diff --git a/sdks/ts/src/api/schemas/$Tasks_SetKey.ts b/sdks/ts/src/api/schemas/$Tasks_SetKey.ts new file mode 100644 index 000000000..c93f367d1 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Tasks_SetKey.ts @@ -0,0 +1,23 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Tasks_SetKey = { + properties: { + key: { + type: "string", + description: `The key to set`, + isRequired: true, + }, + value: { + type: "all-of", + description: `The value to set`, + contains: [ + { + type: "Common_PyExpression", + }, + ], + isRequired: true, + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$Tasks_SetStep.ts b/sdks/ts/src/api/schemas/$Tasks_SetStep.ts new file mode 100644 index 000000000..7c768fc10 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Tasks_SetStep.ts @@ -0,0 +1,36 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Tasks_SetStep = { + type: "all-of", + contains: [ + { + type: "Tasks_BaseWorkflowStep", + }, + { + properties: { + kind_: { + type: "Enum", + isRequired: true, + }, + set: { + type: "any-of", + description: `The value to set`, + contains: [ + { + type: "Tasks_SetKey", + }, + { + type: "array", + contains: { + type: "Tasks_SetKey", + }, + }, + ], + isRequired: true, + }, + }, + }, + ], +} as const; diff --git a/sdks/ts/src/api/schemas/$Tasks_SleepFor.ts b/sdks/ts/src/api/schemas/$Tasks_SleepFor.ts new file mode 100644 index 000000000..a03d5591c --- /dev/null +++ b/sdks/ts/src/api/schemas/$Tasks_SleepFor.ts @@ -0,0 +1,32 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Tasks_SleepFor = { + properties: { + seconds: { + type: "number", + description: `The number of seconds to sleep for`, + isRequired: true, + format: "uint16", + }, + minutes: { + type: "number", + description: `The number of minutes to sleep for`, + isRequired: true, + format: "uint16", + }, + hours: { + type: "number", + description: `The number of hours to sleep for`, + isRequired: true, + format: "uint16", + }, + days: { + type: "number", + description: `The number of days to sleep for`, + isRequired: true, + format: "uint16", + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$Tasks_SleepStep.ts b/sdks/ts/src/api/schemas/$Tasks_SleepStep.ts new file mode 100644 index 000000000..79d23cbcf --- /dev/null +++ b/sdks/ts/src/api/schemas/$Tasks_SleepStep.ts @@ -0,0 +1,30 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Tasks_SleepStep = { + type: "all-of", + contains: [ + { + type: "Tasks_BaseWorkflowStep", + }, + { + properties: { + kind_: { + type: "Enum", + isRequired: true, + }, + sleep: { + type: "all-of", + description: `The duration to sleep for`, + contains: [ + { + type: "Tasks_SleepFor", + }, + ], + isRequired: true, + }, + }, + }, + ], +} as const; diff --git a/sdks/ts/src/api/schemas/$Tasks_SwitchStep.ts b/sdks/ts/src/api/schemas/$Tasks_SwitchStep.ts new file mode 100644 index 000000000..c8958af82 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Tasks_SwitchStep.ts @@ -0,0 +1,27 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Tasks_SwitchStep = { + type: "all-of", + contains: [ + { + type: "Tasks_BaseWorkflowStep", + }, + { + properties: { + kind_: { + type: "Enum", + isRequired: true, + }, + switch: { + type: "array", + contains: { + type: "Tasks_CaseThen", + }, + isRequired: true, + }, + }, + }, + ], +} as const; diff --git a/sdks/ts/src/api/schemas/$Tasks_Task.ts b/sdks/ts/src/api/schemas/$Tasks_Task.ts index d0431107d..4343739a9 100644 --- a/sdks/ts/src/api/schemas/$Tasks_Task.ts +++ b/sdks/ts/src/api/schemas/$Tasks_Task.ts @@ -24,12 +24,45 @@ export const $Tasks_Task = { { type: "Tasks_ErrorWorkflowStep", }, + { + type: "Tasks_SleepStep", + }, + { + type: "Tasks_ReturnStep", + }, + { + type: "Tasks_GetStep", + }, + { + type: "Tasks_SetStep", + }, + { + type: "Tasks_LogStep", + }, + { + type: "Tasks_EmbedStep", + }, + { + type: "Tasks_SearchStep", + }, { type: "Tasks_WaitForInputStep", }, { type: "Tasks_IfElseWorkflowStep", }, + { + type: "Tasks_SwitchStep", + }, + { + type: "Tasks_ForeachStep", + }, + { + type: "Tasks_ParallelStep", + }, + { + type: "Tasks_MapReduceStep", + }, ], }, }, diff --git a/sdks/ts/src/api/schemas/$Tasks_UpdateTaskRequest.ts b/sdks/ts/src/api/schemas/$Tasks_UpdateTaskRequest.ts index 5127d8f62..782e0bb56 100644 --- a/sdks/ts/src/api/schemas/$Tasks_UpdateTaskRequest.ts +++ b/sdks/ts/src/api/schemas/$Tasks_UpdateTaskRequest.ts @@ -24,12 +24,45 @@ export const $Tasks_UpdateTaskRequest = { { type: "Tasks_ErrorWorkflowStep", }, + { + type: "Tasks_SleepStep", + }, + { + type: "Tasks_ReturnStep", + }, + { + type: "Tasks_GetStep", + }, + { + type: "Tasks_SetStep", + }, + { + type: "Tasks_LogStep", + }, + { + type: "Tasks_EmbedStep", + }, + { + type: "Tasks_SearchStep", + }, { type: "Tasks_WaitForInputStep", }, { type: "Tasks_IfElseWorkflowStep", }, + { + type: "Tasks_SwitchStep", + }, + { + type: "Tasks_ForeachStep", + }, + { + type: "Tasks_ParallelStep", + }, + { + type: "Tasks_MapReduceStep", + }, ], }, }, diff --git a/sdks/ts/src/api/schemas/$Tasks_WaitForInputStep.ts b/sdks/ts/src/api/schemas/$Tasks_WaitForInputStep.ts index 7e61ce760..227b73b33 100644 --- a/sdks/ts/src/api/schemas/$Tasks_WaitForInputStep.ts +++ b/sdks/ts/src/api/schemas/$Tasks_WaitForInputStep.ts @@ -14,20 +14,11 @@ export const $Tasks_WaitForInputStep = { type: "Enum", isRequired: true, }, - info: { - type: "any-of", - description: `Any additional info or data`, - contains: [ - { - type: "string", - }, - { - type: "dictionary", - contains: { - properties: {}, - }, - }, - ], + wait_for_input: { + type: "dictionary", + contains: { + type: "Common_PyExpression", + }, isRequired: true, }, }, diff --git a/typespec/executions/models.tsp b/typespec/executions/models.tsp index 961c8389a..0f7be074f 100644 --- a/typespec/executions/models.tsp +++ b/typespec/executions/models.tsp @@ -109,7 +109,7 @@ alias TransitionType = ( ); model TransitionTarget { - workflow: validPythonIdentifier; + workflow: identifierSafeUnicode; step: uint16; } diff --git a/typespec/tasks/models.tsp b/typespec/tasks/models.tsp index 7cde91759..749d47a11 100644 --- a/typespec/tasks/models.tsp +++ b/typespec/tasks/models.tsp @@ -1,17 +1,13 @@ import "@typespec/http"; -import "../agents"; import "../common"; -import "../chat"; -import "../entries"; import "../tools"; +import "./steps.tsp"; + using TypeSpec.Http; -using Agents; -using Chat; using Common; -using Entries; using Tools; namespace Tasks; @@ -20,105 +16,6 @@ namespace Tasks; // TASK MODELS // -alias WorkflowStepKind = - | /** A step that runs a tool */ - "tool_call" - | /** A step that runs a subworkflow */ - "yield" - | /** A step that runs a prompt */ - "prompt" - | /** A step that evaluates an expression */ - "evaluate" - | /** A step that runs a conditional */ - "if_else" - | /** A step that signals that it needs more input before resuming */ - "wait_for_input" - | /** Throw an error */ - "error"; - -model BaseWorkflowStep { - /** The kind of step */ - kind_: WorkflowStepKind; -} - -model ToolCallStep extends BaseWorkflowStep { - kind_: "tool_call" = "tool_call"; - - /** The tool to run */ - tool: toolRef; - - /** The input parameters for the tool */ - arguments: Record; -} - -/** An object where values are strings in the Common Expression Language that get evaluated before being passed downstream */ -alias ExpressionObject = Record; - -model YieldStep extends BaseWorkflowStep { - kind_: "yield" = "yield"; - - /** The subworkflow to run */ - workflow: string; - - /** The input parameters for the subworkflow */ - arguments: ExpressionObject; -} - -model PromptStep extends BaseWorkflowStep { - kind_: "prompt" = "prompt"; - - /** The prompt to run */ - prompt: string | InputChatMLMessage[]; - - /** Settings for the prompt */ - settings: ChatSettings; -} - -model EvaluateStep extends BaseWorkflowStep { - kind_: "evaluate" = "evaluate"; - - /** The expression to evaluate */ - evaluate: ExpressionObject; -} - -model ErrorWorkflowStep extends BaseWorkflowStep { - kind_: "error" = "error"; - - /** The error message */ - error: string; -} - -model WaitForInputStep extends BaseWorkflowStep { - kind_: "wait_for_input" = "wait_for_input"; - - /** Any additional info or data */ - info: string | Record; -} - -alias NonConditionalWorkflowStep = - | EvaluateStep - | ToolCallStep - | YieldStep - | PromptStep - | ErrorWorkflowStep - | WaitForInputStep; - -model IfElseWorkflowStep extends BaseWorkflowStep { - kind_: "if_else" = "if_else"; - - /** The condition to evaluate */ - `if`: PyExpression; - - /** The steps to run if the condition is true */ - then: NonConditionalWorkflowStep; - - /** The steps to run if the condition is false */ - `else`: NonConditionalWorkflowStep; -} - -alias WorkflowStep = NonConditionalWorkflowStep | IfElseWorkflowStep; -alias CreateWorkflowStep = WorkflowStep; - model Workflow { @key name: validPythonIdentifier; @@ -126,7 +23,7 @@ model Workflow { steps: WorkflowStep[]; } -model TaskTool extends CreateToolRequest{ +model TaskTool extends CreateToolRequest { /** Read-only: Whether the tool was inherited or not. Only applies within tasks. */ @visibility("read") inherited?: boolean = false; diff --git a/typespec/tasks/step_kind.tsp b/typespec/tasks/step_kind.tsp new file mode 100644 index 000000000..569c5737a --- /dev/null +++ b/typespec/tasks/step_kind.tsp @@ -0,0 +1,72 @@ +namespace Tasks; + +// +// STEP KINDS +// + +alias WorkflowStepKind = + //////////////////// + /// Common steps /// + //////////////////// + + | /** A step that runs a tool */ + "tool_call" + | /** A step that runs a prompt */ + "prompt" + | /** A step that evaluates an expression */ + "evaluate" + | /** A step that signals that it needs more input before resuming */ + "wait_for_input" + | /** log step */ + "log" + + //////////////////////// + /// Doc search steps /// + //////////////////////// + + | /** A step that can embed text */ + "embed" + | /** A step that can search for documents (in the agents doc store only) */ + "search" + + /////////////////////// + /// Key-value steps /// + /////////////////////// + + | /** set step */ + "set" + | /** get step */ + "get" + + /////////////////////// + /// Iteration steps /// + /////////////////////// + + | /** foreach step */ + "foreach" + | /** map_reduce step */ + "map_reduce" + | /** parallel step */ + "parallel" + + ///////////////////////// + /// Conditional steps /// + ///////////////////////// + + | /** switch step */ + "switch" + | /** A step that runs a conditional */ + "if_else" + + ////////////////////////// + /// Other control flow /// + ////////////////////////// + + | /** sleep step */ + "sleep" + | /** return step */ + "return" + | /** A step that runs a subworkflow */ + "yield" + | /** Throw an error */ + "error"; \ No newline at end of file diff --git a/typespec/tasks/steps.tsp b/typespec/tasks/steps.tsp new file mode 100644 index 000000000..152f6482b --- /dev/null +++ b/typespec/tasks/steps.tsp @@ -0,0 +1,273 @@ +import "@typespec/http"; + +import "../chat"; +import "../common"; +import "../docs"; +import "../entries"; + +import "./step_kind.tsp"; + +using TypeSpec.Http; + +using Chat; +using Common; +using Docs; +using Entries; + +namespace Tasks; + +// +// STEP DEFINITIONS +// + +/** An object where values are strings in the Common Expression Language that get evaluated before being passed downstream */ +alias ExpressionObject = Record; + +model BaseWorkflowStep { + /** The kind of step */ + kind_: WorkflowStepKind; +} + +BREAKING THIS FILE INTENTIONALLY SO IT DOESTN'T GET COMPILED +BECAUSE IT SEEMS LIKE TYPESPEC HAS A BUG WHERE IT ADDS `{}` TO THE RENDERED `NonConditionalWorkflowStep` +YOU CAN COMMENT THIS AND COMPILE IF YOU KNOW WHAT YOU'RE DOING + +alias NonConditionalWorkflowStep = + | EvaluateStep + | ToolCallStep + | YieldStep + | PromptStep + | ErrorWorkflowStep + | SleepStep + | ReturnStep + | GetStep + | SetStep + | LogStep + | EmbedStep + | SearchStep + | WaitForInputStep; + +alias ConditionalStep = IfElseWorkflowStep | SwitchStep; +alias IterationStep = ForeachStep | ParallelStep | MapReduceStep; +alias WorkflowStep = NonConditionalWorkflowStep | ConditionalStep | IterationStep; + +alias CreateWorkflowStep = WorkflowStep; + +//////////////////// +/// Common steps /// +//////////////////// + +model ToolCallStep extends BaseWorkflowStep { + kind_: "tool_call" = "tool_call"; + + /** The tool to run */ + tool: toolRef; + + /** The input parameters for the tool */ + arguments: Record; +} + +model PromptStep extends BaseWorkflowStep { + kind_: "prompt" = "prompt"; + + /** The prompt to run */ + prompt: string | InputChatMLMessage[]; + + /** Settings for the prompt */ + settings: ChatSettings; +} + +model EvaluateStep extends BaseWorkflowStep { + kind_: "evaluate" = "evaluate"; + + /** The expression to evaluate */ + evaluate: ExpressionObject; +} + +model WaitForInputStep extends BaseWorkflowStep { + kind_: "wait_for_input" = "wait_for_input"; + + /** Any additional info or data */ + wait_for_input: ExpressionObject; +} + +model LogStep extends BaseWorkflowStep { + kind_: "log" = "log"; + + /** The value to log */ + log: PyExpression; +} + +//////////////////////// +/// Doc search steps /// +//////////////////////// + +model EmbedStep extends BaseWorkflowStep { + kind_: "embed" = "embed"; + + /** The text to embed */ + embed: EmbedQueryRequest; +} + +model SearchStep extends BaseWorkflowStep { + kind_: "search" = "search"; + + /** The search query */ + search: DocSearchRequest; +} + +/////////////////////// +/// Key-value steps /// +/////////////////////// + +model GetStep extends BaseWorkflowStep { + kind_: "get" = "get"; + + /** The key to get */ + get: string; +} + +model SetKey { + /** The key to set */ + key: string; + + /** The value to set */ + value: PyExpression; +} + +model SetStep extends BaseWorkflowStep { + kind_: "set" = "set"; + + /** The value to set */ + set: SetKey | SetKey[]; +} + +/////////////////////// +/// Iteration steps /// +/////////////////////// + + +model ParallelStep extends BaseWorkflowStep { + kind_: "parallel" = "parallel"; + + /** The steps to run in parallel. Max concurrency will depend on the platform */ + parallel: NonConditionalWorkflowStep[]; +} + +model ForeachDo { + /** The variable to iterate over */ + in: PyExpression; + + /** The steps to run for each iteration */ + do: NonConditionalWorkflowStep[]; +} + +model ForeachStep extends BaseWorkflowStep { + kind_: "foreach" = "foreach"; + + /** The steps to run for each iteration */ + foreach: ForeachDo; +} + +model MapOver { + /** The variable to iterate over */ + over: PyExpression; + + /** The subworkflow to run for each iteration */ + workflow: string; +} + +model MapReduceStep extends BaseWorkflowStep { + kind_: "map_reduce" = "map_reduce"; + + /** The steps to run for each iteration */ + map: MapOver; + + /** The expression to reduce the results (`_` is a list of outputs) */ + reduce: PyExpression; +} + +///////////////////////// +/// Conditional steps /// +///////////////////////// + +model IfElseWorkflowStep extends BaseWorkflowStep { + kind_: "if_else" = "if_else"; + + /** The condition to evaluate */ + `if`: PyExpression; + + /** The steps to run if the condition is true */ + then: NonConditionalWorkflowStep; + + /** The steps to run if the condition is false */ + `else`: NonConditionalWorkflowStep; +} + +model CaseThen { + /** The condition to evaluate */ + case: PyExpression; + + /** The steps to run if the condition is true */ + then: NonConditionalWorkflowStep; +} + +model SwitchStep extends BaseWorkflowStep { + kind_: "switch" = "switch"; + + /** The cond tree */ + switch: CaseThen[]; +} + +////////////////////////// +/// Other control flow /// +////////////////////////// + +model YieldStep extends BaseWorkflowStep { + kind_: "yield" = "yield"; + + /** The subworkflow to run */ + workflow: string; + + /** The input parameters for the subworkflow */ + arguments: ExpressionObject; +} + +model ErrorWorkflowStep extends BaseWorkflowStep { + kind_: "error" = "error"; + + /** The error message */ + error: string; +} + +model SleepFor { + /** The number of seconds to sleep for */ + @minValue(0) + seconds: uint16 = 0; + + /** The number of minutes to sleep for */ + @minValue(0) + minutes: uint16 = 0; + + /** The number of hours to sleep for */ + @minValue(0) + hours: uint16 = 0; + + /** The number of days to sleep for */ + @minValue(0) + days: uint16 = 0; +} + +model SleepStep extends BaseWorkflowStep { + kind_: "sleep" = "sleep"; + + /** The duration to sleep for */ + sleep: SleepFor; +} + +model ReturnStep extends BaseWorkflowStep { + kind_: "return" = "return"; + + /** The value to return */ + `return`: ExpressionObject; +}