Skip to content

Commit d957336

Browse files
committed
fix annotation.
1 parent 127034d commit d957336

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/ai-providers/server-ai-langchain/src/ldai_langchain/langchain_provider.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ async def invoke_model(self, messages: List[LDMessage]) -> ChatResponse:
5353
langchain_messages = LangChainProvider.convert_messages_to_langchain(messages)
5454

5555
# Get the LangChain response
56-
response: AIMessage = await self._llm.ainvoke(langchain_messages)
56+
response: BaseMessage = await self._llm.ainvoke(langchain_messages)
5757

5858
# Generate metrics early (assumes success by default)
5959
metrics = LangChainProvider.get_ai_metrics_from_response(response)
@@ -174,7 +174,7 @@ def map_provider(ld_provider_name: str) -> str:
174174
return mapping.get(lowercased_name, lowercased_name)
175175

176176
@staticmethod
177-
def get_ai_metrics_from_response(response: AIMessage) -> LDAIMetrics:
177+
def get_ai_metrics_from_response(response: BaseMessage) -> LDAIMetrics:
178178
"""
179179
Get AI metrics from a LangChain provider response.
180180
@@ -206,7 +206,7 @@ def get_ai_metrics_from_response(response: AIMessage) -> LDAIMetrics:
206206
return LDAIMetrics(success=True, usage=usage)
207207

208208
@staticmethod
209-
def create_ai_metrics(langchain_response: AIMessage) -> LDAIMetrics:
209+
def create_ai_metrics(langchain_response: BaseMessage) -> LDAIMetrics:
210210
"""
211211
Create AI metrics information from a LangChain provider response.
212212

0 commit comments

Comments
 (0)