langchain
023de9a7 - Add OpenAIEmbeddings special token params for tiktoken (#2682)

Commit
2 years ago
Add OpenAIEmbeddings special token params for tiktoken (#2682) #2681 Original type hints ```python allowed_special: Union[Literal["all"], AbstractSet[str]] = set(), # noqa: B006 disallowed_special: Union[Literal["all"], Collection[str]] = "all", ``` from https://github.com/openai/tiktoken/blob/46287bfa493f8ccca4d927386d7ea9cc20487525/tiktoken/core.py#L79-L80 are not compatible with pydantic <img width="718" alt="image" src="https://user-images.githubusercontent.com/5096640/230993236-c744940e-85fb-4baa-b9da-8b00fb60a2a8.png"> I think we could use ```python allowed_special: Union[Literal["all"], Set[str]] = set() disallowed_special: Union[Literal["all"], Set[str], Tuple[()]] = "all" ``` Please let me know if you would like to implement it differently.
Author
Parents
Loading