mirror of
https://github.com/langgenius/dify.git
synced 2026-02-12 22:01:20 -05:00
feat: Add suggested questions to context generate modal
This commit is contained in:
@@ -58,6 +58,23 @@ export type ContextGenerateResponse = {
|
||||
error: string
|
||||
}
|
||||
|
||||
export type ContextGenerateSuggestedQuestionsRequest = {
|
||||
workflow_id: string
|
||||
node_id: string
|
||||
parameter_name: string
|
||||
language: string
|
||||
model_config: {
|
||||
provider: string
|
||||
name: string
|
||||
completion_params?: CompletionParams
|
||||
}
|
||||
}
|
||||
|
||||
export type ContextGenerateSuggestedQuestionsResponse = {
|
||||
questions: string[]
|
||||
error: string
|
||||
}
|
||||
|
||||
export type TextGenerationMessageFile = FileEntity & {
|
||||
belongs_to?: 'assistant' | 'user' | string
|
||||
}
|
||||
@@ -149,6 +166,18 @@ export const generateContext = (body: ContextGenerateRequest) => {
|
||||
})
|
||||
}
|
||||
|
||||
export const fetchContextGenerateSuggestedQuestions = (
|
||||
body: ContextGenerateSuggestedQuestionsRequest,
|
||||
getAbortController?: (abortController: AbortController) => void,
|
||||
) => {
|
||||
return post<ContextGenerateSuggestedQuestionsResponse>('/context-generate/suggested-questions', {
|
||||
body,
|
||||
}, {
|
||||
getAbortController,
|
||||
silent: true,
|
||||
})
|
||||
}
|
||||
|
||||
export const fetchModelParams = (providerName: string, modelId: string) => {
|
||||
return get(`workspaces/current/model-providers/${providerName}/models/parameter-rules`, {
|
||||
params: {
|
||||
|
||||
Reference in New Issue
Block a user