Replies: 1 comment 2 replies
-
Hey @GSequist, great to see you diving into another challenge! Hope this one's a fun puzzle too. 🛠️ Based on the code you've provided, it seems like you're trying to stream the response from the The One possible solution could be to refactor your code to use an asynchronous generator with FastAPI's from fastapi import FastAPI, StreamingResponse
import asyncio
app = FastAPI()
async def stream_results():
for i in range(10):
yield f"data: {i}\n\n"
await asyncio.sleep(1)
@app.get("/stream")
async def get_stream():
return StreamingResponse(stream_results()) In this example, However, this approach might not be directly applicable to your use case, as it depends on how the Regarding the similar issues you found in the LangChain repository, they seem to be related but not identical to your problem. The discussions in these issues are about streaming responses from FastAPI endpoints, but they don't seem to involve the I hope this helps! If you have further questions or if something is not clear, please let me know. Sources
|
Beta Was this translation helpful? Give feedback.
-
Checked other resources
Commit to Help
Example Code
Description
I am having issue as the response is not streamed chunk by chunk
System Info
pip freeze
aiohttp==3.9.1
aiosignal==1.3.1
annotated-types==0.6.0
anyio==4.2.0
attrs==23.2.0
backoff==2.2.1
beautifulsoup4==4.12.2
certifi==2023.11.17
cffi==1.16.0
chardet==5.2.0
charset-normalizer==3.3.2
click==8.1.7
curl-cffi==0.5.10
dataclasses-json==0.6.3
distro==1.9.0
duckduckgo_search==4.2
emoji==2.9.0
et-xmlfile==1.1.0
faiss-cpu==1.7.4
fastapi==0.109.0
filetype==1.2.0
frozenlist==1.4.1
gunicorn==21.2.0
h11==0.14.0
httpcore==1.0.2
httpx==0.26.0
idna==3.6
Jinja2==3.1.3
joblib==1.3.2
jsonpatch==1.33
jsonpath-python==1.0.6
jsonpointer==2.4
langchain==0.1.0
langchain-community==0.0.12
langchain-core==0.1.16
langchain-openai==0.0.5
langdetect==1.0.9
langgraph==0.0.24
langsmith==0.0.83
lxml==5.1.0
MarkupSafe==2.1.3
marshmallow==3.20.2
multidict==6.0.4
mypy-extensions==1.0.0
networkx==3.2.1
nltk==3.8.1
numpy==1.26.3
openai==1.10.0
openpyxl==3.1.2
packaging==23.2
pandas==2.1.4
pillow==10.2.0
pycparser==2.21
pydantic==2.5.3
pydantic_core==2.14.6
pypdf==3.17.4
python-dateutil==2.8.2
python-docx==1.1.0
python-dotenv==1.0.0
python-iso639==2024.1.2
python-magic==0.4.27
python-multipart==0.0.6
python-pptx==0.6.23
pytz==2023.3.post1
PyYAML==6.0.1
rapidfuzz==3.6.1
regex==2023.12.25
requests==2.31.0
six==1.16.0
sniffio==1.3.0
soupsieve==2.5
SQLAlchemy==2.0.25
starlette==0.35.1
tabulate==0.9.0
tenacity==8.2.3
termcolor==2.4.0
tiktoken==0.5.2
tqdm==4.66.1
typing-inspect==0.9.0
typing_extensions==4.9.0
tzdata==2023.4
unstructured==0.12.0
unstructured-client==0.15.2
urllib3==2.1.0
uvicorn==0.25.0
websockets==12.0
wrapt==1.16.0
XlsxWriter==3.1.9
yarl==1.9.4
Beta Was this translation helpful? Give feedback.
All reactions