hololinked.metadata.td.interaction_affordance.ActionAffordance
Bases: InteractionAffordance, ActionMetadata
creates action affordance schema from actions (or methods).
Source code in repo/hololinked/hololinked/metadata/td/interaction_affordance.py
437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 | |
Functions
to_descriptor
Create the Action this affordance describes, invoking the given handler.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
Callable | ActionDelegate
|
the handler, a sync or async method, or the delegate to a method of another object |
required |
|
str
|
name the validator of the input is registered under with |
'pydantic'
|
Returns:
| Type | Description |
|---|---|
Action
|
the descriptor, not yet assigned to a class |
Raises:
| Type | Description |
|---|---|
InputSignatureError
|
if the parameters of the handler do not match the input, listing every mismatch |
Source code in repo/hololinked/hololinked/metadata/td/interaction_affordance.py
| field | supported | meaning | default usage |
|---|---|---|---|
| input | ✔️ | schema of the input required to invoke action | input_schema value of action decorator |
| output | ✔️ | schema of the output returned by the action | output_schema value of action decorator |
| safe | ✔️ | true if the action is safe |
safe value of action decorator |
| idempotent | ✔️ | true if the action is idempotent |
idempotent value of action decorator |
| synchronous | ✔️ | true if the action is synchronous |
synchronous value of action decorator, (false for async or threaded functions) |