@d-mok/quasar-app-extension-quasar-axe 2.1.86 → 2.1.87
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
|
@@ -87,7 +87,7 @@ function sleep(ms: number): Promise<void> {
|
|
|
87
87
|
return new Promise(resolve => setTimeout(resolve, ms))
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
export async function
|
|
90
|
+
export async function chat(
|
|
91
91
|
EDEN_API_KEY: string,
|
|
92
92
|
prompt: string,
|
|
93
93
|
openai_model: string,
|
|
@@ -95,7 +95,7 @@ export async function chatAPI(
|
|
|
95
95
|
): Promise<string> {
|
|
96
96
|
if (occupied) {
|
|
97
97
|
await sleep(5000)
|
|
98
|
-
return await
|
|
98
|
+
return await chat(EDEN_API_KEY, prompt, openai_model, temperature)
|
|
99
99
|
}
|
|
100
100
|
occupied = true
|
|
101
101
|
let res = await fetchChatAPI(
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { chat } from './chat'
|
|
2
|
+
|
|
3
|
+
class EdenAI {
|
|
4
|
+
constructor(private EDEN_API_KEY: string) {}
|
|
5
|
+
|
|
6
|
+
chat(prompt: string, openai_model: string, temperature: number) {
|
|
7
|
+
return chat(this.EDEN_API_KEY, prompt, openai_model, temperature)
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function EdenAIClient(EDEN_API_KEY: string) {
|
|
12
|
+
return new EdenAI(EDEN_API_KEY)
|
|
13
|
+
}
|