Skip to content

Commit

Permalink
refactor: use enum auto
Browse files Browse the repository at this point in the history
  • Loading branch information
Undertone0809 committed Oct 8, 2024
1 parent 341c924 commit e1c179e
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 29 deletions.
8 changes: 4 additions & 4 deletions promptulate/agents/assistant_agent/agent.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from enum import Enum
from enum import Enum, auto
from typing import Callable, Dict, List, Optional, TypedDict

from typing_extensions import NotRequired
Expand All @@ -17,9 +17,9 @@


class StepTypes(str, Enum):
PLAN = "plan"
EXECUTE = "execute"
REVISE = "revise"
PLAN = auto()
EXECUTE = auto()
REVISE = auto()


class AdditionalProperties(TypedDict):
Expand Down
10 changes: 5 additions & 5 deletions promptulate/agents/assistant_agent/schema.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
from enum import Enum
from enum import Enum, auto
from typing import List, Optional

from promptulate.pydantic_v1 import BaseModel, Field


class TaskStatus(str, Enum):
TODO = "todo"
DONE = "done"
ERROR = "error"
DISCARDED = "discarded"
TODO = auto()
DONE = auto()
ERROR = auto()
DISCARDED = auto()


class Task(BaseModel):
Expand Down
8 changes: 4 additions & 4 deletions promptulate/beta/agents/assistant_agent/agent.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from enum import Enum
from enum import Enum, auto
from typing import Callable, Dict, List, Optional, TypedDict

from typing_extensions import NotRequired
Expand All @@ -17,9 +17,9 @@


class StepTypes(str, Enum):
PLAN = "plan"
EXECUTE = "execute"
REVISE = "revise"
PLAN = auto()
EXECUTE = auto()
REVISE = auto()


class AdditionalProperties(TypedDict):
Expand Down
10 changes: 5 additions & 5 deletions promptulate/beta/agents/assistant_agent/schema.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
from enum import Enum
from enum import Enum, auto
from typing import List, Optional

from promptulate.pydantic_v1 import BaseModel, Field


class TaskStatus(str, Enum):
TODO = "todo"
DONE = "done"
ERROR = "error"
DISCARDED = "discarded"
TODO = auto()
DONE = auto()
ERROR = auto()
DISCARDED = auto()


class Task(BaseModel):
Expand Down
12 changes: 6 additions & 6 deletions promptulate/schema.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import warnings
from abc import abstractmethod
from datetime import datetime
from enum import Enum
from enum import Enum, auto
from typing import Any, Callable, Dict, Iterator, List, Optional, Union

from promptulate.pydantic_v1 import BaseModel, Field
Expand Down Expand Up @@ -180,11 +180,11 @@ def type(self) -> str:
class LLMType(str, Enum):
"""All LLM type here"""

OpenAI = "OpenAI"
ChatOpenAI = "ChatOpenAI"
ErnieBot = "ErnieBot"
QianFan = "QianFan"
ZhiPu = "ZhiPu"
OpenAI = auto()
ChatOpenAI = auto()
ErnieBot = auto()
QianFan = auto()
ZhiPu = auto()


class MessageSet:
Expand Down
8 changes: 4 additions & 4 deletions promptulate/uacp/schema.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
from enum import Enum
from enum import Enum, auto
from typing import Any, Dict, List, Optional

from promptulate.pydantic_v1 import BaseModel, Field


class Status(Enum):
created = "created"
running = "running"
completed = "completed"
created = auto()
running = auto()
completed = auto()


class StepOutput(BaseModel):
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ name = "promptulate"
readme = "README.md"
homepage = "https://github.com/Undertone0809/promptulate"
repository = "https://github.com/Undertone0809/promptulate"
version = "1.18.3"
version = "1.18.4"
keywords = [
"promptulate",
"pne",
Expand Down

0 comments on commit e1c179e

Please sign in to comment.