You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
langchain/libs/experimental/langchain_experimental/tot/thought.py

22 lines
398 B
Python

from __future__ import annotations
from enum import Enum
from typing import Set
from pydantic import BaseModel, Field
class ThoughtValidity(Enum):
VALID_INTERMEDIATE = 0
VALID_FINAL = 1
INVALID = 2
class Thought(BaseModel):
text: str
validity: ThoughtValidity
children: Set[Thought] = Field(default_factory=set)
def __hash__(self) -> int:
return id(self)