Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve agent plugin documentation with running examples and additional notes #5399

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Sovietaced
Copy link
Contributor

@Sovietaced Sovietaced commented May 21, 2024

I recently went through the process of developing an agent plugin by going through the docs. Previously the developing_agents documentation had a decent skeleton for the agent example but the local_python documentation had little to no accompanying task example. Its a big confusing because the agent is a stripped down big query agent that is not functional and then later the example task is just a real big query task.

Anyhow, I've spent some time updating the documentation to use a completely running agent, task, and example file. Previous agent pseudo code has been commented out and the general workflow has additional comments but there is dummy code that does actually run locally in a manner that someone can start making changes and get feedback immediately to start development.

pyflyte run example.py say_hello --name jason                                                                                                                                                                                                                      ▼ Py base 01:03:20 AM
Running Execution on local.
create called task_template=<FlyteLiteral(TaskTemplate) id { resource_type: TASK name: "armada_test_agent.example.say_hello" } type: "example" metadata { runtime { type: FLYTE_SDK version: "1.12.0" flavor: "python" } retries { } } interface { inputs { variables { key: "name" value { type { simple: STRING } description: "name" } } } outputs { variables { key: "o0" value { type { simple: STRING } description: "o0" } } } } custom { fields { key: "environment" value { string_value: "dev" } } } container { image: "cr.flyte.org/flyteorg/flytekit:py3.11-1.12.0" args: "pyflyte-execute" args: "--inputs" args: "/tmp/flyte-od3iwm33/raw/0991ba2310db3416e9ad85aba218c0d9/inputs.pb" args: "--output-prefix" args: "/tmp/flyte-od3iwm33/raw/0991ba2310db3416e9ad85aba218c0d9" args: "--raw-output-data-prefix" args: "/tmp/flyte-od3iwm33/raw/0991ba2310db3416e9ad85aba218c0d9/raw_output" args: "--checkpoint-path" args: "/tmp/flyte-od3iwm33/raw/0991ba2310db3416e9ad85aba218c0d9/checkpoint_output" args: "--prev-checkpoint" args: "/tmp/flyte-od3iwm33/raw/0991ba2310db3416e9ad85aba218c0d9/prev_checkpoint" args: "--resolver" args: "flytekit.core.python_auto_container.default_task_resolver" args: "--" args: "task-module" args: "armada_test_agent.example" args: "task-name" args: "say_hello" resources { } }>
get called resource_meta=ExampleMetadata(job_id='temp')

neverett
neverett previously approved these changes May 21, 2024
Copy link
Contributor

@neverett neverett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few small suggestions, otherwise LGTM!

Copy link

codecov bot commented May 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 60.22%. Comparing base (2f7bedf) to head (8cfeb6f).

Current head 8cfeb6f differs from pull request most recent head 2bff62e

Please upload reports for the commit 2bff62e to get more accurate results.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5399      +/-   ##
==========================================
- Coverage   60.23%   60.22%   -0.01%     
==========================================
  Files         646      646              
  Lines       45664    45691      +27     
==========================================
+ Hits        27505    27517      +12     
- Misses      15569    15580      +11     
- Partials     2590     2594       +4     
Flag Coverage Δ
unittests-datacatalog 69.31% <ø> (ø)
unittests-flyteadmin 58.86% <ø> (-0.05%) ⬇️
unittests-flytecopilot 17.79% <ø> (ø)
unittests-flyteidl 79.04% <ø> (-0.26%) ⬇️
unittests-flyteplugins 61.94% <ø> (ø)
unittests-flytepropeller 57.32% <ø> (ø)
unittests-flytestdlib 65.75% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Sovietaced
Copy link
Contributor Author

A few small suggestions, otherwise LGTM!

Thanks for the review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants