← Tools Reference

Baidu Qianfan

Baidu Qianfan integration (AI). Imported from open-connector.

API key22 toolshttps://api.qianfan.com
GET
qianfan_list_models
List the models available to the current Baidu Qianfan API key.

/models

POST
qianfan_create_completion
Create a non-streaming fill-in-the-middle completion with Baidu Qianfan.

/completions

10 parameters
ParamTypeRequiredDescription
modelstringoptionalThe Qianfan FIM model identifier to use.
promptstringoptionalThe non-empty prefix text that the model should continue from.
suffixstringoptionalThe optional suffix text used for fill-in-the-middle completion.
max_tokensintegeroptionalThe maximum number of tokens to generate.
temperaturenumberoptionalThe sampling temperature for generation.
top_pnumberoptionalThe nucleus sampling threshold.
stoparrayoptionalUp to four stop sequences that stop generation.
streambooleanoptionalWhether to request a streaming response. This connector only accepts false or o…
stream_optionsobjectoptionalAdditional upstream-compatible request fields.
user_idstringoptionalThe end-user identifier for tracing requests.
POST
qianfan_create_chat_completion
Create a non-streaming OpenAI-compatible chat completion with Baidu Qianfan.

/chat/completions

14 parameters
ParamTypeRequiredDescription
modelstringoptionalThe Qianfan model identifier to use.
messagesarrayoptionalThe ordered conversation messages.
max_tokensintegeroptionalThe maximum number of tokens to generate.
temperaturenumberoptionalThe sampling temperature for generation.
top_pnumberoptionalThe nucleus sampling threshold.
frequency_penaltynumberoptionalThe frequency penalty applied to repeated tokens.
presence_penaltynumberoptionalThe presence penalty applied to newly introduced tokens.
stopstringoptional
streambooleanoptionalWhether to request a streaming response. This connector only accepts false or o…
stream_optionsobjectoptionalAdditional upstream-compatible request fields.
response_formatobjectoptionalAdditional upstream-compatible request fields.
toolsarrayoptionalThe tools available to the model.
tool_choicestringoptionalHow the model should choose tools.
userstringoptionalAn end-user identifier for tracing and abuse monitoring.
POST
qianfan_create_ai_search_completion
Create a non-streaming AI search chat completion with Baidu Qianfan.

/ai_search/chat/completions

3 parameters
ParamTypeRequiredDescription
modelstringoptionalThe AI search model identifier to use.
messagesarrayoptionalThe ordered conversation messages.
streambooleanoptionalWhether to request a streaming response. This connector only accepts false or o…
POST
qianfan_create_embeddings
Generate embedding vectors for one or more input strings with Baidu Qianfan.

/embeddings

5 parameters
ParamTypeRequiredDescription
modelstringoptionalThe embedding model identifier.
inputstringoptionalOne or more input strings to embed.
encoding_formatstringoptionalThe output encoding format for embeddings.
dimensionsintegeroptionalThe target embedding dimension count.
userstringoptionalAn end-user identifier for tracing and abuse monitoring.
POST
qianfan_rerank
Score and rank candidate documents against a query with a Baidu Qianfan rerank model.

/rerank

7 parameters
ParamTypeRequiredDescription
modelstringoptionalThe rerank model identifier.
querystringoptionalThe search query used to score the candidate documents.
documentsarrayoptionalThe ordered candidate documents to rank.
top_nintegeroptionalThe maximum number of ranked documents to return.
return_documentsbooleanoptionalWhether to include the ranked document text in the response.
max_chunks_per_docintegeroptionalThe maximum number of chunks to evaluate per document.
userstringoptionalAn end-user identifier for tracing and abuse monitoring.
POST
qianfan_create_image_generation
Generate images with the Baidu Qianfan general image generation endpoint.

/images/generations

6 parameters
ParamTypeRequiredDescription
modelstringoptionalThe image model identifier to use.
promptstringoptionalThe prompt used to generate the image.
nintegeroptionalThe number of images to generate.
seedintegeroptionalThe random seed used for generation.
sizestringoptionalThe output image size, for example 1024x1024.
response_formatstringoptionalThe response format requested from the upstream API.
POST
qianfan_create_video_generation_task
Create a Baidu Qianfan video generation task.

/video/generations

5 parameters
ParamTypeRequiredDescription
modelstringoptionalThe video model identifier to use.
contentarrayoptionalThe ordered content items for generation.
durationintegeroptionalThe requested video duration in seconds.
prompt_extendbooleanoptionalWhether the upstream prompt extension feature should be enabled.
watermarkbooleanoptionalWhether a watermark should be added.
GET
qianfan_get_video_generation_task
Fetch a Baidu Qianfan video generation task by its task identifier.

/video/generations

1 parameter
ParamTypeRequiredDescription
task_idstringrequiredThe video task identifier.
DELETE
qianfan_cancel_video_generation_task
Cancel a Baidu Qianfan video generation task by its task identifier.

/video/generations

1 parameter
ParamTypeRequiredDescription
task_idstringrequiredThe video task identifier.
GET
qianfan_list_video_generation_tasks
List Baidu Qianfan video generation tasks with optional filters.

/video/generations/list

7 parameters
ParamTypeRequiredDescription
page_numintegeroptionalThe page number to fetch.
page_sizeintegeroptionalThe number of tasks per page.
statusstringoptionalFilter by task status.
task_idsarrayoptionalFilter by task identifiers.
model_namestringoptionalFilter by model name.
start_timestringoptionalFilter tasks created after this time.
end_timestringoptionalFilter tasks created before this time.
POST
qianfan_upload_file
Upload a file to Baidu Qianfan for batch or other file-based APIs.

/files

2 parameters
ParamTypeRequiredDescription
fileobjectoptionalThe file uploaded through POST /api/files to send to Qianfan.
purposestringoptionalThe declared purpose of the uploaded file.
GET
qianfan_list_files
List files stored in Baidu Qianfan with optional filters.

/files

4 parameters
ParamTypeRequiredDescription
afterstringoptionalReturn files after this file identifier.
limitintegeroptionalThe maximum number of files to return.
orderstringoptionalThe order in which files should be returned.
purposestringoptionalFilter by file purpose.
GET
qianfan_get_file_content
Fetch the raw content of a Baidu Qianfan file by its identifier.

/files/{input}/content

2 parameters
ParamTypeRequiredDescription
file_idstringrequiredThe file identifier.
inputstringrequiredPath parameter: input
POST
qianfan_create_batch
Create a Baidu Qianfan batch prediction job from an uploaded input file.

/batches

5 parameters
ParamTypeRequiredDescription
input_file_idstringoptionalThe input file identifier used by the batch.
endpointstringoptionalThe endpoint executed for each batch item.
completion_windowstringoptionalThe completion window requested for the batch.
metadataobjectoptionalAdditional upstream-compatible request fields.
replacebooleanoptionalWhether an existing output should be replaced.
POST
qianfan_cancel_batch
Cancel a Baidu Qianfan batch prediction job by its identifier.

/batches/{input}/cancel

2 parameters
ParamTypeRequiredDescription
batch_idstringrequiredThe batch identifier.
inputstringrequiredPath parameter: input
GET
qianfan_get_batch
Fetch a Baidu Qianfan batch prediction job by its identifier.

/batches/{input}

2 parameters
ParamTypeRequiredDescription
batch_idstringrequiredThe batch identifier.
inputstringrequiredPath parameter: input
GET
qianfan_list_batches
List Baidu Qianfan batch prediction jobs with optional pagination.

/batches

2 parameters
ParamTypeRequiredDescription
afterstringoptionalReturn batches after this batch identifier.
limitintegeroptionalThe maximum number of batches to return.
POST
qianfan_create_response
Create a non-streaming stored response with the Baidu Qianfan responses API.

/responses

4 parameters
ParamTypeRequiredDescription
modelstringoptionalThe Qianfan model identifier to use.
inputstringoptionalThe text or structured input items sent to the model.
instructionsstringoptionalAn optional system instruction inserted before the input.
streambooleanoptionalWhether to request a streaming response. This connector only accepts false or o…
GET
qianfan_get_response
Fetch a previously stored Baidu Qianfan response by its identifier.

/responses/{input}

2 parameters
ParamTypeRequiredDescription
response_idstringrequiredThe response identifier.
inputstringrequiredPath parameter: input
DELETE
qianfan_delete_response
Delete a previously stored Baidu Qianfan response by its identifier.

/responses/{input}

2 parameters
ParamTypeRequiredDescription
response_idstringrequiredThe response identifier.
inputstringrequiredPath parameter: input
GET
qianfan_list_response_input_items
List the stored context items for a previously created Baidu Qianfan response.

/responses/{input}/input_items

6 parameters
ParamTypeRequiredDescription
response_idstringrequiredThe response identifier.
afterstringoptionalReturn items after this item identifier.
beforestringoptionalReturn items before this item identifier.
limitintegeroptionalThe maximum number of items to return.
orderstringoptionalThe order in which input items should be returned.
inputstringrequiredPath parameter: input