Symptoms
When using the ChatGPT Conversation action, you see an error message stating, "Not enough tokens available to send the assistant message and the user message." You will see this error in the Zap editor when you test your ChatGPT step or in Zap history after your Zap runs.
Causes
This error happens when the token limit of the context window is exceeded due to the length of your input. Your input is the data added to these fields:
- User Message
- Assistant Instructions
The size of the context window varies depending on the specific model you’ve selected in your Zap.
How to fix it
To fix the issue, follow these steps:
Review the model's content window limit
- Review the OpenAI’s documentation for your chosen model's maximum tokens per content window.
Review your token usage
- Review your affected Zap run.
- Copy and paste the input (user message) and output (assistant’s response) into the OpenAI Tokenizer. This will give you an estimate of how many tokens you’ll use.
- Learn more about what tokens are and how to count them.
Adjust your input length
- Limit the length of your inputs in the User Message and Assistant Instructions fields to key information.
- If you are working with a large set of data, add a Formatter step before your ChatGPT step. This will allow you to split your text into chunks to use in your AI prompt.
Select an alternative model
- In your Zap, select another model with a larger context window to accommodate longer inputs.