-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add frontend for the http (not websocket) chat endpoint #19
Conversation
await self.send_event(event=chunk, more_body=True) | ||
await self.send_chunk(chunk) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Locally, this iteration takes many seconds, but the body text doesn't seem to actually be sent until it finishes. It is sent incrementally if an artificial await asyncio.sleep(0.1)
is inserted.
So, something doesn't seem right here, but it behaves this way on main
, too, so not related to the change from SSE to regular text.
bb43bf6
to
7c49eb0
Compare
.github/workflows/ci.yml
Outdated
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ./frontend-demo | ||
steps: | ||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | ||
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4 | ||
with: | ||
node-version: "^22" | ||
cache: yarn | ||
cache-dependency-path: yarn.lock | ||
|
||
- name: Install dependencies | ||
run: yarn install --immutable | ||
|
||
- name: Format | ||
run: yarn run fmt-check | ||
|
||
- name: Lints | ||
run: yarn run lint-check | ||
|
||
# do build before typecheck. See https://github.com/vercel/next.js/issues/53959#issuecomment-1735563224 | ||
- name: Build | ||
run: yarn build | ||
env: | ||
NODE_ENV: production | ||
NEXT_PUBLIC_MITOL_API_BASE_URL: "http://ai.test.local:8003" | ||
|
||
- name: Typecheck | ||
run: yarn typecheck | ||
|
||
- name: Tests | ||
run: yarn test | ||
env: | ||
CODECOV: true | ||
NODE_ENV: test |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions
.github/workflows/ci.yml
Outdated
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4 | ||
with: | ||
node-version: "^22" | ||
cache: yarn | ||
cache-dependency-path: yarn.lock | ||
|
||
- name: Install dependencies |
Check notice
Code scanning / CodeQL
Unversioned Immutable Action
25e39b5
to
df7d3a9
Compare
FROM ghcr.io/berriai/litellm:main-latest | ||
FROM ghcr.io/berriai/litellm:main-stable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
main-latest
was giving an error, moving to stable fixed it.
Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime
create failed: runc create failed: unable to start container process: exec: "docker/prod_entrypoint.sh": stat
docker/prod_entrypoint.sh: no such file or directory: unknown
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
What are the relevant tickets?
Description (What does it do?)
Adds a very minimal frontend intended for local development and possibly demoing that hits the chat API with component from https://mitodl.github.io/smoot-design/?path=/docs/smoot-design-aichat--docs
Additionally, this changes the SSE (server-sent events) endpoint to use raw text streaming. SSE proved somewhat inconvenient—. Browsers have an interface EventStream to parse the responses, but it only works with GET requests not POST. If we need a more structured format in the future, the format described here https://sdk.vercel.ai/docs/ai-sdk-ui/stream-protocol#data-stream-protocol might be good.
How can this be tested?
With the repo set up (you should only need
OPENAI_API_KEY
),docker compose up
and