CopilotKit / CopilotKit

React UI + elegant infrastructure for AI Copilots, in-app AI agents, AI chatbots, and AI-powered Textareas 🪁
https://copilotkit.ai
MIT License
12.12k stars 1.86k forks source link

Implement assistant API streaming #266

Closed mme closed 4 months ago

mme commented 7 months ago

Is your feature request related to a problem? Please describe. OpenAI just launched streaming support in the assistant API. CopilotKit should support streaming responses via the assistant API.

Describe the solution you'd like Modify https://github.com/CopilotKit/CopilotKit/blob/main/CopilotKit/packages/backend/src/lib/openai-assistant-adapter.ts to use streaming. See: https://platform.openai.com/docs/assistants/overview?context=with-streaming

CopilotKit commented 7 months ago

/bounty $15

algora-pbc commented 7 months ago

💎 $15 bounty • CopilotKit

Steps to solve:

  1. Start working: Comment /attempt #266 with your implementation plan
  2. Submit work: Create a pull request including /claim #266 in the PR body to claim the bounty
  3. Receive payment: 100% of the bounty is received 2-5 days post-reward. Make sure you are eligible for payouts

Thank you for contributing to CopilotKit/CopilotKit!

Add a bountyShare on socials

Attempt Started (GMT+0) Solution
🟢 @pi600 Mar 14, 2024, 12:01:11 PM WIP
🔴 @chintanpuggalok Apr 5, 2024, 6:53:07 PM WIP
🟢 @abhijitxy May 3, 2024, 7:24:56 AM WIP
🔴 @hrshkshri May 8, 2024, 6:26:59 AM WIP
🟢 @amaanlari May 8, 2024, 8:50:32 PM WIP
Bhavyajain21 commented 7 months ago

Can I be assigned?

pi600 commented 7 months ago

/attempt #266

ataibarkai commented 7 months ago

@Bhavyajain21 yes.

Bhavyajain21 commented 7 months ago

Please assign

ataibarkai commented 7 months ago

@Bhavyajain21 it's assigned

Bhavyajain21 commented 7 months ago

@ataibarkai Thanks for assigning

Bhavyajain21 commented 7 months ago

@mme / @ataibarkai
The provided code under (https://github.com/CopilotKit/CopilotKit/blob/main/CopilotKit/packages/backend/src/lib/openai-assistant-adapter.ts) already utilizes streaming to communicate with the OpenAI API for assistant interactions.

The provided documentation mentions streaming support but doesn't go into specific implementation details. It emphasizes the ability to continue conversations through threads, which aligns with the current code's approach.

Is there anything different we are expecting out of it?

mme commented 7 months ago

Hi @Bhavyajain21 ! According to the OpenAI docs, there should be a new method available called createAndStream. Can you have a look at this method? You would need to update the openai package to the lastest version.

Bhavyajain21 commented 7 months ago

Got that, thanks for the input!

chintanpuggalok commented 6 months ago

/attempt #266

abhijitxy commented 5 months ago

/attempt #266

hrshkshri commented 5 months ago

/attempt #266

amaanlari commented 5 months ago

/attempt #266

srikary12 commented 4 months ago

@mme Is the issue still open?

mme commented 4 months ago

@srikary12 this one is closed now.