/generate

Generate

Generate a response using Contextual's Grounded Language Model (GLM), an LLM engineered specifically to prioritize faithfulness to in-context retrievals over parametric knowledge to reduce hallucinations in Retrieval-Augmented Generation.

The total request cannot exceed 32,000 tokens. Email glm-feedback@contextual.ai with any feedback or questions.

post/generate

Request body

modelstring required

The version of the Contextual's GLM to use. Currently, we just have "v1".

knowledgestring[] required

The knowledge sources the model can use when generating a response.

system_promptstring

Instructions that the model follows when generating responses. Note that we do not guarantee that the model follows these instructions exactly.

avoid_commentaryboolean

Flag to indicate whether the model should avoid providing additional commentary in responses. Commentary is conversational in nature and does not contain verifiable claims; therefore, commentary is not strictly grounded in available context. However, commentary may provide useful context which improves the helpfulness of responses.

Response

Successful Response

responsestring required

The model's response to the last user message.

Changes