core[minor], langchain[patch], experimental[patch]: Added missing py.typed to langchain_core (#14143)

See PR title.

From what I can see, `poetry` will auto-include this. Please let me know
if I am missing something here.

---------

Co-authored-by: Bagatur <baskaryan@gmail.com>
This commit is contained in:
James Braza
2023-12-01 22:15:23 -05:00
committed by GitHub
parent f7c257553d
commit 24385a00de
9 changed files with 40 additions and 30 deletions

View File

@@ -1,7 +1,7 @@
import json
from collections import defaultdict
from html.parser import HTMLParser
from typing import Any, DefaultDict, Dict, List, Optional
from typing import Any, DefaultDict, Dict, List, Optional, cast
from langchain.callbacks.manager import (
CallbackManagerForLLMRun,
@@ -176,7 +176,7 @@ class AnthropicFunctions(BaseChatModel):
response = self.model.predict_messages(
messages, stop=stop, callbacks=run_manager, **kwargs
)
completion = response.content
completion = cast(str, response.content)
if forced:
tag_parser = TagParser()
@@ -210,7 +210,7 @@ class AnthropicFunctions(BaseChatModel):
message = AIMessage(content=msg, additional_kwargs=kwargs)
return ChatResult(generations=[ChatGeneration(message=message)])
else:
response.content = response.content.strip()
response.content = cast(str, response.content).strip()
return ChatResult(generations=[ChatGeneration(message=response)])
@property