Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

自定义Agent问答调用知识库时返回'BaseResponse' object has no attribute 'body_iterator' #4024

Open
li775176364 opened this issue May 15, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@li775176364
Copy link

自定义Agent问答模式下,调用search_knowledgebase_complex搜索知识库,始终返回'BaseResponse' object has no attribute 'body_iterator'

工具名称: search_knowledgebase_complex
工具状态: 调用成功
工具输入: MacbookAir M1 8+256 颜色
工具输出:  输入的信息有误或不存在知识库,错误信息如下:
'BaseResponse' object has no attribute 'body_iterator'

我把包含上述信息的文档存为.txt,添加到了我新建的知识库test1中,直接使用知识库问答是可以查到信息的,但是在Agent下查不到任何信息

@li775176364 li775176364 added the bug Something isn't working label May 15, 2024
Copy link

dosubot bot commented May 15, 2024

The error you're encountering, "'BaseResponse' object has no attribute 'body_iterator'," suggests there's a mismatch between the expected interface of the response object and its actual implementation in your custom Agent's search_knowledgebase_complex function. This function is likely expecting a response object that supports asynchronous iteration, which isn't the case here.

To resolve this issue, you'll need to adjust the handling of the response object within your function to match its actual structure. If the function is designed to work with an asynchronous iterable, ensure that the returned response object from knowledge_base_chat or any related function indeed conforms to this expectation. This might involve modifying the search_knowledgebase_complex function to correctly process the response object based on its actual attributes and methods.

Ensure that all external dependencies and services the function relies on are correctly configured and operational. Also, verify that your execution environment supports asynchronous operations, as the function and its dependencies appear to be designed for asynchronous execution.

In summary, check the structure of the response object returned by the knowledge_base_chat function, adjust your function to correctly handle this object, ensure all external services are properly configured, and confirm that your environment supports asyncio.

Details

Sources


About Dosu
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.

To continue the conversation, mention @dosu.

@li775176364
Copy link
Author

问答对话是这样的
image

@ReverseSystem001
Copy link

问答对话是这样的 image
你那现在调用agent好使不,我这按照脚本里调用本地知识库直接回复:I need to use the search_knowledgebase_complex tool to search the knowledge base for information about bigdata and its employment情况.然后没下文了

@li775176364
Copy link
Author

问答对话是这样的 image
你那现在调用agent好使不,我这按照脚本里调用本地知识库直接回复:I need to use the search_knowledgebase_complex tool to search the knowledge base for information about bigdata and its employment情况.然后没下文了

没有,我到现在也没调通

@ReverseSystem001
Copy link

ReverseSystem001 commented May 23, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants