mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-10 05:20:39 +00:00
community: fix lint (#23611)
This commit is contained in:
parent
ef0593db58
commit
adf2dc13de
@ -213,7 +213,7 @@ class ChatMaritalk(BaseChatModel):
|
|||||||
if response.status_code == 200:
|
if response.status_code == 200:
|
||||||
return response.json().get("answer", "No answer found")
|
return response.json().get("answer", "No answer found")
|
||||||
else:
|
else:
|
||||||
raise MaritalkHTTPError(response)
|
raise MaritalkHTTPError(response) # type: ignore[arg-type]
|
||||||
|
|
||||||
except ImportError:
|
except ImportError:
|
||||||
raise ImportError(
|
raise ImportError(
|
||||||
@ -301,7 +301,7 @@ class ChatMaritalk(BaseChatModel):
|
|||||||
async with client.stream(
|
async with client.stream(
|
||||||
"POST",
|
"POST",
|
||||||
"https://chat.maritaca.ai/api/chat/inference",
|
"https://chat.maritaca.ai/api/chat/inference",
|
||||||
data=json.dumps(data),
|
data=json.dumps(data), # type: ignore[arg-type]
|
||||||
headers=headers,
|
headers=headers,
|
||||||
timeout=None,
|
timeout=None,
|
||||||
) as response:
|
) as response:
|
||||||
@ -323,7 +323,7 @@ class ChatMaritalk(BaseChatModel):
|
|||||||
yield chunk
|
yield chunk
|
||||||
|
|
||||||
else:
|
else:
|
||||||
raise MaritalkHTTPError(response)
|
raise MaritalkHTTPError(response) # type: ignore[arg-type]
|
||||||
|
|
||||||
except ImportError:
|
except ImportError:
|
||||||
raise ImportError(
|
raise ImportError(
|
||||||
|
@ -447,7 +447,7 @@ class ChatZhipuAI(BaseChatModel):
|
|||||||
import httpx
|
import httpx
|
||||||
|
|
||||||
with httpx.Client(headers=headers, timeout=60) as client:
|
with httpx.Client(headers=headers, timeout=60) as client:
|
||||||
response = client.post(self.zhipuai_api_base, json=payload)
|
response = client.post(self.zhipuai_api_base, json=payload) # type: ignore[arg-type]
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
return self._create_chat_result(response.json())
|
return self._create_chat_result(response.json())
|
||||||
|
|
||||||
@ -534,7 +534,7 @@ class ChatZhipuAI(BaseChatModel):
|
|||||||
import httpx
|
import httpx
|
||||||
|
|
||||||
async with httpx.AsyncClient(headers=headers, timeout=60) as client:
|
async with httpx.AsyncClient(headers=headers, timeout=60) as client:
|
||||||
response = await client.post(self.zhipuai_api_base, json=payload)
|
response = await client.post(self.zhipuai_api_base, json=payload) # type: ignore[arg-type]
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
return self._create_chat_result(response.json())
|
return self._create_chat_result(response.json())
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user