fireworks[patch]: fix warnings (#26385)

This commit is contained in:
ccurme
2024-09-12 10:03:24 -04:00
committed by GitHub
parent d82eec6aad
commit 6b24eeb884
3 changed files with 8 additions and 8 deletions

View File

@@ -464,7 +464,7 @@ class ChatFireworks(BaseChatModel):
default_chunk_class: Type[BaseMessageChunk] = AIMessageChunk default_chunk_class: Type[BaseMessageChunk] = AIMessageChunk
for chunk in self.client.create(messages=message_dicts, **params): for chunk in self.client.create(messages=message_dicts, **params):
if not isinstance(chunk, dict): if not isinstance(chunk, dict):
chunk = chunk.dict() chunk = chunk.model_dump()
if len(chunk["choices"]) == 0: if len(chunk["choices"]) == 0:
continue continue
choice = chunk["choices"][0] choice = chunk["choices"][0]
@@ -520,7 +520,7 @@ class ChatFireworks(BaseChatModel):
def _create_chat_result(self, response: Union[dict, BaseModel]) -> ChatResult: def _create_chat_result(self, response: Union[dict, BaseModel]) -> ChatResult:
generations = [] generations = []
if not isinstance(response, dict): if not isinstance(response, dict):
response = response.dict() response = response.model_dump()
token_usage = response.get("usage", {}) token_usage = response.get("usage", {})
for res in response["choices"]: for res in response["choices"]:
message = _convert_dict_to_message(res["message"]) message = _convert_dict_to_message(res["message"])
@@ -558,7 +558,7 @@ class ChatFireworks(BaseChatModel):
default_chunk_class: Type[BaseMessageChunk] = AIMessageChunk default_chunk_class: Type[BaseMessageChunk] = AIMessageChunk
async for chunk in self.async_client.acreate(messages=message_dicts, **params): async for chunk in self.async_client.acreate(messages=message_dicts, **params):
if not isinstance(chunk, dict): if not isinstance(chunk, dict):
chunk = chunk.dict() chunk = chunk.model_dump()
if len(chunk["choices"]) == 0: if len(chunk["choices"]) == 0:
continue continue
choice = chunk["choices"][0] choice = chunk["choices"][0]

View File

@@ -667,7 +667,7 @@ files = [
[[package]] [[package]]
name = "langchain-core" name = "langchain-core"
version = "0.3.0.dev4" version = "0.3.0.dev5"
description = "Building applications with LLMs through composability" description = "Building applications with LLMs through composability"
optional = false optional = false
python-versions = ">=3.9,<4.0" python-versions = ">=3.9,<4.0"
@@ -676,7 +676,7 @@ develop = true
[package.dependencies] [package.dependencies]
jsonpatch = "^1.33" jsonpatch = "^1.33"
langsmith = "^0.1.112" langsmith = "^0.1.117"
packaging = ">=23.2,<25" packaging = ">=23.2,<25"
pydantic = "^2.7.4" pydantic = "^2.7.4"
PyYAML = ">=5.3" PyYAML = ">=5.3"
@@ -1695,4 +1695,4 @@ multidict = ">=4.0"
[metadata] [metadata]
lock-version = "2.0" lock-version = "2.0"
python-versions = ">=3.9,<4.0" python-versions = ">=3.9,<4.0"
content-hash = "2a324e4a90491192ea7b6b846a799acbcbcf7c8ea8fa00e0534e00d447d3ecbc" content-hash = "9fd45aa6c8db9fc54fc39ac68a97c3c71d8903bb19a2fa706564569b2d1c76f6"

View File

@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
[tool.poetry] [tool.poetry]
name = "langchain-fireworks" name = "langchain-fireworks"
version = "0.2.0.dev1" version = "0.2.0.dev2"
description = "An integration package connecting Fireworks and LangChain" description = "An integration package connecting Fireworks and LangChain"
authors = [] authors = []
readme = "README.md" readme = "README.md"
@@ -20,7 +20,7 @@ disallow_untyped_defs = "True"
[tool.poetry.dependencies] [tool.poetry.dependencies]
python = ">=3.9,<4.0" python = ">=3.9,<4.0"
langchain-core = { version = "^0.3.0.dev1", allow-prereleases = true } langchain-core = { version = "^0.3.0.dev5", allow-prereleases = true }
fireworks-ai = ">=0.13.0" fireworks-ai = ">=0.13.0"
openai = "^1.10.0" openai = "^1.10.0"
requests = "^2" requests = "^2"