feat: add code generator (#9051)
Co-authored-by: crazywoola <100913391+crazywoola@users.noreply.github.com>
This commit is contained in:
parent
0e965b6529
commit
a7ee51e5d8
12 changed files with 470 additions and 2 deletions
|
|
@ -9,6 +9,11 @@ export type AutomaticRes = {
|
|||
opening_statement: string
|
||||
error?: string
|
||||
}
|
||||
export type CodeGenRes = {
|
||||
code: string
|
||||
language: string[]
|
||||
error?: string
|
||||
}
|
||||
|
||||
export const sendChatMessage = async (appId: string, body: Record<string, any>, { onData, onCompleted, onThought, onFile, onError, getAbortController, onMessageEnd, onMessageReplace }: {
|
||||
onData: IOnData
|
||||
|
|
@ -71,6 +76,11 @@ export const generateRule = (body: Record<string, any>) => {
|
|||
body,
|
||||
})
|
||||
}
|
||||
export const generateRuleCode = (body: Record<string, any>) => {
|
||||
return post<CodeGenRes>('/rule-code-generate', {
|
||||
body,
|
||||
})
|
||||
}
|
||||
|
||||
export const fetchModelParams = (providerName: string, modelId: string) => {
|
||||
return get(`workspaces/current/model-providers/${providerName}/models/parameter-rules`, {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue