Coverage for aipyapp/cli/command/result.py: 0%
16 statements
« prev ^ index » next coverage.py v7.10.3, created at 2025-08-11 12:02 +0200
« prev ^ index » next coverage.py v7.10.3, created at 2025-08-11 12:02 +0200
1#!/usr/bin/env python3
2# -*- coding: utf-8 -*-
4from typing import Any
5from pydantic import BaseModel, model_validator
8class CommandResult(BaseModel):
9 command: str
10 subcommand: str | None
11 args: dict[str, Any]
12 result: Any
14class TaskModeResult(BaseModel):
15 task: Any | None = None
16 instruction: str | None = None
17 title: str | None = None
19 @model_validator(mode='after')
20 def validate_task_or_instruction(self):
21 if self.task is None and self.instruction is None:
22 raise ValueError("task or instruction must be provided")
23 return self