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 Terminal Phase Error Message #4935

Conversation

Future-Outlier
Copy link
Member

@Future-Outlier Future-Outlier commented Feb 23, 2024

Tracking issue

#3936

Why are the changes needed?

When Agent Tasks fail, we want to help users to find the bug quickly, so that it will be easier for us to identify the error from the agent server or flyte-propeller.

What changes were proposed in this pull request?

add resource.Message in all Terminal Phase. (Except for Success)

Additional Information: FlytePropeller will send task logs to FlyteAdmin when the phase changes, and FlyteConsole will show the error message sent by FlyteAdmin.

How was this patch tested?

In this PR, the chatgpt agent will return Resource(phase=TaskExecution.FAILED, message=str(error_message)) when faced with errors like Timeout Error or Authentication Error.

This PR can help users a lot with what errors they meet.

chatgpt_new_job = ChatGPTTask(
            name="chatgpt",
            openai_organization="xxx",
            chatgpt_config={
                    "model": "gpt-3.5-turbo",
                    "temperature": 0.7,
            },
        )

https://github.com/flyteorg/flytekit/blob/6c36d35dec70a4275b8477b0879a9af9fc70cbea/plugins/flytekit-openai/flytekitplugins/chatgpt/agent.py#L54

image

Check all the applicable boxes

  • I updated the documentation accordingly.
  • All new and existing tests passed.
  • All commits are signed-off.

Signed-off-by: Future-Outlier <eric901201@gmail.com>
@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. enhancement New feature or request labels Feb 23, 2024
Copy link

codecov bot commented Feb 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 58.93%. Comparing base (bb285d6) to head (9516880).
Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4935   +/-   ##
=======================================
  Coverage   58.93%   58.93%           
=======================================
  Files         645      645           
  Lines       55414    55414           
=======================================
  Hits        32656    32656           
  Misses      20175    20175           
  Partials     2583     2583           
Flag Coverage Δ
unittests 58.93% <100.00%> (ø)

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.

Future-Outlier and others added 3 commits February 23, 2024 16:15
Co-authored-by: Kevin Su <pingsutw@gmail.com>
Signed-off-by: Future-Outlier <eric901201@gmail.com>
Signed-off-by: Future-Outlier <eric901201@gmail.com>
Signed-off-by: Future-Outlier <eric901201@gmail.com>
Copy link
Member

@pingsutw pingsutw left a comment

Choose a reason for hiding this comment

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

Thanks, it's extremely helpful

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Feb 23, 2024
@Future-Outlier Future-Outlier merged commit cf992f5 into flyteorg:master Feb 23, 2024
49 checks passed
yubofredwang pushed a commit to yubofredwang/flyte that referenced this pull request Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request lgtm This PR has been approved by a maintainer size:XS This PR changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants