mirror of
https://github.com/run-llama/llama_deploy.git
synced 2026-07-25 08:05:25 -04:00
Whether Llama Deploy has a JavaScript SDK for interacting with deployed systems ? #146
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ifreeman6 on GitHub (Nov 25, 2024).
I have the following need:
I want to interact with the deployed services from the
Reactfrontend. However, I found that currently only thePython SDKsupports client interaction, and on the JavaScript side, I can only use thefetchmethod. Will there be aJavaScript SDKprovided in the future to facilitate frontend interactions?Thanks very much.
@logan-markewich commented on GitHub (Nov 25, 2024):
Currently there is no javascript/typescript SDK. However, that doesn't stop you from using llama-deploy! Feel free to use the api itself exposed by the api server
You can see the swagger docs embedded in the docs page (or you can visit the URL of the apiserver with the
/docsendpoint)https://docs.llamaindex.ai/en/stable/module_guides/llama_deploy/20_core_components/#api-server
@logan-markewich commented on GitHub (Nov 25, 2024):
Maintaining a javascript implementation is a bit out of scope for us currently, but it could happen in the future. I definitely welcome any help on this aspect!
@ifreeman6 commented on GitHub (Nov 25, 2024):
Hi, logan.
I try to different methods, but I still don't know how to show the intermediate stream events progression in my React Frontend, for example:
I don't know how to get the ctx stream events from the API end. Could you please provide guidance on how to properly set up and handle streaming events from the API endpoint?
Thanks very much!
@ifreeman6 commented on GitHub (Nov 25, 2024):
I can print the progression and result conviently by python SDK as follows, but I don't know how to fulfill the same task using Javascript.
@logan-markewich commented on GitHub (Nov 25, 2024):
The streaming api is here: https://github.com/run-llama/llama_deploy/blob/8c3476e0ad5008d1c0e42b67ab2d5cbd61134681/llama_deploy/client/models/apiserver.py#L84
Should be straightfoward to translate that to javascript (or easy to ask claude to do it 😁 )
@ifreeman6 commented on GitHub (Nov 25, 2024):
Thanks for your timely response.
I have another issue:
I don't know how to get the
task_id (self.id)andsession_idtimely in the front-end when I send the POST request.Thanks very much
@ifreeman6 commented on GitHub (Nov 26, 2024):
I have solved my issue. Thanks very much.
@lsg551 commented on GitHub (Jun 8, 2025):
Even though this is long closed and your problem likely resolved, I just want to document this for future readers who stumble across this issue:
LlamaDeploy relies on FastAPI, which integrates Swagger/OpenAPI. For example, it automatically generates API docs and exposes them at
http://127.0.0.1:4501/docs, including then formal specificationhttp://127.0.0.1:4501/openapi.json. This specification can be used to generate client libraries for various languages, including JavaScript and TypeScript. The go to tool isswagger-typescript-api.Here is a minimal example:
This will create a single file in
./src/lib/llama_deploy_clientcalledclient.tsthat contains the client library for the LlamaDeploy API. It can be imported and used in the frontend application. In theory, it should work out of the box. However, I have not tested it extensively so far.