njfio / fluent_cli

Fluent CLI is an advanced command-line interface designed to interact seamlessly with multiple workflow systems like FlowiseAI, Langflow, Make, and Zapier. Tailored for developers and IT professionals, Fluent CLI facilitates robust automation, simplifies complex interactions, and enhances productivity through a powerful and command suite
https://fluentcli.com
Apache License 2.0
13 stars 2 forks source link

V.0.3.5.7.1 This PR introduces several improvements to the CLI's JSON handling and improved support for webhook integrations. #31

Closed njfio closed 3 months ago

njfio commented 3 months ago

Key Changes:

- Improved JSON Parsing in Response Handler: The response handler now parses the response body as a generic JSON value using serde_json::Value. This
allows for more flexible handling of different response structures, especially for webhook integrations which might not always return a 
FluentCliOutput object.
- Extracting Data from Generic JSON: The updated handler now extracts specific fields like "text" and "agentReasoning" from the generic JSON object.
This ensures compatibility with various response formats.
- Added Webhook Support:  Added configurations for interacting with webhook endpoints. This allows integration with services like n8n for image 
generation and chat flows.
- Updated Payload Preparation: The prepare_payload function now better handles different engine types, including updating tweaks configurations with
full questions for Langflow integrations.
- Enhanced Configuration Handling:  The CLI now supports nested key-value pairs in override and tweak configurations, providing more fine-grained 
control over parameters.
- Preserving Array Structures: When updating configuration values, the code now preserves existing array structures instead of overwriting them, 
allowing for more flexible customization.

Benefits:

- Increased Flexibility: The CLI can now interact with a wider range of services and handle diverse response formats.
- Improved User Experience: The enhanced configuration handling provides users with more control and customization options.
- New Integrations: Webhook support opens up possibilities for integrating with various third-party services.

Testing:

-  Verified that the updated response handler correctly parses and displays responses from both Flowise and Langflow endpoints.
-  Tested the webhook integrations by successfully sending requests and receiving responses from the configured endpoints.
-  Confirmed that the updated configuration handling correctly applies overrides and tweaks to different engine types.

This PR enhances the functionality and flexibility of the Fluent CLI, making it a more powerful tool for interacting with AI agents and services.