Skip to content

Commit 2006aae

Browse files
authored
Merge pull request #196 from vintasoftware/feat/update-dependencies
Update dependencies
2 parents 5b26c73 + be763a5 commit 2006aae

15 files changed

Lines changed: 6003 additions & 4773 deletions

File tree

.python-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.12.4
1+
3.12.9

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Install the Python dependencies:
3636
poetry install
3737
```
3838

39-
If you encounter an error regarding the Python version required for the project, you can use pyenv to install the appropriate version based on [.python-version](.python-version):
39+
If you encounter an error regarding the Python version required for the project, you can use pyenv to install the appropriate version based on [.python-version](https://github.com/vintasoftware/django-ai-assistant/blob/main/.python-version):
4040

4141
```bash
4242
pyenv install

example/assets/js/components/Chat/Chat.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,9 @@ export function Chat({ assistantId }: { assistantId: string }) {
120120
const [activeThread, setActiveThread] = useState<Thread | null>(null);
121121
const [inputValue, setInputValue] = useState<string>("");
122122

123-
const { fetchThreads, threads, createThread, deleteThread } = useThreadList({ assistantId });
123+
const { fetchThreads, threads, createThread, deleteThread } = useThreadList({
124+
assistantId,
125+
});
124126
const {
125127
fetchMessages,
126128
messages,
@@ -129,7 +131,7 @@ export function Chat({ assistantId }: { assistantId: string }) {
129131
loadingCreateMessage,
130132
deleteMessage,
131133
loadingDeleteMessage,
132-
} = useMessageList({ threadId: activeThread?.id });
134+
} = useMessageList({ threadId: activeThread?.id?.toString() ?? null });
133135

134136
const { fetchAssistant, assistant } = useAssistant({ assistantId });
135137

@@ -160,8 +162,8 @@ export function Chat({ assistantId }: { assistantId: string }) {
160162
try {
161163
await fetchAssistant();
162164
await fetchThreads();
163-
} catch (error: ApiError) {
164-
if (error.status === 401) {
165+
} catch (error) {
166+
if (error instanceof ApiError && error.status === 401) {
165167
setShowLoginNotification(true);
166168
}
167169
}

example/assets/js/components/ThreadsNav/ThreadsNav.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export function ThreadsNav({
2727
}) {
2828
const ThreadNavLink = ({ thread }: { thread: Thread }) => {
2929
const { hovered, ref } = useHover();
30+
const threadId = thread.id?.toString();
3031

3132
return (
3233
<div ref={ref} key={thread.id}>
@@ -37,7 +38,7 @@ export function ThreadsNav({
3738
event.preventDefault();
3839
}}
3940
label={thread.name}
40-
active={selectedThreadId === thread.id}
41+
active={selectedThreadId === threadId}
4142
variant="filled"
4243
rightSection={
4344
hovered ? (
@@ -47,7 +48,8 @@ export function ThreadsNav({
4748
color="red"
4849
size="sm"
4950
onClick={async () => {
50-
await deleteThread({ threadId: thread.id });
51+
if (!threadId) return;
52+
await deleteThread({ threadId });
5153
window.location.reload();
5254
}}
5355
aria-label="Delete thread"

example/package.json

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,39 +14,39 @@
1414
],
1515
"main": "js/index.tsx",
1616
"devDependencies": {
17-
"@babel/core": "^7.24.7",
18-
"@babel/preset-env": "^7.24.7",
19-
"@babel/preset-react": "^7.24.7",
20-
"@babel/preset-typescript": "^7.24.7",
17+
"@babel/core": "^7.26.10",
18+
"@babel/preset-env": "^7.26.9",
19+
"@babel/preset-react": "^7.26.3",
20+
"@babel/preset-typescript": "^7.27.0",
2121
"@types/cookie": "^0.6.0",
22-
"@types/react": "^18.3.3",
23-
"babel-loader": "^9.1.3",
22+
"@types/react": "^18.3.20",
23+
"babel-loader": "^9.2.1",
2424
"css-loader": "^7.1.2",
25-
"mini-css-extract-plugin": "^2.9.0",
26-
"postcss": "^8.4.38",
25+
"mini-css-extract-plugin": "^2.9.2",
26+
"postcss": "^8.5.3",
2727
"postcss-import": "^16.1.0",
2828
"postcss-loader": "^8.1.1",
29-
"postcss-preset-env": "^9.5.14",
30-
"postcss-preset-mantine": "^1.15.0",
29+
"postcss-preset-env": "^9.6.0",
30+
"postcss-preset-mantine": "^1.17.0",
3131
"postcss-simple-vars": "^7.0.1",
3232
"react": "^18.3.1",
3333
"react-dom": "^18.3.1",
3434
"style-loader": "^4.0.0",
35-
"typescript": "^5",
36-
"webpack": "^5.92.1",
37-
"webpack-bundle-tracker": "^3.1.0",
35+
"typescript": "^5.8.3",
36+
"webpack": "^5.99.5",
37+
"webpack-bundle-tracker": "^3.1.1",
3838
"webpack-cli": "^5.1.4",
39-
"webpack-dev-server": "^5.0.4"
39+
"webpack-dev-server": "^5.2.1"
4040
},
4141
"dependencies": {
42-
"@mantine/core": "^7.11.0",
43-
"@mantine/hooks": "^7.11.0",
44-
"@mantine/notifications": "^7.11.0",
45-
"@tabler/icons-react": "^3.7.0",
42+
"@mantine/core": "^7.17.4",
43+
"@mantine/hooks": "^7.17.4",
44+
"@mantine/notifications": "^7.17.4",
45+
"@tabler/icons-react": "^3.31.0",
4646
"cookie": "^0.6.0",
47-
"django-ai-assistant-client": "0.1.0",
47+
"django-ai-assistant-client": "0.1.1",
4848
"modern-normalize": "^2.0.0",
49-
"react-markdown": "^9.0.1",
50-
"react-router-dom": "^6.24.0"
49+
"react-markdown": "^9.1.0",
50+
"react-router-dom": "^6.30.0"
5151
}
52-
}
52+
}

0 commit comments

Comments
 (0)