Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Retrieval and CodeInterpreter Tools with Generic Interface for Extensibility #1

Open
eqbal opened this issue Apr 17, 2024 · 2 comments

Comments

@eqbal
Copy link

eqbal commented Apr 17, 2024

First off, amazing work on the openai-assistants-api-streaming project! It’s incredibly useful and well-documented, and I appreciate the effort to make the streaming capabilities more accessible.

I've been exploring your project and noticed it currently does not handle Retrieval or CodeInterpreter tools, which are pivotal for a range of applications using the OpenAI API. Integrating these tools could greatly enhance the project's capabilities, enabling users to implement more complex functionalities.

Do you think we can Enhance the thread.runs.create method to include a tools parameter that specifies which tools (e.g., retrieval, code_interpreter) the assistant can use. This would allow the assistant to leverage these tools dynamically based on user needs.

while(!is_completed) {
    let stream = tool_outputs.length === 0 ? await openai.beta.threads.runs.create(
        thread_id, {
            assistant_id: process.env.OPENAI_ASSISTANT_ID,
            stream: true,
            tools: ["code_interpreter", "retrieval"] // Enabling tools
        }
    ) : openai.beta.threads.runs.submitToolOutputsStream(
        thread_id,
        run_id,
        { tool_outputs }
    );

}

Additionally, I found the use of mockAPI in the codebase a bit confusing. Could you clarify its purpose? Perhaps consider enhancing the documentation or examples around this to better illustrate its usage and integration.

By making the project's architecture more generic and flexible, it could serve as a robust template for any OpenAI Assistant API project, allowing users to easily plug in different functionalities while maintaining full control over the tools and API interactions.

@adriaanrijkens
Copy link

Cool idea. Indeed it would be great if this project can server as a general template for OpenAI and maybe even in the future other AI APIs!

@bayrami1
Copy link

bayrami1 commented May 6, 2024

The mockAPI is used in the demo for the readme

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

No branches or pull requests

3 participants