llama_index icon indicating copy to clipboard operation
llama_index copied to clipboard

stream is only supported for OpenAI LLMs

Open mingxin-yang opened this issue 1 year ago • 2 comments

from langchain.chat_models import ChatOpenAI

llm_predictor = LLMPredictor(llm=ChatOpenAI(temperature=0, model_name="gpt-3.5-turbo"))
index = GPTSimpleVectorIndex.load_from_disk(file_path, llm_predictor=llm_predictor)
response = index.query(query_str, response_mode="compact", streaming=True)

chatopenAI can't use stream, how to supported it?

mingxin-yang avatar Mar 22 '23 03:03 mingxin-yang

I think OpenAI needs to enable streaming in their API for chatGPT, but they haven't yet

logan-markewich avatar Mar 22 '23 18:03 logan-markewich

I think OpenAI needs to enable streaming in their API for chatGPT, but they haven't yet

@logan-markewich OpenAI's API is support with stream, I used it in node

mingxin-yang avatar Mar 24 '23 02:03 mingxin-yang

nobody face this problem?

mingxin-yang avatar Mar 27 '23 10:03 mingxin-yang

@Disiok @jerryjliu

mingxin-yang avatar Mar 27 '23 10:03 mingxin-yang

same problem +1

neove avatar Mar 27 '23 14:03 neove

https://github.com/jerryjliu/llama_index/blob/main/examples/vector_indices/SimpleIndexDemo-ChatGPT.ipynb https://github.com/jerryjliu/llama_index/blob/main/examples/vector_indices/SimpleIndexDemo-streaming.ipynb Hope to use the both example. @jerryjliu 🧐

mingxin-yang avatar Mar 29 '23 07:03 mingxin-yang

Same question

xumo97 avatar Mar 30 '23 11:03 xumo97

Same question

holmesian avatar Mar 31 '23 15:03 holmesian

@mingxin-yang @xumo97 Take this repo as reference https://github.com/hlwhl/knowledge_base_server. It's achieved stream response based on callback manager.

hlwhl avatar Apr 06 '23 06:04 hlwhl

Closing this ticket to tracker under https://github.com/jerryjliu/llama_index/issues/1007

Disiok avatar Apr 08 '23 20:04 Disiok