@d-mok/quasar-app-extension-quasar-axe 2.1.85 → 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@d-mok/quasar-app-extension-quasar-axe",
3
- "version": "2.1.85",
3
+ "version": "2.1.87",
4
4
  "description": "A Quasar App Extension",
5
5
  "author": "d-mok <49301824+d-mok@users.noreply.github.com>",
6
6
  "license": "MIT",
@@ -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 chatAPI(
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 chatAPI(EDEN_API_KEY, prompt, openai_model, temperature)
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
+ }
@@ -26,4 +26,4 @@ export { SupbaseBucket } from './storage'
26
26
 
27
27
  export { extractTextFromPDF } from './pdf'
28
28
 
29
- export { chatAPI } from './edenAI'
29
+ export { EdenAIClient } from './edenAI'