Skip to content

Commit 57180df

Browse files
authored
Merge pull request #62 from jianyi-gronk/main
Add chat interaction capabilities
2 parents a5f1aba + a072a78 commit 57180df

File tree

6 files changed

+956
-84
lines changed

6 files changed

+956
-84
lines changed

spring-ai-alibaba-integration-example/frontend/package.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
"antd": "^5.23.0",
1616
"antd-style": "^3.7.1",
1717
"react": "^18.3.1",
18-
"react-dom": "^18.3.1"
18+
"react-dom": "^18.3.1",
19+
"react-markdown": "^10.0.0"
1920
},
2021
"devDependencies": {
2122
"@eslint/js": "^9.17.0",
@@ -29,5 +30,10 @@
2930
"globals": "^15.14.0",
3031
"typescript": "^5.7.3",
3132
"vite": "^6.0.5"
33+
},
34+
"pnpm": {
35+
"patchedDependencies": {
36+
"@ant-design/x@1.0.4": "patches/@ant-design__x@1.0.4.patch"
37+
}
3238
}
3339
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
diff --git a/es/useXAgent/index.d.ts b/es/useXAgent/index.d.ts
2+
index 1060cc2eec41d3e15ab8892a73bdaea9a2b0a80e..85bc84d44cf2dace89f020f0066d1bc477942fdc 100644
3+
--- a/es/useXAgent/index.d.ts
4+
+++ b/es/useXAgent/index.d.ts
5+
@@ -17,7 +17,7 @@ export interface XAgentConfigPreset {
6+
export interface XAgentConfigCustom<Message> {
7+
request?: RequestFn<Message>;
8+
}
9+
-export type XAgentConfig<Message> = Partial<XAgentConfigPreset> & XAgentConfigCustom<Message>;
10+
+export type XAgentConfig<Message> = Partial<XAgentConfigPreset> & XAgentConfigCustom<Message> & {customParams: array<any>};
11+
/** This is a wrap class to avoid developer can get too much on origin object */
12+
export declare class XAgent<Message = string> {
13+
config: XAgentConfig<Message>;
14+
diff --git a/es/useXAgent/index.js b/es/useXAgent/index.js
15+
index 0e827decc3c1707548ec3a90a8f9bf5dc6f9c6cf..562f54ffe3508cac8b7225082f92c057774e4e67 100644
16+
--- a/es/useXAgent/index.js
17+
+++ b/es/useXAgent/index.js
18+
@@ -53,6 +53,7 @@ export class XAgent {
19+
export default function useXAgent(config) {
20+
const {
21+
request,
22+
+ customParams = [],
23+
...restConfig
24+
} = config;
25+
return React.useMemo(() => [new XAgent({
26+
@@ -62,5 +63,5 @@ export default function useXAgent(config) {
27+
dangerouslyApiKey: restConfig.dangerouslyApiKey
28+
}).create,
29+
...restConfig
30+
- })], []);
31+
+ })], [...customParams]);
32+
}

0 commit comments

Comments
 (0)