Skip to content

Commit ffc2b31

Browse files
author
Daniel OBrien
committed
fix sort order, limit python version
1 parent 683bf89 commit ffc2b31

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

ldai/client.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
1-
from dataclasses import asdict, dataclass
2-
import json
1+
from dataclasses import dataclass
32
from typing import Any, Dict, List, Literal, Optional
43

54
import chevron
5+
from dataclasses_json import dataclass_json
66
from ldclient import Context
77
from ldclient.client import LDClient
88

99
from ldai.tracker import LDAIConfigTracker
1010

1111

12+
@dataclass_json
1213
@dataclass
1314
class LDMessage:
1415
role: Literal['system', 'user', 'assistant']
1516
content: str
1617

17-
def to_json(self):
18-
return json.dumps(asdict(self))
1918

2019
@dataclass
2120
class AIConfigData:

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,12 @@ exclude = [
2727
]
2828

2929
[tool.poetry.dependencies]
30-
python = ">=3.8"
30+
python = ">=3.8,<4"
3131
launchdarkly-server-sdk = ">=9.4.0"
3232
chevron = "=0.14.0"
3333
pycodestyle = "^2.12.1"
3434
isort = "^5.13.2"
35+
dataclasses-json = "^0.6.7"
3536

3637

3738
[tool.poetry.group.dev.dependencies]

0 commit comments

Comments
 (0)