Closed amindadgar closed 6 months ago
🤖
Hello @amindadgar! :wave:
Just wanted to say hello and introduce myself. I'm Dosu, a friendly bot here to help with bugs and questions about LlamaIndex, or even help you become a contributor, all while we wait for a human maintainer to join us. Don't hesitate to ask if you need anything!
Oh, and I may throw in a few jokes here and there, just to keep things lively! :robot: :tada:
Based on the error logs you've provided and the context from a similar issue in the LlamaIndex repository, it seems like the problem is due to a version mismatch between the openai
package and the guidance
package. The guidance==0.1.10
package might be expecting a different version of the openai
package where the api_base
attribute is available.
In the provided context, the resolve_openai_credentials
function tries to access openai.base_url
:
final_api_base = api_base or openai.base_url or DEFAULT_OPENAI_API_BASE
However, in the version of the openai
package that you're using, there might not be a base_url
attribute, hence the AttributeError
.
To resolve this issue, you should check the required openai
package version for guidance==0.1.10
and install that specific version. If the required version is not specified, you could try updating the openai
package to the latest version using pip:
pip install --upgrade openai
If the problem persists, it might be a compatibility issue between the guidance
package and the openai
package.
As for the LlamaIndex version, a similar issue was reported in the LlamaIndex repository: [Bug]: Guidance for Sub-Question Query Engine. The suggested solution was to use llama-index==0.8.62
or less if you want to use guidance.
Please try these solutions and let me know if the issue persists.
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.
Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.
If you want to continue the conversation, start your reply with @dosu-bot.
Thanks llama-index community for implementing the bot (It's very cool). In this situation I investigated the guidance and llama-index package more and I concluded the following
guidance==0.0.64
) is fully compatible with the openai<1.0.0
version.guidance==0.1.10
is compatible with openai>=1.0
which is similar to the case of llama-index.The best way to add support for the new version of guidance is to update the codes of llama-index library (the parts using guidance) to the newer version guidance==0.1.10
. Is that going to be possible for the community of devs working on this library?
@logan-markewich, this issue requires your expertise in navigating the compatibility between llama-index and the newer version of the guidance package.
@amindadgar yea we can probably update it at some point this week. Happy to let you do it as well if you have more time :)
@logan-markewich Sure, I'll start doing it the next day! If there's a standard to follow, please don't hesitate to let me know :)
Hi, @amindadgar,
I'm helping the LlamaIndex team manage their backlog and am marking this issue as stale. The issue involved the guidance
package version 0.9.24
being incompatible with the GuidanceOpenAI
module, resulting in an AttributeError when querying the engine. It was found that the older guidance
package (guidance==0.0.64
) is fully compatible with openai<1.0.0
, while the newer version (guidance==0.1.10
) is compatible with openai>=1.0
. The proposed solution was to update the parts of the llama-index
library using guidance
to the newer version guidance==0.1.10
. The issue has been resolved by updating the library to support the new version of guidance
, and the community has agreed to this update.
Is this issue still relevant to the latest version of the LlamaIndex repository? If it is, please let the LlamaIndex team know by commenting on the issue. Otherwise, feel free to close the issue yourself, or it will be automatically closed in 7 days.
For further details, refer to the issue on GitHub: Issue Link
Thank you!
Bug Description
When trying the
GuidanceQuestionGenerator
withGuidanceOpenAI
I see it cannot run with theguidance==0.1.10
package. Looking at their repository it seems they have huge changes from version0.0.64
. Downgrading the package toguidance==0.0.64
, when trying the example in the documentation (with some other data I own) https://docs.llamaindex.ai/en/stable/examples/output_parsing/guidance_sub_question.html#construct-sub-question-query-engine-and-run-some-queriesWhen trying to query the engine
I'm getting the error below
Version
0.9.24
Steps to Reproduce
query_engine
using the data I haveToolMetadata
(a list)QueryEngineTool
(a list)GuidanceQuestionGenerator
usingGuidanceOpenAI
as guidance_llmSubQuestionQueryEngine
from the query engine tool made in step 3 and question generator made in step 4QueryBundle
using the embedding model I havesome pseudo-codes
Relevant Logs/Tracbacks