Skip to content

Commit

Permalink
Merge pull request #136 from langchain-ai/nc/format
Browse files Browse the repository at this point in the history
Format
  • Loading branch information
nfcampos authored Jan 26, 2024
2 parents ace77a9 + fff4982 commit 7dd02a6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion backend/app/storage.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import os
from datetime import datetime
from typing import List, Sequence
from app.stream import map_chunk_to_msg

import orjson
from langchain.schema.messages import AnyMessage
Expand All @@ -12,6 +11,7 @@

from app.agent import AgentType, get_agent_executor
from app.schema import Assistant, AssistantWithoutUserId, Thread, ThreadWithoutUserId
from app.stream import map_chunk_to_msg


def assistants_list_key(user_id: str) -> str:
Expand Down
4 changes: 2 additions & 2 deletions backend/app/stream.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
from typing import AsyncIterator, Optional, Sequence, Union

import orjson
from langchain_core.messages import (
AIMessage,
AIMessageChunk,
AnyMessage,
BaseMessage,
BaseMessageChunk,
ChatMessage,
Expand All @@ -11,11 +13,9 @@
FunctionMessageChunk,
HumanMessage,
HumanMessageChunk,
AnyMessage,
)
from langchain_core.runnables import Runnable, RunnableConfig
from langserve.serialization import WellKnownLCSerializer
import orjson

MessagesStream = AsyncIterator[Union[list[AnyMessage], str]]

Expand Down

0 comments on commit 7dd02a6

Please sign in to comment.