How to maintain a conversation with ChatGPT while providing long instructions and writing articles?

I’m sorry, but I couldn’t find a specific Discord URL for Pipedream Help. However, you can visit Pipedream’s support page at https://pipedream.com/support for more support options. If you have any questions about Pipedream or need assistance, feel free to ask here, and I’ll do my best to help.

I am having a difficult time getting Chat GPT to carry on conversations.

I’m sorry to hear that you’re having trouble with Chat GPT. To help you better, I need more information about your current setup. Can you please provide details about your workflow, such as: 1. The configuration of the Chat GPT app in your workflow (user message, system instructions, and prior message history). 2. Any specific issues or errors you’re encountering. With more information, I’ll be able to provide guidance on how to resolve the issue and help you get Chat GPT to carry on conversations effectively.

I have a trigger from AIRTABLE working to pull the content I need to look up.

This takes the content and pushes it into Chat GPT. Because the content is long, I need to chat two times. The first is to give Chat GPT the definitions and the second is to give it the content so it can formulate it.

To achieve this in your Pipedream workflow, you can use two ChatGPT actions in sequence. The first action will provide the definitions, and the second action will provide the content for ChatGPT to formulate a response. Here’s a step-by-step guide: 1. Add the first ChatGPT action to your workflow after the Airtable trigger. - Set the “User Message” field to the definitions you want to provide to ChatGPT. - Optionally, set the “System Instructions” field to guide ChatGPT’s behavior, e.g., “You are a helpful assistant.” 2. Add the second ChatGPT action to your workflow after the first ChatGPT action. - Set the “User Message” field to the content you want ChatGPT to process. - Optionally, set the “System Instructions” field to guide ChatGPT’s behavior, e.g., “You are a helpful assistant.” - In the “Prior Message History” field, provide the conversation history from the first ChatGPT action. You can reference the output of the first ChatGPT action using steps.chat_gpt_action_name.outputs.original_messages_with_assistant_response, replacing chat_gpt_action_name with the name of the first ChatGPT action in your workflow. After setting up these two ChatGPT actions, your workflow will first provide the definitions to ChatGPT and then give it the content to formulate a response. The response from the second ChatGPT action can be used in subsequent steps of your workflow.

I have set up the chat the way that you have told me above, but continue to get the following error:

TypeError
Cannot read property 'role' of undefined

I apologize for the inconvenience you’re experiencing. To help you resolve the error, I need more information about your current setup. Please provide the code you’re using for both ChatGPT actions in your workflow, including the user message, system instructions, and prior message history. This will help me identify any issues in the code that might be causing the “Cannot read property ‘role’ of undefined” error.

Here is the error.

Configuration error
The following message doesn't have a "role" property:
[
{
"role": "system",
"content": "You are a library assistant."
},
{
"role": "user",
"content": "Who wrote the book Native Son?"
},
{
"role": "assistant",
"content": "The book Native Son was written by Richard Wright."
}
]

It seems like there’s an issue with the message format in the “Prior Message History” field of your second ChatGPT action. Please make sure that the message objects in the array have the correct “role” and “content” properties. Based on the error message you provided, it appears that one of the message objects is missing the “role” property. Double-check your code to ensure that all message objects in the “Prior Message History” field have both “role” and “content” properties. If you’re still facing issues, please share the code you’re using for both ChatGPT actions in your workflow, including the user message, system instructions, and prior message history. This will help me identify any issues in the code that might be causing the error.

My step is called chat_2.

And I am passing it the following PATH.
{{steps.chat_1.$return_value.original_messages_with_assistant_response}}

It seems like you’re correctly passing the prior message history from the first ChatGPT action (chat_1) to the second ChatGPT action (chat_2). However, the error you provided earlier indicates that there’s an issue with the message format in the “Prior Message History” field. To help you further, please share the configuration of both ChatGPT actions in your workflow, including the user message, system instructions, and prior message history. This will help me identify any issues in the code that might be causing the “Cannot read property ‘role’ of undefined” error.

I figured it out.

The field needed me to put the array’s in separately.

{{steps.chat_1.$return_value.original_messages_with_assistant_response[0]}}
{{steps.chat_1.$return_value.original_messages_with_assistant_response[1]}}
{{steps.chat_1.$return_value.original_messages_with_assistant_response[2]}}

I’m glad you figured it out and resolved the issue! If you have any more questions or need further assistance, feel free to ask. I’m here to help!