Skip to content

Assistants#1

Open
adg29 wants to merge 25 commits intomainfrom
assistants
Open

Assistants#1
adg29 wants to merge 25 commits intomainfrom
assistants

Conversation

@adg29
Copy link
Owner

@adg29 adg29 commented Mar 23, 2024

No description provided.

ArpitxGit and others added 25 commits September 20, 2023 20:14
Introduced a loop to periodically check the status of OpenAI thread runs, preventing premature retrieval of an unfinished run. This update ensures the application waits for completion before it proceeds to retrieve the assistant's messages.
Improve OpenAI run handling
Revamped the `/api/assist` route to streamline processing and enhance efficiency. Replaced synchronous checks within `app.post` with an asynchronous `createAndMonitorRun` function that utilizes polling for run status updates. Integrated `handleRequiredActions` for dynamic action handling and `retrieveAssistantMessages` for cleaner message retrieval. This refactor aids in handling concurrent requests more effectively by isolating thread creation, run monitoring, and message parsing into individual, composable functions. Additionally, error handling has been centralized using middleware, improving the robustness of error responses. The result is an assist endpoint that is more maintainable
Introduced the initial documentation for the Node.js server in the form of a README. The document outlines the integration with OpenAI's API and provides instructions for server initialization, including environment configuration for API keys and customizable port settings.
Refactored the thread processing to include image descriptions more cohesively. The changes add an `imageDescription` parameter in `createAndMonitorRun` and `handleRequiredActions` to facilitate generating and retrieving image descriptions alongside tool outputs. This ensures image descriptions are now integral to the processing flow and returned with run data. Additionally, updated model calls to align with the latest `gpt-4-turbo` API specifications and corrected the use of `openai.chat.completions.create` to match the new format. Improved error handling where `imageDescription` is mandatory for posts assisting in better context management.

This update reinforces the importance of contextual descriptions in image-related tasks and prepares the system for broader vision capabilities.
Enhanced the README documentation by revising the Server Initialization section header for consistency and added detailed examples of API endpoints for testing purposes. These examples simplify the process of making requests to the roles and posts endpoints, aiding developers in understanding and utilizing the server's API integration features effectively.
Refactor assist endpoint for concurrency
Logging added for message processing to aid in debugging. Simplified the system's description prompt, focusing on essential character traits for image generation, ensuring it fits JSON API constraints and improves clarity. Switched AI model to 'gpt-4o' for optimized response generation. Introduced middleware to handle JSON parsing errors gracefully, enhancing the robustness of request handling.
… prompts. Improved clarity of image description instructions in `describeSystemPrompt`.

Added cancellation endpoint for run operations, which now requires a `threadId` and `runId` and logs cancellation actions correctly. The new endpoint strengthens control over ongoing processes and enhances error handling by checking for mandatory fields.
Introduced a shared Postman workspace link to the README to improve API testing workflows. This update enables easier use of global variables like image description, thread, and run ID across roles and post requests. Also added visualization support for images in responses, simplifying API testing and debugging processes for contributors.
gpt-4o and Image description prompt upgrades
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants