Open
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.