AI Action: Generate personalized messages #474
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
User description
TP-2510: "Create personalized message" action
PR Type
New AI Action added
Description
generateMessage
action to create personalized messages using LLM, with error handling and integration with OpenAI.Changes walkthrough 📝
8 files
datapoints.ts
Define data points for message generation
extensions/shelly/actions/generateMessage/config/datapoints.ts
subject
andmessage
.fields.ts
Define fields and validation schema for message form
extensions/shelly/actions/generateMessage/config/fields.ts
communicationObjective
,personalizationInput
, and others.index.ts
Export fields, validation schema, and data points
extensions/shelly/actions/generateMessage/config/index.ts
generateMessage.ts
Implement generateMessage action for personalized messages
extensions/shelly/actions/generateMessage/generateMessage.ts
generateMessage
action for personalized messagegeneration.
index.ts
Export generateMessage function
extensions/shelly/actions/generateMessage/index.ts
generateMessage
function.constants.ts
Define constants and prompt templates for LLM
extensions/shelly/actions/generateMessage/lib/generateMessageWithLLM/constants.ts
generateMessageWithLLM.ts
Implement generateMessageWithLLM function with retry mechanism
extensions/shelly/actions/generateMessage/lib/generateMessageWithLLM/generateMessageWithLLM.ts
generateMessageWithLLM
function for message generation.index.ts
Export generateMessageWithLLM function
extensions/shelly/actions/generateMessage/lib/generateMessageWithLLM/index.ts
generateMessageWithLLM
function.4 files
generateMessage.test.ts
Add tests for message generation with mocked LLM
extensions/shelly/actions/generateMessage/generateMessage.test.ts
generateMessageRealOpenAI.test.ts
Add tests for real OpenAI message generation
extensions/shelly/actions/generateMessage/generateMessageRealOpenAI.test.ts
generateMessageWithLLM.test.ts
Add unit tests for generateMessageWithLLM function
extensions/shelly/actions/generateMessage/lib/generateMessageWithLLM/generateMessageWithLLM.test.ts
generateMessageWithLLM
function.generateMessageWithLLMRealOpenAI.test.ts
Add integration tests for generateMessageWithLLM with real OpenAI
extensions/shelly/actions/generateMessage/lib/generateMessageWithLLM/generateMessageWithLLMRealOpenAI.test.ts
generateMessageWithLLM
using real OpenAI.