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

View File

@@ -667,7 +667,7 @@ files = [
[[package]]
name = "langchain-core"
version = "0.3.0.dev4"
version = "0.3.0.dev5"
description = "Building applications with LLMs through composability"
optional = false
python-versions = ">=3.9,<4.0"
@@ -676,7 +676,7 @@ develop = true
[package.dependencies]
jsonpatch = "^1.33"
langsmith = "^0.1.112"
langsmith = "^0.1.117"
packaging = ">=23.2,<25"
pydantic = "^2.7.4"
PyYAML = ">=5.3"
@@ -1695,4 +1695,4 @@ multidict = ">=4.0"
[metadata]
lock-version = "2.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]
name = "langchain-fireworks"
version = "0.2.0.dev1"
version = "0.2.0.dev2"
description = "An integration package connecting Fireworks and LangChain"
authors = []
readme = "README.md"
@@ -20,7 +20,7 @@ disallow_untyped_defs = "True"
[tool.poetry.dependencies]
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"
openai = "^1.10.0"
requests = "^2"