The message property in the sendAllProps type has been renamed to inputs to better reflect its purpose. This change improves the semantics of the code and makes it easier to understand the purpose of the property.
The message field of the ChatMessage schema now supports a dictionary type in addition to the previous string and None types. This change was made to allow for more complex messages to be sent and received in the chat.
✨ feat(formModal): add function to format message inputs into a string
This commit removes unused imports and variables from the file. A new function was added to format the message inputs into a string, which is used to display the message in the chat. This improves the readability of the code and makes it easier to understand how the message is being constructed.
✨ feat(formModal): add Input Variables section to Chat Form modal to allow users to input variables
🎨 style(formModal): adjust width of Chat Form modal and Input Variables section to improve UI
🎨 style(formModal): adjust layout of Input Variables section to improve UI
🎨 style(formModal): adjust layout of From Chat switch to improve UI
🐛 fix(formModal): replace Switch component with custom ToggleShadComponent to fix styling issue
✨ feat(validate.py): add support for dynamic template fields in prompt validation
The changes in this commit remove unused variables from the prompt.frontend_node.template. The commit also adds support for dynamic template fields in prompt validation. The new variables are added to the template and the custom_fields list. The old custom_fields list is copied and then updated with the new variables. The variables that are not in the template anymore are removed from the prompt.frontend_node.template.
The setNodeClass function is now passed down to PromptAreaComponent from ParameterComponent. This allows the nodeClass to be set when a prompt is used.
The `dict()` method was causing a TypeError when trying to serialize the `template_field` object. The `to_dict()` method is the correct method to use to serialize the object.
The try-catch blocks were added to handle errors that may occur when the function is called. This improves the robustness of the function and prevents it from crashing when an error occurs.
🎨 style(chatMessage.tsx): change icon from MessageCircle to MessageSquare to improve semantics
🎨 style(index.tsx): add new icons to the import statement and change MessageSquareDashed to MessageSquare to improve semantics. Add padding to the chat modal to improve aesthetics.
✨ feat(promptComponent, genericModal): add setNodeClass prop to PromptAreaComponent and GenericModal to update nodeClass
The checkPrompt function has been renamed to postValidatePrompt to better reflect its functionality. The PromptTypeAPI now includes a frontend_node property, which is used to update the nodeClass in the PromptAreaComponent and GenericModal components. The setNodeClass prop has been added to both components to allow for updating the nodeClass.
🔥 chore(base.py): remove unused FrontendNodeRequest class
🔨 refactor(validate.py): modify post_validate_prompt function to update the template field in the frontend_node object
The ValidatePromptRequest class was using the FrontendNode class instead of the FrontendNodeRequest class, which caused an error. The unused FrontendNodeRequest class was removed. The post_validate_prompt function was modified to update the template field in the frontend_node object instead of appending to the fields list.
🚀 feat(formModal.tsx): add support for multiple input keys and values to be sent in the chat message
🐛 fix(formModal.tsx): fix keysValue state initialization and message object creation
🚀 feat(formModal.tsx): add switch component to select which input key to send in the chat message
🎨 style(formModal.tsx): add muted background color to input keys container
🐛 fix(api/index.ts): change message type to any to support multiple input keys and values
The FrontendNode class now has a new attribute called custom_fields, which is a list of strings. This attribute can be used to store any custom fields that are specific to a particular frontend node. This change allows for more flexibility in the data that can be stored in a FrontendNode object.
✨ feat(base.py): add frontend_node parameter to ValidatePromptRequest and PromptValidationResponse models
The validate_prompt endpoint now accepts a frontend_node parameter in the ValidatePromptRequest model. This parameter is used to add input variables to the frontend_node's template fields and custom fields. The PromptValidationResponse model now includes the frontend_node parameter to return the updated frontend_node object.
🔨 refactor(promptComponent): add nodeClass prop to improve code consistency
🔨 refactor(genericModal): add nodeClass prop to improve code consistency
🔨 refactor(types/components): remove unused imports and add nodeClass prop to TextAreaComponentType
The changes made in the code aim to improve code readability and consistency. The ParameterComponent, PromptAreaComponent, and GenericModal components now have a nodeClass prop to improve consistency with the naming conventions. The TextAreaComponentType now has a nodeClass prop to improve consistency with the other components.
The checkPrompt function was not properly validating prompts due to missing frontend_node parameter. The fix adds the frontend_node parameter to the function and passes it to the axios.post request.
🚀 feat(CodeAreaModal): replace UpdateTemplate function with postCustomComponent function to send custom component code to the server
The UpdateTemplate function was not being used and was removed. The postCustomComponent function was added to send custom component code to the server. The CodeAreaModal component was updated to use the new postCustomComponent function instead of the UpdateTemplate function to send custom component code to the server.
The config.yaml file has been updated to include new prompt templates. In types.py, the input_variables list was not being cleared when prompt or messages were present, which has been fixed. The instantiate_prompt function in loading.py has been updated to support the new prompt templates.
🔀 chore(config): add new prompt templates to config.yaml
🐛 fix(types.py): fix input_variables not being cleared when prompt or messages are present
The `AgentType` enum is added to the `langchain.agents.custom` module to improve readability and type safety. The `InitializeAgent` class now uses the `AgentType` enum to ensure that the `agent` parameter is a valid value from the enum.
🚀 feat(chat.py): use build_input_keys_response function to build input keys response
The build_input_keys_response function was extracted from the remove_api_keys function to improve code reusability. It builds the input keys response object, which contains the input keys and memory keys of a langchain object. The chat.py file now uses this function to build the input keys response object instead of building it manually. This improves code readability and reduces code duplication.