 a ZenML secret:

zenml integration install openaizenml secret create openai --api_key=<YOUR_API_KEY>

Then, you can use the hook in your pipeline:

from zenml.integration.openai.hooks import openai_chatgpt_alerter_failure_hook

from zenml import step

@step(on_failure=openai_chatgpt_alerter_failure_hook)

def my_step(...):

...

If you had set up a Slack alerter as your alerter, for example, then you would see a message like this:

You can use the suggestions as input that can help you fix whatever is going wrong in your code. If you have GPT-4 enabled for your account, you can use the openai_gpt4_alerter_failure_hook hook instead (imported from the same module).

PreviousName your pipeline runs

NextHyperparameter tuning

Last updated 15 days ago