-
Notifications
You must be signed in to change notification settings - Fork 16.3k
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
PaiEasChatEndpoint._call_eas
should return bytes
type instead of str
type
#20453
Closed
5 tasks done
Labels
🤖:bug
Related to a bug, vulnerability, unexpected error with an existing feature
Comments
garylin2099
added a commit
to garylin2099/langchain
that referenced
this issue
May 10, 2024
garylin2099
added a commit
to garylin2099/langchain
that referenced
this issue
May 10, 2024
This was referenced May 10, 2024
Justin-ZL
added a commit
to Justin-ZL/langchain
that referenced
this issue
Jul 9, 2024
seeker-jie
pushed a commit
to seeker-jie/langchain
that referenced
this issue
Jul 11, 2024
yulin-jin
pushed a commit
to yulin-jin/langchain
that referenced
this issue
Aug 20, 2024
xiaoxiaoimg
pushed a commit
to xiaoxiaoimg/langchain
that referenced
this issue
Aug 20, 2024
xiaoxiaoimg
pushed a commit
to xiaoxiaoimg/langchain
that referenced
this issue
Aug 21, 2024
xiaoxiaoimg
pushed a commit
to xiaoxiaoimg/langchain
that referenced
this issue
Aug 21, 2024
xiaoxiaoimg
pushed a commit
to xiaoxiaoimg/langchain
that referenced
this issue
Aug 22, 2024
xiaoxiaoimg
pushed a commit
to xiaoxiaoimg/langchain
that referenced
this issue
Aug 22, 2024
xiaoxiaoimg
pushed a commit
to xiaoxiaoimg/langchain
that referenced
this issue
Aug 22, 2024
xiaoxiaoimg
pushed a commit
to xiaoxiaoimg/langchain
that referenced
this issue
Sep 12, 2024
xiaoxiaoimg
pushed a commit
to xiaoxiaoimg/langchain
that referenced
this issue
Sep 23, 2024
xiaoxiaoimg
pushed a commit
to xiaoxiaoimg/langchain
that referenced
this issue
Sep 24, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Checked other resources
Example Code
It is just example code that has a potential error, so I'll explain why it's a possible type error in the description.
Error Message and Stack Trace (if applicable)
No response
Description
langchain/libs/community/langchain_community/chat_models/pai_eas_endpoint.py
Lines 193 to 230 in b66a4f4
In the method
PaiEasChatEndpoint._call
at line 203,self._call_eas(request_payload)
returnsstr
type because it returns response.text at line 230 (https://requests.readthedocs.io/en/latest/api/#requests.Response.text).Then, first argument of
_format_response_payload
can bestr
type at line 204, resulting in type mismatch.langchain/libs/community/langchain_community/chat_models/pai_eas_endpoint.py
Lines 167 to 179 in b66a4f4
Moreover, if
JSONDecodeError
occurs in this method, then attribute error occurs at line 178 (AttributeError: 'str' object has no attribute 'decode'
) becauseoutput
variable is str type.I think
PaiEasChatEndpoint._call_eas
should be fixed to return bytes type.If I'm mistaken, I'd appreciate it if you could let me know.
System Info
System Information
Package Information
Packages not installed (Not Necessarily a Problem)
The following packages were not found:
The text was updated successfully, but these errors were encountered: