feat: add code generator (#9051)
Co-authored-by: crazywoola <100913391+crazywoola@users.noreply.github.com>
This commit is contained in:
@@ -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`, {
|
||||
|
Reference in New Issue
Block a user