Skip to main content

Ask

Answer a question from a knowledge index: the best passages go to the model, which answers from them only and cites them.

Command in the Knowledge Q&A toolkit · id ooa.knowledge/ask · 13 inputs (1 required), 5 outputs

Inputs​

InputTypeRequiredDefaultWhat it is
Index fileFileNoThe index file, e.g. knowledge/policies.json (.json.gz keeps it smaller).
QuestionStringYesThe question.
Top kNumberNo5How many passages the model gets.
ConnectionStringNoName of a Model Connection (provider, model and key managed in one place). Leave empty to set them on this action.
ProviderStringNoopenaiWho runs the model: OpenAI, Azure OpenAI, Anthropic, OpenAI-compatible (LiteLLM, vLLM, Ollama), Hugging Face (its router or your own TGI server), AWS SageMaker (a model on an Amazon SageMaker endpoint), AWS Bedrock or Google Vertex AI (Gemini).
ModelStringNoModel name; the deployment name for Azure OpenAI; the endpoint name for AWS SageMaker; the model or inference profile id for AWS Bedrock.
API keyCredentialNoAPI key or access token from the vault (not needed for some self-hosted endpoints). For AWS Bedrock and AWS SageMaker: the AWS secret access key (or ACCESS_KEY_ID:SECRET). For Google Vertex AI: a service-account JSON key or an access token.
Endpoint addressStringNoEndpoint; required for Azure OpenAI, Vertex AI (https://REGION-aiplatform.googleapis.com/v1/projects/PROJECT/locations/REGION) and self-hosted models (for a TGI server, e.g. http://tgi-host:8080/v1).
Embedding connectionStringNoThe embedding connection, when not the one the index was built with.
Maximum tokensNumberNo1024Maximum answer length in tokens.
Hide personal dataBooleanNotrueReplace emails, phone and card numbers, IBANs and similar before sending; restored in the answer.
Timeout (seconds)NumberNo0Seconds to wait for the model; 180 when 0.
Knowledge baseStringNoA knowledge base kept in One CommandCenter (AI > Knowledge bases), by name; in Studio without One CommandCenter, knowledge-bases/<name>.json.gz in the work folder.

Outputs​

OutputTypeWhat it is
answerStringThe answer, citing passages like [1].
sourcesListThe passages given to the model: n, source, passage, score, text.
foundBooleanFalse when no passage matched, so the model was not asked.
input_tokensNumberTokens in the request.
output_tokensNumberTokens in the answer.