Skip to content
This repository was archived by the owner on Aug 5, 2025. It is now read-only.

Commit 9305ff8

Browse files
Merge pull request #132 from Chainlit/cd/ENG-1982
fix prompt printing
2 parents 2a75ddf + a854002 commit 9305ff8

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

literalai/observability/generation.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,19 @@
1313

1414

1515
@unique
16-
class GenerationType(Enum):
16+
class GenerationType(str, Enum):
1717
CHAT = "CHAT"
1818
COMPLETION = "COMPLETION"
1919

20+
def __str__(self):
21+
return self.value
22+
23+
def __repr__(self):
24+
return f"GenerationType.{self.name}"
25+
26+
def to_json(self):
27+
return self.value
28+
2029

2130
class GenerationMessage(TypedDict, total=False):
2231
uuid: Optional[str]

literalai/prompt_engineering/prompt.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ class Prompt(Utils):
7979
variables_default_values: Optional[Dict[str, Any]]
8080

8181
def to_dict(self) -> PromptDict:
82-
# Convert the Prompt instance to a dictionary matching the PromptDict structure
8382
return {
8483
"id": self.id,
8584
"createdAt": self.created_at,

0 commit comments

Comments
 (0)