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

Playground state #64

Merged
merged 1 commit into from
Jan 17, 2024
Merged

Playground state #64

merged 1 commit into from
Jan 17, 2024

Conversation

feloy
Copy link
Contributor

@feloy feloy commented Jan 16, 2024

With this PR, in a Playground page, the query and the response are decorrelated.

  • the frontend sends a query and gets a queryId in return
  • the backend waits for the query to terminate, and updates the queries state with the result of the query
  • the frontend listens for the query state (through the playgroundQuery store), and updates the page with the result.
  • if the user leaves the Playground page and goes back later to the page, the latest query is displayed (either it is terminated or waiting for a response)

Other related changes:

  • the frontend can subscribe to messages from the RpcBrowser (which receives all messages from backend)
  • the container for the playground is not restarted if already started
  • a new port is used for every new playground's container, it should be possible to have several playground's containers running at the same time (to be tested)

TODO

  • tests

@feloy feloy marked this pull request as draft January 16, 2024 14:49
@feloy feloy requested review from benoitf and axel7083 January 16, 2024 14:49
@feloy feloy force-pushed the feat/playground-state branch 2 times, most recently from d55d9bd to 5d5e83a Compare January 16, 2024 18:24
@feloy feloy marked this pull request as ready for review January 17, 2024 08:17
@feloy feloy force-pushed the feat/playground-state branch from 93679d4 to 68fc3ae Compare January 17, 2024 10:16
@feloy feloy mentioned this pull request Jan 17, 2024
5 tasks
@feloy feloy self-assigned this Jan 17, 2024
@slemeur
Copy link
Contributor

slemeur commented Jan 17, 2024

👍

@feloy feloy force-pushed the feat/playground-state branch 2 times, most recently from ee94a65 to 8bc6682 Compare January 17, 2024 12:28
@feloy feloy requested a review from lstocchi January 17, 2024 12:39
Copy link
Contributor

@axel7083 axel7083 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just an idea, instead of having a method firing the first event to setup the store, we could make it return the state, and initiate the store with it, it would look less magic to read

packages/backend/src/studio-api-impl.ts Outdated Show resolved Hide resolved
packages/backend/src/playground.ts Outdated Show resolved Hide resolved
packages/backend/src/playground.ts Outdated Show resolved Hide resolved
packages/shared/StudioAPI.ts Outdated Show resolved Hide resolved
packages/frontend/src/stores/playground-queries.ts Outdated Show resolved Hide resolved
packages/shared/MessageProxy.ts Outdated Show resolved Hide resolved
packages/shared/MessageProxy.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@lstocchi lstocchi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Idk if it would be part of this PR or a separate one but the playground does not work for me. I don't have the local-ai image and i don't know what else i'm missing (still have to check the code) but as a user i clicked send request and nothing happens. If i look at the console i see
image

@feloy
Copy link
Contributor Author

feloy commented Jan 17, 2024

Idk if it would be part of this PR or a separate one but the playground does not work for me. I don't have the local-ai image and i don't know what else i'm missing (still have to check the code) but as a user i clicked send request and nothing happens. If i look at the console i see image

I think it is due to the fact that you don't have the local-ai image.
I have created this issue to follow the problem: #87

@feloy feloy force-pushed the feat/playground-state branch from 68e6237 to 4c6a7cb Compare January 17, 2024 15:45
Copy link
Contributor

@lstocchi lstocchi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After having downloaded local-ai, it works as expected. GJ 🚀

@feloy feloy force-pushed the feat/playground-state branch 6 times, most recently from e3cdf00 to 061e10f Compare January 17, 2024 17:19
@feloy feloy force-pushed the feat/playground-state branch from 061e10f to 80dac02 Compare January 17, 2024 17:25
@feloy feloy merged commit c63262c into main Jan 17, 2024
3 checks passed
@feloy feloy deleted the feat/playground-state branch February 16, 2024 12:49
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

Successfully merging this pull request may close these issues.

4 participants