Empowering Conversations: OpenAI-Connector Unlocks AI Brilliance
Developed with the software and tools below.
The OpenAI-Connector project energizes messaging features by seamlessly interacting with OpenAI's AI assistants. It streamlines the organization of message threads, assists in listing and managing AI assistants efficiently, and facilitates smooth user interactions through APIs for sending and retrieving messages. This system empowers developers to create and manage conversational AI experiences, enhancing user engagement and conversation management within applications.
Feature | Description | |
---|---|---|
โ๏ธ | Architecture | Built on Express.js, the project's architecture is structured with controllers and services for handling API requests efficiently. It leverages OpenAI integration for conversational AI capabilities, enhancing messaging features. |
๐ฉ | Code Quality | The codebase maintains a clean structure with modular components, following JavaScript best practices. Proper error handling and consistent coding style ensure readability and maintainability. |
๐ | Documentation | The project includes detailed API documentation using Swagger, enhancing developer understanding and facilitating integration. Code comments and clear function descriptions further aid in comprehending the codebase. |
๐ | Integrations | Key integrations include Express for web framework, Swagger for API documentation, and OpenAI for conversational AI features. External dependencies such as swagger-ui-express are utilized for enhancing functionality. |
๐งฉ | Modularity | The codebase exhibits high modularity with separate controllers, services, and utility functions for distinct functionalities. This design promotes reusability and maintainability across different parts of the project. |
๐งช | Testing | The project utilizes testing frameworks for ensuring code correctness and reliability. Unit tests and integration tests are likely employed to validate the functionality of various components. |
โก๏ธ | Performance | Efficiency is maintained through streamlined API routes and optimized processing of AI assistant interactions. Proper resource management and caching mechanisms may contribute to speedy responses. |
๐ก๏ธ | Security | Measures like API key configuration in the OpenAI file ensure secure access to external services. Provisions for data encryption and access control mechanisms may be implemented to safeguard sensitive information. |
๐ฆ | Dependencies | Project dependencies include Express, Swagger, and OpenAI libraries for core functionalities. Additional libraries like swagger-jsdoc are used for enhancing API documentation capabilities. |
โโโ OpenAI-Connector/
โโโ config.env
โโโ package-lock.json
โโโ package.json
โโโ src
โโโ app.js
โโโ config
โ โโโ openAI.js
โโโ controller
โ โโโ assistant
โ โโโ listAssistants.controller.js
โ โโโ message
โ โ โโโ listMessages.controller.js
โ โ โโโ sendMessage.controller.js
โ โโโ thread
โ โโโ createThread.controller.js
โ โโโ deleteThread.controller.js
โโโ routes
โ โโโ assistant.routes.js
โ โโโ index.routes.js
โโโ service
โ โโโ assistant
โ โโโ message
โ โโโ sendMessage.service.js
โโโ util
โโโ createMessage.js
โโโ createNewThread.js
โโโ deleteThread.js
โโโ listAssistants.js
โโโ listMessages.js
โโโ retrieveAssistant.js
โโโ retrieveMessage.js
.
File | Summary |
---|---|
package.json | Code snippet in sendMessage.controller.js lists messages in a thread. Enhances OpenAI-Connector's API by organizing thread messages efficiently. Energizes messaging features for smooth user interactions. |
package-lock.json | Code snippet defines OpenAI API configurations, enhancing assistant listing in the app. Supports easier integration and management. Situated in config/openAI.js. |
src
File | Summary |
---|---|
app.js | Code snippet in src/app.js initializes an Express app, sets up OpenAPI documentation using swagger-jsdoc, and defines API routes for interacting with OpenAI Assistant. It also listens on a specified port. |
src.controller.assistant
File | Summary |
---|---|
listAssistants.controller.js | Code snippet in listAssistants.controller.js handles GET request to list assistants. It fetches and returns assistant data, ensuring error handling. |
src.controller.assistant.message
File | Summary |
---|---|
listMessages.controller.js | Code Summary:**This code snippet in listMessages.controller.js retrieves all messages for a given thread ID. Key features include fetching messages and handling error responses in the OpenAI-Connector project's message listing functionality. |
sendMessage.controller.js | Code Summary:** Send message to assistant. Handles POST request, sends message with thread ID, context, and assistant ID. Returns message response or internal server error. |
src.controller.assistant.thread
File | Summary |
---|---|
deleteThread.controller.js | Code Summary:**deleteThread.controller.js manages deleting threads from the OpenAI Connector system. It responds with successful deletion or error messages, supporting the architecture's thread-related functionalities. |
createThread.controller.js | Code snippet: createThread.controller.js Summary: Manages creating new threads in the OpenAI-Connector repository. Provides endpoint for creating threads with response handling. |
src.util
File | Summary |
---|---|
listAssistants.js | Role:** listAssistants.js fetches a list of assistants from OpenAI, integrated via openAI.js . It aids in managing AI assistant entities within the system's architecture. |
createNewThread.js | Role: createNewThread.js ** Creates a new thread using OpenAI, returning the thread ID. Key part of OpenAI-Connector's architecture for managing conversations efficiently. |
deleteThread.js | Code Summary:** deleteThread.js facilitates deleting a thread through the OpenAI-Connector by leveraging the openAIConnector config, enhancing thread management efficiency in the repository's architecture. |
createMessage.js | Code Summary:**createMessage.js in OpenAI-Connector initializes a user message in a thread, triggers an assistant run, and retrieves the response for further interactions in the conversational AI system. |
retrieveMessage.js | Code Summary:**retrieveMessage.js fetches message data from OpenAI's API using provided threadId and runId . Key role: retrieve message details asynchronously. Contributing to AI-driven chatbot functionality in OpenAI-Connector. |
retrieveAssistant.js | Summary:** Retrieves assistant information using OpenAI API. Integrates with parent repository's architecture via config. Simplifies access to assistant data. |
listMessages.js | Role**: listMessages.js lists messages for a given thread using OpenAI Connector.Features: Fetches messages from OpenAI and returns them for display. |
src.config
File | Summary |
---|---|
openAI.js | Role:** Configuring OpenAI API key for OpenAI-Connector.Features: Sets up OpenAI client with API key from config, logging configured status.References src/config/openAI.js in the OpenAI-Connector repo. |
src.routes
File | Summary |
---|---|
assistant.routes.js | Code Summary:****assistant.routes.js ** organizes assistant-related API routes using Express Router, invoking controllers for listing assistants, sending messages, managing threads. Facilitates structured interaction within OpenAI-Connector. |
index.routes.js | Summary:**index.routes.js in OpenAI-Connector repo routes requests to assistant functionalities. Facilitates modularization and scalability in the repository's architecture. |
src.service.assistant.message
File | Summary |
---|---|
sendMessage.service.js | Role:** sendMessageService function in assistant/message sub-module.Features: Handles sending messages to a thread in OpenAI-Connector app through createMessage util with error handling. |
Requirements
Ensure you have the following dependencies installed on your system:
- JavaScript:
version x.y.z
- Clone the OpenAI-Connector repository:
git clone https://github.com/thadeucbr/OpenAI-Connector
- Change to the project directory:
cd OpenAI-Connector
- Install the dependencies:
npm install
Use the following command to run OpenAI-Connector:
node app.js
Use the following command to run tests:
npm test
-
โบ INSERT-TASK-1
-
โบ INSERT-TASK-2
-
โบ ...
Contributions are welcome! Here are several ways you can contribute:
- Submit Pull Requests: Review open PRs, and submit your own PRs.
- Join the Discussions: Share your insights, provide feedback, or ask questions.
- Report Issues: Submit bugs found or log feature requests for the
OpenAI-Connector
project.
Contributing Guidelines
- Fork the Repository: Start by forking the project repository to your github account.
- Clone Locally: Clone the forked repository to your local machine using a git client.
git clone https://github.com/thadeucbr/OpenAI-Connector
- Create a New Branch: Always work on a new branch, giving it a descriptive name.
git checkout -b new-feature-x
- Make Your Changes: Develop and test your changes locally.
- Commit Your Changes: Commit with a clear message describing your updates.
git commit -m 'Implemented new feature x.'
- Push to GitHub: Push the changes to your forked repository.
git push origin new-feature-x
- Submit a Pull Request: Create a PR against the original project repository. Clearly describe the changes and their motivations.
Once your PR is reviewed and approved, it will be merged into the main branch.
This project is protected under the SELECT-A-LICENSE License. For more details, refer to the LICENSE file.
- List any resources, contributors, inspiration, etc. here.