Skip to content

Commit 64d0381

Browse files
committed
support langchian v1
1 parent d0345e2 commit 64d0381

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

cozeloop/integration/langchain/trace_callback.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99

1010
import pydantic
1111
from pydantic import Field, BaseModel
12-
from langchain.callbacks.base import BaseCallbackHandler
13-
from langchain.schema import AgentFinish, AgentAction, LLMResult
12+
from langchain_core.callbacks.base import BaseCallbackHandler
13+
from langchain_core.outputs import LLMResult
14+
from langchain_core.agents import AgentFinish, AgentAction
1415
from langchain_core.prompt_values import PromptValue, ChatPromptValue
1516
from langchain_core.messages import BaseMessage, AIMessageChunk
1617
from langchain_core.prompts import AIMessagePromptTemplate, HumanMessagePromptTemplate, SystemMessagePromptTemplate

cozeloop/integration/langchain/util.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33

44
import tiktoken
55
from typing import List, Dict, Union, Any, Optional
6-
from langchain.schema import LLMResult
7-
from langchain_core.outputs import Generation, ChatGeneration
6+
from langchain_core.outputs import LLMResult, Generation, ChatGeneration
87

98

109
def calc_token_usage(inputs: Union[List[Dict], LLMResult], model: str = 'gpt-3.5-turbo-0613'):

0 commit comments

Comments
 (0)