Skip to main content
Server path: /writer | Type: Application | PCID required: Yes

Tools


writer_add_file_to_graph

Add file to graph Parameters:
ParameterTypeRequiredDefaultDescription
graph_idstringYesThe unique identifier of the Knowledge Graph.
file_idstringYesThe unique identifier of the file.

writer_analyze_vision

Analyze images Parameters:
ParameterTypeRequiredDefaultDescription
modelstringYesThe model to use for image analysis.
promptstringYesThe prompt to use for the image analysis. The prompt must include the name of each image variable, surrounded by double curly braces ({{}}). For example, Describe the difference between the image {{image_1}} and the image {{image_2}}.
variablesany[]Yesvariables

writer_chat

Chat completion Parameters:
ParameterTypeRequiredDefaultDescription
logprobsbooleanNoSpecifies whether to return log probabilities of the output tokens.
max_tokensintegerNoDefines the maximum number of tokens (words and characters) that the model can generate in the response. This can be adjusted to allow for longer or shorter responses as needed. The maximum value varies by model. See the models overview for more information about the maximum number of tokens for each model.
messagesany[]YesAn array of message objects that form the conversation history or context for the model to respond to. The array must contain at least one message.
modelstringYesThe ID of the model to use for creating the chat completion. Supports palmyra-x5, palmyra-x4, palmyra-fin, palmyra-med, palmyra-creative, and palmyra-x-003-instruct.
nintegerNoSpecifies the number of completions (responses) to generate from the model in a single request. This parameter allows for generating multiple responses, offering a variety of potential replies from which to choose.
response_formatobjectNoThe response format to use for the chat completion, available with palmyra-x4 and palmyra-x5. text is the default response format. JSON Schema is supported for structured responses. If you specify json_schema, you must also provide a json_schema object.
stopobjectNoA token or sequence of tokens that, when generated, will cause the model to stop producing further content. This can be a single token or an array of tokens, acting as a signal to end the output.
streambooleanNoIndicates whether the response should be streamed incrementally as it is generated or only returned once fully complete. Streaming can be useful for providing real-time feedback in interactive applications.
stream_optionsobjectNoAdditional options for streaming.
temperaturenumberNoControls the randomness or creativity of the model’s responses. A higher temperature results in more varied and less predictable text, while a lower temperature produces more deterministic and conservative outputs.
tool_choiceobjectNoConfigure how the model will call functions: - auto: allows the model to automatically choose the tool to use, or not call a tool - none: disables tool calling; the model will instead generate a message - required: requires the model to call one or more tools You can also use a JSON object to force the model to call a specific tool. For example, {"type": "function", "function": {"name": "get_current_weather"}} requires the model to call the get_current_weather function, regardless of the prompt.
toolsany[]NoAn array containing tool definitions for tools that the model can use to generate responses. The tool definitions use JSON schema. You can define your own functions or use one of the built-in graph, llm, translation, or vision tools. Note that you can only use one built-in tool type in the array (only one of graph, llm, translation, or vision). You can pass multiple custom tools of type function in the same request.
top_pnumberNoSets the threshold for “nucleus sampling,” a technique to focus the model’s token generation on the most likely subset of tokens. Only tokens with cumulative probability above this threshold are considered, controlling the trade-off between creativity and coherence.

writer_completions

Text generation Parameters:
ParameterTypeRequiredDefaultDescription
best_ofintegerNoSpecifies the number of completions to generate and return the best one. Useful for generating multiple outputs and choosing the best based on some criteria.
max_tokensintegerNoThe maximum number of tokens that the model can generate in the response.
modelstringYesThe ID of the model to use for generating text. Supports palmyra-x5, palmyra-x4, palmyra-fin, palmyra-med, palmyra-creative, and palmyra-x-003-instruct.
promptstringYesThe input text that the model will process to generate a response.
random_seedintegerNoA seed used to initialize the random number generator for the model, ensuring reproducibility of the output when the same inputs are provided.
stopobjectNoSpecifies stopping conditions for the model’s output generation. This can be an array of strings or a single string that the model will look for as a signal to stop generating further tokens.
streambooleanNoDetermines whether the model’s output should be streamed. If true, the output is generated and sent incrementally, which can be useful for real-time applications.
temperaturenumberNoControls the randomness of the model’s outputs. Higher values lead to more random outputs, while lower values make the model more deterministic.
top_pnumberNoUsed to control the nucleus sampling, where only the most probable tokens with a cumulative probability of top_p are considered for sampling, providing a way to fine-tune the randomness of predictions.

writer_comprehend_medical

Medical comprehend Parameters:
ParameterTypeRequiredDefaultDescription
contentstringYesThe text to analyze.
response_typestringYesresponse_type

writer_context_aware_splitting

Context-aware text splitting Parameters:
ParameterTypeRequiredDefaultDescription
strategystringYesstrategy
textstringYesThe text to split into chunks.

writer_convert_text_to_graph

Text-to-graph Parameters:
ParameterTypeRequiredDefaultDescription
textstringYesThe text to convert into a graph structure. Maximum of 35,000 words.

writer_create_graph

Create graph Parameters:
ParameterTypeRequiredDefaultDescription
descriptionstringNoA description of the Knowledge Graph (max 255 characters). Omitting this field leaves the description unchanged.
namestringNoThe name of the Knowledge Graph (max 255 characters). Omitting this field leaves the name unchanged.

writer_delete_graph

Delete graph Parameters:
ParameterTypeRequiredDefaultDescription
graph_idstringYesThe unique identifier of the Knowledge Graph.

writer_detect_ai_content

AI detection Parameters:
ParameterTypeRequiredDefaultDescription
inputstringYesThe content to determine if it is AI- or human-generated. Content must have at least 350 characters.

writer_find_graph_with_file_status

Retrieve graph Parameters:
ParameterTypeRequiredDefaultDescription
graph_idstringYesThe unique identifier of the Knowledge Graph.

writer_find_graphs_with_file_status

List graphs Parameters:
ParameterTypeRequiredDefaultDescription
orderstringNoSpecifies the order of the results. Valid values are asc for ascending and desc for descending.
beforestringNoThe ID of the first object in the previous page. This parameter instructs the API to return the previous page of results.
afterstringNoThe ID of the last object in the previous page. This parameter instructs the API to return the next page of results.
limitintegerNoSpecifies the maximum number of objects returned in a page. The default value is 50. The minimum value is 1, and the maximum value is 100.

writer_gateway_delete_file

Delete file Parameters:
ParameterTypeRequiredDefaultDescription
file_idstringYesThe unique identifier of the file.

writer_gateway_download_file

Download file Parameters:
ParameterTypeRequiredDefaultDescription
file_idstringYesThe unique identifier of the file.

writer_gateway_get_file

Retrieve file Parameters:
ParameterTypeRequiredDefaultDescription
file_idstringYesThe unique identifier of the file.

writer_gateway_get_files

List files Parameters:
ParameterTypeRequiredDefaultDescription
beforestringNoThe ID of the first object in the previous page. This parameter instructs the API to return the previous page of results.
afterstringNoThe ID of the last object in the previous page. This parameter instructs the API to return the next page of results.
limitintegerNoSpecifies the maximum number of objects returned in a page. The default value is 50. The minimum value is 1, and the maximum value is 100.
orderstringNoSpecifies the order of the results. Valid values are asc for ascending and desc for descending.
graph_idstringNoThe unique identifier of the graph to which the files belong.
statusstringNoSpecifies the status of the files to retrieve. Valid values are in_progress, completed or failed.
file_typesstringNoThe extensions of the files to retrieve. Separate multiple extensions with a comma. For example: pdf,jpg,docx.

writer_gateway_retry_failed_files

Retry failed files Parameters:
ParameterTypeRequiredDefaultDescription
file_idsany[]YesThe unique identifier of the files to retry.

writer_gateway_upload_file

Upload file Parameters:
ParameterTypeRequiredDefaultDescription
Content-DispositionstringYesDisposition type of the file. Use attachment with the filename parameter, for example: attachment; filename=example.pdf.
Content-TypestringYesMIME type of the file being uploaded. Supports txt, doc, docx, ppt, pptx, jpg, png, eml, html, pdf, srt, csv, xls, xlsx, mp3, and mp4.
Content-LengthintegerYesSize of the file in bytes.
graphIdstringNoThe unique identifier of the Knowledge Graph to associate the uploaded file with. Note: The response from the upload endpoint does not include the graphId field, but the association will be visible when you retrieve the file using the file retrieval endpoint.
bodystringYesThe raw file content to upload.

writer_generate_application_async

Generate from application (async) Parameters:
ParameterTypeRequiredDefaultDescription
application_idstringYesThe ID of the no-code app for which to create a job.
inputsany[]YesA list of input objects to generate content for.

writer_generate_content

Generate from application Parameters:
ParameterTypeRequiredDefaultDescription
application_idstringYesThe unique identifier of a no-code agent in AI Studio.
inputsany[]Yesinputs
streambooleanNoIndicates whether the response should be streamed. Currently only supported for research assistant applications.

writer_get_application

Application details Parameters:
ParameterTypeRequiredDefaultDescription
application_idstringYesUnique identifier of the application to retrieve.

writer_get_application_graphs

Retrieve graphs Parameters:
ParameterTypeRequiredDefaultDescription
application_idstringYesThe ID of the no-code agent for which to retrieve Knowledge Graphs.

writer_get_application_job

Retrieve a single job Parameters:
ParameterTypeRequiredDefaultDescription
job_idstringYesThe ID of the job to retrieve.

writer_list_application_jobs

Retrieve all jobs Parameters:
ParameterTypeRequiredDefaultDescription
application_idstringYesThe ID of the no-code app for which to retrieve jobs.
statusstringNoThe status of the job.
offsetintegerNoThe pagination offset for retrieving the jobs.
limitintegerNoThe pagination limit for retrieving the jobs.

writer_list_applications

List applications Parameters:
ParameterTypeRequiredDefaultDescription
orderstringNoSort order for the results based on creation time.
beforestringNoReturn results before this application ID for pagination.
afterstringNoReturn results after this application ID for pagination.
limitintegerNoMaximum number of applications to return in the response.
typestringNoFilter applications by their type.

writer_models

List models

writer_parse_pdf

Parse PDF Parameters:
ParameterTypeRequiredDefaultDescription
file_idstringYesThe unique identifier of the file.
formatstringYesThe format into which the PDF content should be converted.

writer_question

Question Parameters:
ParameterTypeRequiredDefaultDescription
graph_idsany[]YesThe unique identifiers of the Knowledge Graphs to query.
query_configobjectNoConfiguration options for Knowledge Graph queries.
questionstringYesThe question to answer using the Knowledge Graph.
streambooleanNoDetermines whether the model’s output should be streamed. If true, the output is generated and sent incrementally, which can be useful for real-time applications.
subqueriesbooleanNoSpecify whether to include subqueries.

writer_remove_file_from_graph

Remove file from graph Parameters:
ParameterTypeRequiredDefaultDescription
graph_idstringYesThe unique identifier of the Knowledge Graph to which the files belong.
file_idstringYesThe unique identifier of the file.

writer_retry_application_job

Retry job execution Parameters:
ParameterTypeRequiredDefaultDescription
job_idstringYesThe ID of the job to retry.

writer_translate

Translate text Parameters:
ParameterTypeRequiredDefaultDescription
formalitybooleanYesWhether to use formal or informal language in the translation. See the list of languages that support formality. If the language does not support formality, this parameter is ignored.
length_controlbooleanYesWhether to control the length of the translated text. See the list of languages that support length control. If the language does not support length control, this parameter is ignored.
mask_profanitybooleanYesWhether to mask profane words in the translated text. See the list of languages that do not support profanity masking. If the language does not support profanity masking, this parameter is ignored.
modelstringYesThe model to use for translation.
source_language_codestringYesThe ISO-639-1 language code of the original text to translate. For example, en for English, zh for Chinese, fr for French, es for Spanish. If the language has a variant, the code appends the two-digit ISO-3166 country code. For example, Mexican Spanish is es-MX. See the list of supported languages and language codes.
target_language_codestringYesThe ISO-639-1 language code of the target language for the translation. For example, en for English, zh for Chinese, fr for French, es for Spanish. If the language has a variant, the code appends the two-digit ISO-3166 country code. For example, Mexican Spanish is es-MX. See the list of supported languages and language codes.
textstringYesThe text to translate. Maximum of 100,000 words.

writer_update_application_graphs

Associate graphs Parameters:
ParameterTypeRequiredDefaultDescription
application_idstringYesThe ID of the no-code agent to update. Only no-code agents with chat capabilities can have associated Knowledge Graphs. No-code agents with text generation and research capabilities do not support Knowledge Graphs.
graph_idsany[]YesA list of Knowledge Graph IDs to associate with the application. Note that this will replace the existing list of Knowledge Graphs associated with the application, not add to it.

writer_update_graph

Update graph Parameters:
ParameterTypeRequiredDefaultDescription
graph_idstringYesThe unique identifier of the Knowledge Graph.
descriptionstringNoA description of the Knowledge Graph (max 255 characters). Omitting this field leaves the description unchanged.
namestringNoThe name of the Knowledge Graph (max 255 characters). Omitting this field leaves the name unchanged.
urlsany[]NoAn array of web connector URLs to update for this Knowledge Graph. You can only connect URLs to Knowledge Graphs with the type web. To clear the list of URLs, set this field to an empty array.

Web search Parameters:
ParameterTypeRequiredDefaultDescription
chunks_per_sourceintegerNoOnly applies when search_depth is advanced. Specifies how many text segments to extract from each source. Limited to 3 chunks maximum.
countrystringNoLocalizes search results to a specific country. Only applies to general topic searches.
daysintegerNoFor news topic searches, specifies how many days of news coverage to include.
exclude_domainsany[]NoDomains to exclude from the search. If unset, the search includes all domains.
include_answerbooleanNoWhether to include a generated answer to the query in the response. If false, only search results are returned.
include_domainsany[]NoDomains to include in the search. If unset, the search includes all domains.
include_raw_contentobjectNoControls how raw content is included in search results: - text: Returns plain text without formatting markup - markdown: Returns structured content with markdown formatting (headers, links, bold text) - true: Same as markdown - false: Raw content is not included (default if unset)
max_resultsintegerNoLimits the number of search results returned. Cannot exceed 20 sources.
querystringNoThe search query.
search_depthstringNoControls search comprehensiveness: - basic: Returns fewer but highly relevant results - advanced: Performs a deeper search with more results
streambooleanNoEnables streaming of search results as they become available.
time_rangestringNoFilters results to content published within the specified time range back from the current date. For example, week or w returns results from the past 7 days.
topicstringNoThe search topic category. Use news for current events and news articles, or general for broader web search.