microsoft / graphrag

A modular graph-based Retrieval-Augmented Generation (RAG) system
https://microsoft.github.io/graphrag/
MIT License
19.33k stars 1.91k forks source link

Bug : error code : 403 {detial : stream object no attribute usage} #1301

Open mustangs0786 opened 1 month ago

mustangs0786 commented 1 month ago

Do you need to file an issue?

Describe the issue

Hi i after creating parquet file , when I am hitting the query

I am getting error back

raise self._make_sttus_error_fromresponse(err.response) from None openai.Permissiondeniederror: error code : 403 {detial : stream object no attribute usage}

as per I understood, my gpt instance does not support streaming of the response, hence this error I am seeing. to solve this is there any setting in graph rag, so it will expect complete response in the end rather then waiting for streaming answer. thanks

Steps to reproduce

No response

GraphRAG Config Used

# Paste your config here

Logs and screenshots

No response

Additional Information

mustangs0786 commented 1 month ago

Hi Team after digging for some time i found this section of code under file

Path: "graphrag/query/structured_search/local_search/search.py"

response = await self.llm.generate( messages=search_messages, streaming=True, callbacks=self.callbacks, **self.llm_params, )

By making streaming = False, issue got resolve,

same goes for global search file

I request ream to bring this variable as user input, by keeping it in settings.yaml file

thanks