@audashai/cli 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -3,20 +3,20 @@ import { AudashAIInput } from './AudashAIInput';
|
|
|
3
3
|
import { AudashAIOutput } from './AudashAIOutput';
|
|
4
4
|
|
|
5
5
|
interface AudashAIChatbotProps {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
audashaiKey: string;
|
|
7
|
+
audashaiUrl: string;
|
|
8
8
|
dataApiUrl?: string;
|
|
9
9
|
endpoints?: string[];
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
const AudashAIChatbot: React.FC<AudashAIChatbotProps> = ({
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
audashaiKey,
|
|
14
|
+
audashaiUrl,
|
|
15
15
|
dataApiUrl,
|
|
16
16
|
endpoints,
|
|
17
17
|
}) => {
|
|
18
18
|
return (
|
|
19
|
-
<AudashAIProvider config={{
|
|
19
|
+
<AudashAIProvider config={{ audashaiKey, audashaiUrl, dataApiUrl, endpoints }}>
|
|
20
20
|
<div className="w-full max-w-7xl mx-auto p-4">
|
|
21
21
|
<div className="flex flex-col lg:flex-row-reverse gap-4 lg:h-[300px] items-stretch">
|
|
22
22
|
<div className="w-full lg:w-[350px] flex-shrink-0">
|
|
@@ -29,14 +29,14 @@ export const AudashAIInput: React.FC = () => {
|
|
|
29
29
|
setErrorInfo(null);
|
|
30
30
|
|
|
31
31
|
try {
|
|
32
|
-
const response = await fetch(`${config.
|
|
32
|
+
const response = await fetch(`${config.audashaiUrl}/query`, {
|
|
33
33
|
method: 'POST',
|
|
34
34
|
headers: {
|
|
35
35
|
'Content-Type': 'application/json',
|
|
36
36
|
},
|
|
37
37
|
body: JSON.stringify({
|
|
38
38
|
query: inputValue,
|
|
39
|
-
api_key: config.
|
|
39
|
+
api_key: config.audashaiKey,
|
|
40
40
|
limit: 10,
|
|
41
41
|
}),
|
|
42
42
|
});
|
package/templates/index.tsx
CHANGED
package/templates/types/index.ts
CHANGED
package/templates/utils/api.ts
CHANGED
|
@@ -33,7 +33,7 @@ export async function ingestSingleEndpoint(endpoint: string, config: AudashAICon
|
|
|
33
33
|
throw new Error(`Failed to fetch data from ${endpoint}`);
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
const response = await fetch(`${config.
|
|
36
|
+
const response = await fetch(`${config.audashaiUrl}/ingest`, {
|
|
37
37
|
method: 'POST',
|
|
38
38
|
headers: {
|
|
39
39
|
'Content-Type': 'application/json',
|
|
@@ -41,7 +41,7 @@ export async function ingestSingleEndpoint(endpoint: string, config: AudashAICon
|
|
|
41
41
|
body: JSON.stringify({
|
|
42
42
|
data: data.data || data,
|
|
43
43
|
source_name: endpoint,
|
|
44
|
-
api_key: config.
|
|
44
|
+
api_key: config.audashaiKey,
|
|
45
45
|
metadata: { description: `${endpoint} data from API` },
|
|
46
46
|
}),
|
|
47
47
|
});
|