-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e50e27a
commit 435474f
Showing
4 changed files
with
19 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
VITE_OPENAI_API_KEY='' | ||
VITE_OPENAI_API_BASEURL='' | ||
OPENAI_API_BASEURL='' | ||
OPENAI_API_KEY='' | ||
SERPAPI_API_KEY='' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import type { GenerateTextOptions } from '@xsai/generate-text' | ||
import type { ChatCompletion } from './types' | ||
import { chatCompletion } from '@xsai/shared-chat' | ||
|
||
/** | ||
* Generate text | ||
* | ||
* @param params - The parameters to generate text. | ||
* @returns ChatCompletion | ||
*/ | ||
export async function generate(params: GenerateTextOptions) { | ||
const reqRes = await chatCompletion(params) | ||
return await reqRes.json() as ChatCompletion | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters