[api][python] Introduce YAML API for declaring agents#670
Conversation
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
|
||
| name: str | ||
| description: str | None = None | ||
| namespace: str | None = None |
There was a problem hiding this comment.
The name namespace is confusing. Maybe something like default_func_path. Anyway, the semantic of this needs well description in documents.
There was a problem hiding this comment.
Do we need separate defaults for python and java?
There was a problem hiding this comment.
I think this default needs more careful design, otherwise it may introduce more confusion than convenience. I'd suggest to make this a follow-up and exclude from this PR.
| name: str | ||
| function: str | None = None | ||
| type: Language | None = None | ||
| parameter_types: List[str] | None = None |
There was a problem hiding this comment.
This needs a more detailed description. What are the required formats/values of the parameter type strings.
| """SafeLoader that recognizes only ``true``/``false`` as booleans. | ||
|
|
||
| PyYAML follows YAML 1.1 by default, where ``on``/``off``/``yes``/``no`` | ||
| also coerce to booleans. ``on:`` is the natural way to declare an |
There was a problem hiding this comment.
Can we change to another keyword?
| if "." in function: | ||
| qualified = function |
There was a problem hiding this comment.
What if namespace is foo and the function is foo.bar.Func?
| return agents, shared_resources, shared_actions, agent_specs, doc | ||
|
|
||
|
|
||
| def _assert_has_python_implementation( |
There was a problem hiding this comment.
Is this necessary? What if I implemented an agent in yaml + java, but need to use it in a pyflink job?
|
|
||
| def test_load_yaml_string_ref_to_missing_shared_action_errors() -> None: | ||
| env = AgentsExecutionEnvironment.get_execution_environment() | ||
| bad = _FIXTURES / "bad_missing_shared_action.yaml" |
There was a problem hiding this comment.
Should not write temporal contents in the source directory.
Linked issue: #625
Purpose of change
Tests
ut & e2e
API
Yes, add yaml api.
Documentation
doc-neededdoc-not-neededdoc-included