Skip to content

Commit 683bf89

Browse files
author
Daniel OBrien
committed
change to_json
1 parent 0f2a335 commit 683bf89

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ldai/client.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from dataclasses import asdict, dataclass
2+
import json
23
from typing import Any, Dict, List, Literal, Optional
34

45
import chevron
@@ -13,8 +14,8 @@ class LDMessage:
1314
role: Literal['system', 'user', 'assistant']
1415
content: str
1516

16-
def to_dict(self):
17-
return asdict(self)
17+
def to_json(self):
18+
return json.dumps(asdict(self))
1819

1920
@dataclass
2021
class AIConfigData:

0 commit comments

Comments
 (0)