Replies: 2 comments
-
@Joannzhou Hello there! I'm a bot here to help you with bugs, questions, and becoming a contributor. Let's tackle this issue together! To resolve the Here is a snippet of the relevant code for context: @contextmanager
def connect_sse(client: Any, method: str, url: str, **kwargs: Any) -> Iterator:
"""Context manager for connecting to an SSE stream.
Args:
client: The HTTP client.
method: The HTTP method.
url: The URL.
**kwargs: Additional keyword arguments.
Yields:
The event source.
"""
from httpx_sse import EventSource
with client.stream(method, url, **kwargs) as response:
yield EventSource(response) Ensure that the Here is a potential fix to ensure the response is valid: @contextmanager
def connect_sse(client: Any, method: str, url: str, **kwargs: Any) -> Iterator:
"""Context manager for connecting to an SSE stream.
Args:
client: The HTTP client.
method: The HTTP method.
url: The URL.
**kwargs: Additional keyword arguments.
Yields:
The event source.
"""
from httpx_sse import EventSource
with client.stream(method, url, **kwargs) as response:
if response is None:
raise ValueError("Failed to get a valid response from the server.")
yield EventSource(response) This will ensure that if the response is |
Beta Was this translation helpful? Give feedback.
-
resolved! update langchain version to support glm4 |
Beta Was this translation helpful? Give feedback.
-
Checked other resources
Commit to Help
Example Code
Description
In the above code, if ChatZhipuAI is used instead, an error will be reported: 'NoneType' object has no attribute 'events'
System Info
Mac Python 3.11.3
langchain==0.1.1
langchain-community==0.0.13
langchain-core==0.1.23
langchain-experimental==0.0.49
langchain-openai==0.0.3
langchain-text-splitters==0.2.1
Beta Was this translation helpful? Give feedback.
All reactions