PageSourceSearch

https://docs.mellea.ai/assets/js/bc5e73e1.e5f2b154.js

js mellea.ai collected 2026-09-25 20:43:18 UTC 35,462 bytes, 1 lines download raw bytes

1"use strict";(globalThis.webpackChunkmellea_docs=globalThis.webpackChunkmellea_docs||[]).push([[17364],{67845(e,n,t){t.r(n),t.d(n,{assets:()=>a,contentTitle:()=>r,default:()=>h,frontMatter:()=>o,metadata:()=>s,toc:()=>c});const s=JSON.parse('{"id":"api/mellea/formatters/granite/base/types","title":"mellea.formatters.granite.base.types","description":"Common Pydantic types shared across the Granite formatter package.","source":"@site/versioned_docs/version-0.7.0/api/mellea/formatters/granite/base/types.mdx","sourceDirName":"api/mellea/formatters/granite/base","slug":"/api/mellea/formatters/granite/base/types","permalink":"/0.7.0/api/mellea/formatters/granite/base/types","draft":false,"unlisted":false,"editUrl":"https://github.com/generative-computing/mellea/edit/main/versioned_docs/version-0.7.0/api/mellea/formatters/granite/base/types.mdx","tags":[],"version":"0.7.0","lastUpdatedAt":1784029244000,"frontMatter":{"title":"mellea.formatters.granite.base.types","sidebar_label":"mellea.formatters.granite.base.types","description":"Common Pydantic types shared across the Granite formatter package."},"sidebar":"apiSidebar","previous":{"title":"mellea.formatters.granite.base.optional","permalink":"/0.7.0/api/mellea/formatters/granite/base/optional"},"next":{"title":"mellea.formatters.granite.base.util","permalink":"/0.7.0/api/mellea/formatters/granite/base/util"}}');var l=t(74848),i=t(28453);const o={title:"mellea.formatters.granite.base.types",sidebar_label:"mellea.formatters.granite.base.types",description:"Common Pydantic types shared across the Granite formatter package."},r=void 0,a={},c=[{value:"Classes",id:"classes",level:2},{value:'<span class="ml-2 inline-flex items-center rounded-full px-2 py-1 text-[0.7rem] font-bold tracking-wide bg-[#4ADE8033]/20 text-[#15803D]">CLASS</span> <code>NoDefaultsMixin</code> <sup><a><Icon></Icon></a></sup>',id:"class-nodefaultsmixin",level:3},{value:'<span class="ml-2 inline-flex items-center rounded-full px-2 py-1 text-[0.7rem] font-bold tracking-wide bg-[#4ADE8033]/20 text-[#15803D]">CLASS</span> <code>UserMessage</code> <sup><a><Icon></Icon></a></sup>',id:"class-usermessage",level:3},{value:'<span class="ml-2 inline-flex items-center rounded-full px-2 py-1 text-[0.7rem] font-bold tracking-wide bg-[#4ADE8033]/20 text-[#15803D]">CLASS</span> <code>DocumentMessage</code> <sup><a><Icon></Icon></a></sup>',id:"class-documentmessage",level:3},{value:'<span class="ml-2 inline-flex items-center rounded-full px-2 py-1 text-[0.7rem] font-bold tracking-wide bg-[#4ADE8033]/20 text-[#15803D]">CLASS</span> <code>ToolCall</code> <sup><a><Icon></Icon></a></sup>',id:"class-toolcall",level:3},{value:'<span class="ml-2 inline-flex items-center rounded-full px-2 py-1 text-[0.7rem] font-bold tracking-wide bg-[#4ADE8033]/20 text-[#15803D]">CLASS</span> <code>AssistantMessage</code> <sup><a><Icon></Icon></a></sup>',id:"class-assistantmessage",level:3},{value:'<span class="ml-2 inline-flex items-center rounded-full px-2 py-1 text-[0.7rem] font-bold tracking-wide bg-[#4ADE8033]/20 text-[#15803D]">CLASS</span> <code>ToolResultMessage</code> <sup><a><Icon></Icon></a></sup>',id:"class-toolresultmessage",level:3},{value:'<span class="ml-2 inline-flex items-center rounded-full px-2 py-1 text-[0.7rem] font-bold tracking-wide bg-[#4ADE8033]/20 text-[#15803D]">CLASS</span> <code>SystemMessage</code> <sup><a><Icon></Icon></a></sup>',id:"class-systemmessage",level:3},{value:'<span class="ml-2 inline-flex items-center rounded-full px-2 py-1 text-[0.7rem] font-bold tracking-wide bg-[#4ADE8033]/20 text-[#15803D]">CLASS</span> <code>DeveloperMessage</code> <sup><a><Icon></Icon></a></sup>',id:"class-developermessage",level:3},{value:'<span class="ml-2 inline-flex items-center rounded-full px-2 py-1 text-[0.7rem] font-bold tracking-wide bg-[#4ADE8033]/20 text-[#15803D]">CLASS</span> <code>ToolDefinition</code> <sup><a><Icon></Icon></a></sup>',id:"class-tooldefinition",level:3},{value:'<span class="ml-2 inline-flex items-center rounded-full px-2 py-1 text-[0.7rem] font-bold tracking-wide bg-[#4ADE8033]/20 text-[#15803D]">CLASS</span> <code>Document</code> <sup><a><Icon></Icon></a></sup>',id:"class-document",level:3},{value:'<span class="ml-2 inline-flex items-center rounded-full px-2 py-1 text-[0.7rem] font-bold tracking-wide bg-[#4ADE8033]/20 text-[#15803D]">CLASS</span> <code>ChatTemplateKwargs</code> <sup><a><Icon></Icon></a></sup>',id:"class-chattemplatekwargs",level:3},{value:'<span class="ml-2 inline-flex items-center rounded-full px-2 py-1 text-[0.7rem] font-bold tracking-wide bg-[#4ADE8033]/20 text-[#15803D]">CLASS</span> <code>VLLMExtraBody</code> <sup><a><Icon></Icon></a></sup>',id:"class-vllmextrabody",level:3},{value:'<span class="ml-2 inline-flex items-center rounded-full px-2 py-1 text-[0.7rem] font-bold tracking-wide bg-[#4ADE8033]/20 text-[#15803D]">CLASS</span> <code>ChatCompletion</code> <sup><a><Icon></Icon></a></sup>',id:"class-chatcompletion",level:3},{value:'<span class="ml-2 inline-flex items-center rounded-full px-2 py-1 text-[0.7rem] font-bold tracking-wide bg-[#4ADE8033]/20 text-[#15803D]">CLASS</span> <code>GraniteChatCompletion</code> <sup><a><Icon></Icon></a></sup>',id:"class-granitechatcompletion",level:3},{value:'<span class="ml-2 inline-flex items-center rounded-full px-2 py-1 text-[0.7rem] font-bold tracking-wide bg-[#4ADE8033]/20 text-[#15803D]">CLASS</span> <code>Logprob</code> <sup><a><Icon></Icon></a></sup>',id:"class-logprob",level:3},{value:'<span class="ml-2 inline-flex items-center rounded-full px-2 py-1 text-[0.7rem] font-bold tracking-wide bg-[#4ADE8033]/20 text-[#15803D]">CLASS</span> <code>ChatCompletionLogProb</code> <sup><a><Icon></Icon></a></sup>',id:"class-chatcompletionlogprob",level:3},{value:'<span class="ml-2 inline-flex items-center rounded-full px-2 py-1 text-[0.7rem] font-bold tracking-wide bg-[#4ADE8033]/20 text-[#15803D]">CLASS</span> <code>ChatCompletionLogProbsContent</code> <sup><a><Icon></Icon></a></sup>',id:"class-chatcompletionlogprobscontent",level:3},{value:'<span class="ml-2 inline-flex items-center rounded-full px-2 py-1 text-[0.7rem] font-bold tracking-wide bg-[#4ADE8033]/20 text-[#15803D]">CLASS</span> <code>ChatCompletionLogProbs</code> <sup><a><Icon></Icon></a></sup>',id:"class-chatcompletionlogprobs",level:3},{value:'<span class="ml-2 inline-flex items-center rounded-full px-2 py-1 text-[0.7rem] font-bold tracking-wide bg-[#4ADE8033]/20 text-[#15803D]">CLASS</span> <code>ChatCompletionResponseChoice</code> <sup><a><Icon></Icon></a></sup>',id:"class-chatcompletionresponsechoice",level:3},{value:'<span class="ml-2 inline-flex items-center rounded-full px-2 py-1 text-[0.7rem] font-bold tracking-wide bg-[#4ADE8033]/20 text-[#15803D]">CLASS</span> <code>ChatCompletionResponse</code> <sup><a><Icon></Icon></a></sup>',id:"class-chatcompletionresponse",level:3}];function d(e){const n={a:"a",code:"code",h2:"h2",h3:"h3",li:"li",p:"p",strong:"strong",ul:"ul",...(0,i.R)(),...e.components},{Icon:t}=n;return t||function(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Icon",!0),(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(n.p,{children:"Common Pydantic types shared across the Granite formatter package."}),"\n",(0,l.jsxs)(n.p,{children:["Defines reusable Pydantic models and mixins, including ",(0,l.jsx)(n.code,{children:"NoDefaultsMixin"})," (which\nsuppresses unset default fields from serialized JSON output) and message/request\ntypes for Granite model chat completions (",(0,l.jsx)(n.a,{href:"../../../serve/models#class-chatmessage",children:(0,l.jsx)(n.code,{children:"ChatMessage"})}),", ",(0,l.jsx)(n.code,{children:"ChatCompletion"}),",\n",(0,l.jsx)(n.code,{children:"VLLMExtraBody"}),", ",(0,l.jsx)(n.code,{children:"ChatCompletionLogProbs"}
1),", and related classes). These types are\nconsumed internally by the Granite intrinsic formatters."]}),"\n",(0,l.jsx)(n.h2,{id:"classes",children:"Classes"}),"\n",(0,l.jsx)("div",{className:"w-full h-px bg-gray-200 dark:bg-gray-700 my-4"}),"\n",(0,l.jsxs)(n.h3,{id:"class-nodefaultsmixin",children:[(0,l.jsx)("span",{className:"ml-2 inline-flex items-center rounded-full px-2 py-1 text-[0.7rem] font-bold tracking-wide bg-[#4ADE8033]/20 text-[#15803D]",children:"CLASS"})," ",(0,l.jsx)(n.code,{children:"NoDefaultsMixin"})," ",(0,l.jsx)("sup",{children:(0,l.jsx)("a",{href:"https://github.com/generative-computing/mellea/blob/v0.7.0/mellea/formatters/granite/base/types.py#L21",target:"_blank",children:(0,l.jsx)(t,{icon:"github",style:"width: 0.85em; height: 0.85em;"})})})]}),"\n",(0,l.jsx)(n.p,{children:"Avoid filling JSON with default values."}),"\n",(0,l.jsx)(n.p,{children:"Mixin so that we don't need to copy and paste the code to avoid filling JSON values\nwith a full catalog of the default values of rarely-used fields."}),"\n",(0,l.jsx)("div",{className:"w-full h-px bg-gray-200 dark:bg-gray-700 my-4"}),"\n",(0,l.jsxs)(n.h3,{id:"class-usermessage",children:[(0,l.jsx)("span",{className:"ml-2 inline-flex items-center rounded-full px-2 py-1 text-[0.7rem] font-bold tracking-wide bg-[#4ADE8033]/20 text-[#15803D]",children:"CLASS"})," ",(0,l.jsx)(n.code,{children:"UserMessage"})," ",(0,l.jsx)("sup",{children:(0,l.jsx)("a",{href:"https://github.com/generative-computing/mellea/blob/v0.7.0/mellea/formatters/granite/base/types.py#L129",target:"_blank",children:(0,l.jsx)(t,{icon:"github",style:"width: 0.85em; height: 0.85em;"})})})]}),"\n",(0,l.jsx)(n.p,{children:"User message for an IBM Granite model chat completion request."}),"\n",(0,l.jsx)(n.p,{children:(0,l.jsx)(n.strong,{children:"Attributes:"})}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"role"}),": Always ",(0,l.jsx)(n.code,{children:'"user"'}),", identifying the message sender."]}),"\n"]}),"\n",(0,l.jsx)("div",{className:"w-full h-px bg-gray-200 dark:bg-gray-700 my-4"}),"\n",(0,l.jsxs)(n.h3,{id:"class-documentmessage",children:[(0,l.jsx)("span",{className:"ml-2 inline-flex items-center rounded-full px-2 py-1 text-[0.7rem] font-bold tracking-wide bg-[#4ADE8033]/20 text-[#15803D]",children:"CLASS"})," ",(0,l.jsx)(n.code,{children:"DocumentMessage"})," ",(0,l.jsx)("sup",{children:(0,l.jsx)("a",{href:"https://github.com/generative-computing/mellea/blob/v0.7.0/mellea/formatters/granite/base/types.py#L139",target:"_blank",children:(0,l.jsx)(t,{icon:"github",style:"width: 0.85em; height: 0.85em;"})})})]}),"\n",(0,l.jsx)(n.p,{children:"Document message for Granite model chat completion."}),"\n",(0,l.jsx)(n.p,{children:"Document message for an IBM Granite model (from the Ollama library) chat\ncompletion request."}),"\n",(0,l.jsx)(n.p,{children:(0,l.jsx)(n.strong,{children:"Attributes:"})}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"role"}),": A string matching the pattern ",(0,l.jsx)(n.code,{children:'"document <name>"'}),",\nidentifying this message as a document fragment."]}),"\n"]}),"\n",(0,l.jsx)("div",{className:"w-full h-px bg-gray-200 dark:bg-gray-700 my-4"}),"\n",(0,l.jsxs)(n.h3,{id:"class-toolcall",children:[(0,l.jsx)("span",{className:"ml-2 inline-flex items-center rounded-full px-2 py-1 text-[0.7rem] font-bold tracking-wide bg-[#4ADE8033]/20 text-[#15803D]",children:"CLASS"})," ",(0,l.jsx)(n.code,{children:"ToolCall"})," ",(0,l.jsx)("sup",{children:(0,l.jsx)("a",{href:"https://github.com/generative-computing/mellea/blob/v0.7.0/mellea/formatters/granite/base/types.py#L153",target:"_blank",children:(0,l.jsx)(t,{icon:"github",style:"width: 0.85em; height: 0.85em;"})})})]}),"\n",(0,l.jsx)(n.p,{children:"Represents a single tool-call entry produced by an assistant message."}),"\n",(0,l.jsx)(n.p,{children:"Captures the identifier, name, and arguments of a tool invocation returned\nby the model during a chat completion response."}),"\n",(0,l.jsx)(n.p,{children:(0,l.jsx)(n.strong,{children:"Attributes:"})}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"id"}),": An optional unique identifier for this tool call,\nused to correlate calls with their results."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"name"}),": The name of the tool to invoke."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"arguments"}),": A mapping of argument names to\nvalues, conforming to the parameter schema of the associated tool\ndefinition."]}),"\n"]}),"\n",(0,l.jsx)("div",{className:"w-full h-px bg-gray-200 dark:bg-gray-700 my-4"}),"\n",(0,l.jsxs)(n.h3,{id:"class-assistantmessage",children:[(0,l.jsx)("span",{className:"ml-2 inline-flex items-center rounded-full px-2 py-1 text-[0.7rem] font-bold tracking-wide bg-[#4ADE8033]/20 text-[#15803D]",children:"CLASS"})," ",(0,l.jsx)(n.code,{children:"AssistantMessage"})," ",(0,l.jsx)("sup",{children:(0,l.jsx)("a",{href:"https://github.com/generative-computing/mellea/blob/v0.7.0/mellea/formatters/granite/base/types.py#L176",target:"_blank",children:(0,l.jsx)(t,{icon:"github",style:"width: 0.85em; height: 0.85em;"})})})]}),"\n",(0,l.jsx)(n.p,{children:"Assistant message for chat completion."}),"\n",(0,l.jsx)(n.p,{children:"Lowest-common-denominator assistant message for an IBM Granite model chat\ncompletion request."}),"\n",(0,l.jsx)(n.p,{children:(0,l.jsx)(n.strong,{children:"Attributes:"})}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"role"}),": Always ",(0,l.jsx)(n.code,{children:'"assistant"'}),", identifying the message sender."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"tool_calls"}),": Optional list of tool calls\nrequested by the assistant during this turn."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"reasoning_content"}),": Optional chain-of-thought or reasoning\ntext produced by the model before the final response."]}),"\n"]}),"\n",(0,l.jsx)("div",{className:"w-full h-px bg-gray-200 dark:bg-gray-700 my-4"}),"\n",(0,l.jsxs)(n.h3,{id:"class-toolresultmessage",children:[(0,l.jsx)("span",{className:"ml-2 inline-flex items-center rounded-full px-2 py-1 text-[0.7rem] font-bold tracking-wide bg-[#4ADE8033]/20 text-[#15803D]",children:"CLASS"})," ",(0,l.jsx)(n.code,{children:"ToolResultMessage"})," ",(0,l.jsx)("sup",{children:(0,l.jsx)("a",{href:"https://github.com/generative-computing/mellea/blob/v0.7.0/mellea/formatters/granite/base/types.py#L195",target:"_blank",children:(0,l.jsx)(t,{icon:"github",style:"width: 0.85em; height: 0.85em;"})})})]}),"\n",(0,l.jsx)(n.p,{children:"Tool result message from chat completion."}),"\n",(0,l.jsx)(n.p,{children:"Message containing the result of a tool call in an IBM Granite model chat completion\nrequest."}),"\n",(0,l.jsx)(n.p,{children:(0,l.jsx)(n.strong,{children:"Attributes:"})}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"role"}),": Always ",(0,l.jsx)(n.code,{children:'"tool"'}),", identifying this as a tool-result message."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"tool_call_id"}),": The identifier of the tool call this message responds to."]}),"\n"]}),"\n",(0,l.jsx)("div",{className:"w-full h-px bg-gray-200 dark:bg-gray-700 my-4"}),"\n",(0,l.jsxs)(n.h3,{id:"class-systemmessage",children:[(0,l.jsx)("span",{className:"ml-2 inline-flex items-center rounded-full px-2 py-1 text-[0.7rem] font-bold tracking-wide bg-[#4ADE8033]/20 text-[#15803D]",children:"CLASS"})," ",(0,l.jsx)(n.code,{children:"SystemMessage"})," ",(0,l.jsx)("sup",{children:(0,l.jsx)("a",{href:"https://github.com/generative-computing/mellea/blob/v0.7.0/mellea/formatters/granite/base/types.py#L210",target:"_blank",children:(0,l.jsx)(t,{icon:"github",style:"width: 0.85em; height: 0.85em;"})})})]}),"\n",(0,l.jsx)(n.p,{children:"System message for an IBM Granite model chat completion request."}),"\n",(0,l.jsx)(n.p,{children:(0,l.jsx)(n.strong,{children:"Attributes:"})}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"role"}),": Always ",(0,l.jsx)(n.code,{children:'"system"'}),", identifying this as a system-level instruction."]}),"\n"]}),"\n",(0,l.jsx)("div",{className:"w-full h-px bg-gray-200 dark:bg-gray-700 my-4"}),"\n",(0,l.jsxs)(n.h3,{id:"class-developermessage",children:[(0,l.jsx)("span",{className:"ml-2 inline-flex items-center rounded-full px-2 py-1 text-[0.7rem] font-bold tracking-wide bg-[#4ADE8033]/20 text-[#15803D]",children:"CLASS"})," ",(0,l.jsx)(n.code,{children:"DeveloperMessage"})," ",(0,l.jsx)("sup",{children:(0,l.jsx)("a",{href:"https://github.com/generative-computing/mellea/blob/v0.7.0/mellea/formatters/granite/base/types.py#L220",target:"_blank",children:(0,l.jsx)(t,{icon:"github",style:"width: 0.85em; height: 0.85em;"})})})]}),"\n",(0,l.jsx)(n.p,{children:"Developer system message for a chat completion request."}),"\n",(0,l.jsx)(n.p,{children:(0,l.jsx)(n.strong,{children:"Attributes:"})}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"role"}),": Always ",(0,l.jsx)(n.code,{children:'"developer"'}),", identifying this as a developer-role message."]}),"\n"]}),"\n",(0,l.jsx)("div",{className:"w-full h-px bg-gray-200 dark:bg-gray-700 my-4"}),"\n",(0,l.jsxs)(n.h3,{id:"class-tooldefinition",children:[(0,l.jsx)("span",{className:"ml-2 inline-flex items-center rounded-full px-2 py-1 text-[0.7rem] font-bold tracking-wide bg-[#4ADE8033]/20 text-[#15803D]",children:"CLASS"})," ",(0,l.jsx)(n.code,{children:"ToolDefinition"})," ",(0,l.jsx)("sup",{children:(0,l.jsx)("a",{href:"https://github.com/generative-computing/mellea/blob/v0.7.0/mellea/formatters/granite/base/types.py#L242",target:"_blank",children:(0,l.jsx)(t,{icon:"github",style:"width: 0.85em; height: 0.85em;"})})})]}),"\n",(0,l.jsxs)(n.p,{children:["An entry in the ",(0,l.jsx)(n.code,{children:"tools"})," list in an IBM Granite model chat completion request."]}),"\n",(0,l.jsx)(n.p,{children:(0,l.jsx)(n.strong,{children:"Attributes:"})}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"name"}),": The name used to identify and invoke the tool."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"description"}),": An optional human-readable description of\nwhat the tool does."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"parameters"}),": An optional JSON Schema object\ndescribing the tool's input parameters."]}),"\n"]}),"\n",(0,l.jsx)("div",{className:"w-full h-px bg-gray-200 dark:bg-gray-700 my-4"}),"\n",(0,l.jsxs)(n.h3,{id:"class-document",children:[(0,l.jsx)("span",{className:"ml-2 inline-flex items-center rounded-full px-2 py-1 text-[0.7rem] font-bold tracking-wide bg-[#4ADE8033]/20 text-[#15803D]",children:"CLASS"})," ",(0,l.jsx)(n.code,{children:"Document"})," ",(0,l.jsx)("sup",{children:(0,l.jsx)("a",{href:"https://github.com/generative-computing/mellea/blob/v0.7.0/mellea/formatters/granite/base/types.py#L261",target:"_blank",children:(0,l.jsx)(t,{icon:"github",style:"width: 0.85em; height: 0.85em;"})})})]}),"\n",(0,l.jsx)(n.p,{children:"RAG document for retrieval."}),"\n",(0,l.jsx)(n.p,{children:"RAG documents, which in practice are usually snippets drawn from larger\ndocuments."}),"\n",(0,l.jsx)(n.p,{children:(0,l.jsx)(n.strong,{children:"Attributes:"})}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"text"}),": The textual content of the document snippet."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"title"}),": An optional title for the document."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"doc_id"}),": An optional string identifier for the document,\nrequired by some backends such as vLLM."]}),"\n"]}),"\n",(0,l.jsx)("div",{className:"w-full h-px bg-gray-200 dark:bg-gray-700 my-4"}),"\n",(0,l.jsxs)(n.h3,{id:"class-chattemplatekwargs",children:[(0,l.jsx)("span",{className:"ml-2 inline-flex items-center rounded-full px-2 py-1 text-[0.7rem] font-bold tracking-wide bg-[#4ADE8033]/20 text-[#15803D]",children:"CLASS"})," ",(0,l.jsx)(n.code,{children:"ChatTemplateKwargs"})," ",(0,l.jsx)("sup",{children:(0,l.jsx)("a",{href:"https://github.com/generative-computing/mellea/blob/v0.7.0/mellea/formatters/granite/base/types.py#L281",target:"_blank",children:(0,l.jsx)(t,{icon:"github",style:"width: 0.85em; height: 0.85em;"})})})]}),"\n",(0,l.jsx)(n.p,{children:"Keyword arguments for chat template."}),"\n",(0,l.jsxs)(n.p,{children:["Values that can appear in the ",(0,l.jsx)(n.code,{children:"chat_template_kwargs"})," portion of a valid chat\ncompletion request for a Granite model."]}),"\n",(0,l.jsx)(n.p,{children:(0,l.jsx)(n.strong,{children:"Attributes:"})}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"model_config"}),": Pydantic model configuration allowing\narbitrary types and extra fields to be passed through to\nmodel-specific I/O processors."]}),"\n"]}),"\n",(0,l.jsx)("div",{className:"w-full h-px bg-gray-200 dark:bg-gray-700 my-4"}),"\n",(0,l.jsxs)(n.h3,{id:"class-vllmextrabody",children:[(0,l.jsx)("span",{className:"ml-2 inline-flex items-center rounded-full px-2 py-1 text-[0.7rem] font-bold tracking-wide bg-[#4ADE8033]/20 text-[#15803D]",children:"CLASS"})," ",(0,l.jsx)(n.code,{children:"VLLMExtraBody"})," ",(0,l.jsx)("sup",{children:(0,l.jsx)("a",{href:"https://github.com/generative-computing/mellea/blob/v0.7.0/mellea/formatters/granite/base/types.py#L301",target:"_blank",children:(0,l.jsx)(t,{icon:"github",style:"width: 0.85em; height: 0.85em;"})})})]}),"\n",(0,l.jsx)(n.p,{children:"Extra body parameters for vLLM API."}),"\n",(0,l.jsxs)(n.p,{children:["Elements of ",(0,l.jsx)(n.code,{children:"vllm.entrypoints.open
1ai.protocol.ChatCompletionRequest"}),' that\nare not part of OpenAI\'s protocol and need to be stuffed into the\n"extra_body" parameter of a chat completion request.']}),"\n",(0,l.jsx)(n.p,{children:(0,l.jsx)(n.strong,{children:"Attributes:"})}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"documents"}),": RAG documents made accessible to\nthe model during generation, if the template supports RAG."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"add_generation_prompt"}),": When ",(0,l.jsx)(n.code,{children:"True"}),", the generation prompt is\nappended to the rendered chat template. Defaults to ",(0,l.jsx)(n.code,{children:"True"}),"."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"chat_template_kwargs"}),": Additional keyword\narguments forwarded to the chat template renderer."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"structured_outputs"}),": Optional JSON schema that constrains\nthe model's output format."]}),"\n"]}),"\n",(0,l.jsx)("div",{className:"w-full h-px bg-gray-200 dark:bg-gray-700 my-4"}),"\n",(0,l.jsxs)(n.h3,{id:"class-chatcompletion",children:[(0,l.jsx)("span",{className:"ml-2 inline-flex items-center rounded-full px-2 py-1 text-[0.7rem] font-bold tracking-wide bg-[#4ADE8033]/20 text-[#15803D]",children:"CLASS"})," ",(0,l.jsx)(n.code,{children:"ChatCompletion"})," ",(0,l.jsx)("sup",{children:(0,l.jsx)("a",{href:"https://github.com/generative-computing/mellea/blob/v0.7.0/mellea/formatters/granite/base/types.py#L367",target:"_blank",children:(0,l.jsx)(t,{icon:"github",style:"width: 0.85em; height: 0.85em;"})})})]}),"\n",(0,l.jsx)(n.p,{children:"Chat completion request schema."}),"\n",(0,l.jsx)(n.p,{children:"Subset of the schema of a chat completion request in vLLM's OpenAI-compatible\ninference API that is exercised by Granite models."}),"\n",(0,l.jsxs)(n.p,{children:["See the class ",(0,l.jsx)(n.code,{children:"vllm.entrypoints.openai.protocol.ChatCompletionRequest"})," for\nmore information."]}),"\n",(0,l.jsx)(n.p,{children:(0,l.jsx)(n.strong,{children:"Attributes:"})}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"messages"}),": The ordered list of chat messages forming\nthe conversation history."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"model"}),": An optional model identifier specifying which model\nto use for the completion."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"tools"}),": An optional list of tool\ndefinitions made available to the model during generation."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"extra_body"}),": Optional vLLM-specific parameters\nnot covered by the OpenAI protocol, such as documents and\nchat-template kwargs."]}),"\n"]}),"\n",(0,l.jsx)("div",{className:"w-full h-px bg-gray-200 dark:bg-gray-700 my-4"}),"\n",(0,l.jsxs)(n.h3,{id:"class-granitechatcompletion",children:[(0,l.jsx)("span",{className:"ml-2 inline-flex items-center rounded-full px-2 py-1 text-[0.7rem] font-bold tracking-wide bg-[#4ADE8033]/20 text-[#15803D]",children:"CLASS"})," ",(0,l.jsx)(n.code,{children:"GraniteChatCompletion"})," ",(0,l.jsx)("sup",{children:(0,l.jsx)("a",{href:"https://github.com/generative-computing/mellea/blob/v0.7.0/mellea/formatters/granite/base/types.py#L423",target:"_blank",children:(0,l.jsx)(t,{icon:"github",style:"width: 0.85em; height: 0.85em;"})})})]}),"\n",(0,l.jsx)(n.p,{children:"Granite chat completion request."}),"\n",(0,l.jsx)(n.p,{children:"Lowest-common-denominator inputs to a chat completion request for an IBM Granite\nmodel."}),"\n",(0,l.jsx)("div",{className:"w-full h-px bg-gray-200 dark:bg-gray-700 my-4"}),"\n",(0,l.jsxs)(n.h3,{id:"class-logprob",children:[(0,l.jsx)("span",{className:"ml-2 inline-flex items-center rounded-full px-2 py-1 text-[0.7rem] font-bold tracking-wide bg-[#4ADE8033]/20 text-[#15803D]",children:"CLASS"})," ",(0,l.jsx)(n.code,{children:"Logprob"})," ",(0,l.jsx)("sup",{children:(0,l.jsx)("a",{href:"https://github.com/generative-computing/mellea/blob/v0.7.0/mellea/formatters/granite/base/types.py#L493",target:"_blank",children:(0,l.jsx)(t,{icon:"github",style:"width: 0.85em; height: 0.85em;"})})})]}),"\n",(0,l.jsx)(n.p,{children:"Prompt log-probability from vLLM API."}),"\n",(0,l.jsxs)(n.p,{children:["Subset of the vLLM API passing ",(0,l.jsx)(n.strong,{children:"prompt"})," log-probabilities back from vLLM's\nOpenAI-compatible server."]}),"\n",(0,l.jsx)(n.p,{children:"Note that this is different from the API for token logprobs."}),"\n",(0,l.jsxs)(n.p,{children:["See the class ",(0,l.jsx)(n.code,{children:"vllm.entrypoints.open
1ai.protocol.Logprob"})," for\nmore information."]}),"\n",(0,l.jsx)(n.p,{children:(0,l.jsx)(n.strong,{children:"Attributes:"})}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"logprob"}),": The log-probability value for this token."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"rank"}),": The rank of this token among the top candidates,\nif available."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"decoded_token"}),": The decoded string representation of the\ntoken, if available."]}),"\n"]}),"\n",(0,l.jsx)("div",{className:"w-full h-px bg-gray-200 dark:bg-gray-700 my-4"}),"\n",(0,l.jsxs)(n.h3,{id:"class-chatcompletionlogprob",children:[(0,l.jsx)("span",{className:"ml-2 inline-flex items-center rounded-full px-2 py-1 text-[0.7rem] font-bold tracking-wide bg-[#4ADE8033]/20 text-[#15803D]",children:"CLASS"})," ",(0,l.jsx)(n.code,{children:"ChatCompletionLogProb"})," ",(0,l.jsx)("sup",{children:(0,l.jsx)("a",{href:"https://github.com/generative-computing/mellea/blob/v0.7.0/mellea/formatters/granite/base/types.py#L517",target:"_blank",children:(0,l.jsx)(t,{icon:"github",style:"width: 0.85em; height: 0.85em;"})})})]}),"\n",(0,l.jsx)(n.p,{children:"Token log-probability from vLLM API."}),"\n",(0,l.jsxs)(n.p,{children:["Subset of the vLLM API passing ",(0,l.jsx)(n.strong,{children:"token"})," log-probabilities back from vLLM's\nOpenAI-compatible server."]}),"\n",(0,l.jsx)(n.p,{children:"Note that this is different from the API for prompt logprobs."}),"\n",(0,l.jsxs)(n.p,{children:["See the class ",(0,l.jsx)(n.code,{children:"vllm.entrypoints.openai.protocol.ChatCompletionLogProb"})," for\nmore information."]}),"\n",(0,l.jsx)(n.p,{children:(0,l.jsx)(n.strong,{children:"Attributes:"})}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"token"}),": The decoded token string."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"logprob"}),": The log-probability of the token. Defaults to\n",(0,l.jsx)(n.code,{children:"-9999.0"})," when not returned by the server."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"bytes"}),": The UTF-8 byte values of the token,\nif provided by the server."]}),"\n"]}),"\n",(0,l.jsx)("div",{className:"w-full h-px bg-gray-200 dark:bg-gray-700 my-4"}),"\n",(0,l.jsxs)(n.h3,{id:"class-chatcompletionlogprobscontent",children:[(0,l.jsx)("span",{className:"ml-2 inline-flex items-center rounded-full px-2 py-1 text-[0.7rem] font-bold tracking-wide bg-[#4ADE8033]/20 text-[#15803D]",children:"CLASS"})," ",(0,l.jsx)(n.code,{children:"ChatCompletionLogProbsContent"})," ",(0,l.jsx)("sup",{children:(0,l.jsx)("a",{href:"https://github.com/generative-computing/mellea/blob/v0.7.0/mellea/formatters/granite/base/types.py#L541",target:"_blank",children:(0,l.jsx)(t,{icon:"github",style:"width: 0.85em; height: 0.85em;"})})})]}),"\n",(0,l.jsx)(n.p,{children:"Token log-probabilities content from vLLM API."}),"\n",(0,l.jsx)(n.p,{children:"Subset of the vLLM API passing token log-probabilities back from vLLM's\nOpenAI-compatible server."}),"\n",(0,l.jsxs)(n.p,{children:["See the class ",(0,l.jsx)(n.code,{children:"vllm.entrypoints.openai.protocol.ChatCompletionLogProbsContent"})," for\nmore information."]}),"\n",(0,l.jsx)(n.p,{children:(0,l.jsx)(n.strong,{children:"Attributes:"})}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"top_logprobs"}),": The list of top-k\ncandidate tokens and their log-probabilities at this position."]}),"\n"]}),"\n",(0,l.jsx)("div",{className:"w-full h-px bg-gray-200 dark:bg-gray-700 my-4"}),"\n",(0,l.jsxs)(n.h3,{id:"class-chatcompletionlogprobs",children:[(0,l.jsx)("span",{className:"ml-2 inline-flex items-center rounded-full px-2 py-1 text-[0.7rem] font-bold tracking-wide bg-[#4ADE8033]/20 text-[#15803D]",children:"CLASS"})," ",(0,l.jsx)(n.code,{children:"ChatCompletionLogProbs"})," ",(0,l.jsx)("sup",{children:(0,l.jsx)("a",{href:"https://github.com/generative-computing/mellea/blob/v0.7.0/mellea/formatters/granite/base/types.py#L558",target:"_blank",children:(0,l.jsx)(t,{icon:"github",style:"width: 0.85em; height: 0.85em;"})})})]}),"\n",(0,l.jsx)(n.p,{children:"Token logprobs for chat completion choice."}),"\n",(0,l.jsx)(n.p,{children:"Subset of the schema of a token logprobs for a single choice in a chat completion\nresult in vLLM's OpenAI-compatible inference API."}),"\n",(0,l.jsxs)(n.p,{children:["See the class ",(0,l.jsx)(n.code,{children:"vllm.entrypoints.open
1ai.protocol.ChatCompletionLogProbs"})," for\nmore information."]}),"\n",(0,l.jsx)(n.p,{children:(0,l.jsx)(n.strong,{children:"Attributes:"})}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"content"}),": Per-token\nlog-probability entries for each generated token, or ",(0,l.jsx)(n.code,{children:"None"})," if\nlogprobs were not requested."]}),"\n"]}),"\n",(0,l.jsx)("div",{className:"w-full h-px bg-gray-200 dark:bg-gray-700 my-4"}),"\n",(0,l.jsxs)(n.h3,{id:"class-chatcompletionresponsechoice",children:[(0,l.jsx)("span",{className:"ml-2 inline-flex items-center rounded-full px-2 py-1 text-[0.7rem] font-bold tracking-wide bg-[#4ADE8033]/20 text-[#15803D]",children:"CLASS"})," ",(0,l.jsx)(n.code,{children:"ChatCompletionResponseChoice"})," ",(0,l.jsx)("sup",{children:(0,l.jsx)("a",{href:"https://github.com/generative-computing/mellea/blob/v0.7.0/mellea/formatters/granite/base/types.py#L576",target:"_blank",children:(0,l.jsx)(t,{icon:"github",style:"width: 0.85em; height: 0.85em;"})})})]}),"\n",(0,l.jsx)(n.p,{children:"Single choice in chat completion result from vLLM API."}),"\n",(0,l.jsx)(n.p,{children:"Subset of the schema of a single choice in a chat completion result in vLLM's\nOpenAI-compatible inference API that is exercised by Granite intrinsics."}),"\n",(0,l.jsxs)(n.p,{children:["See the class ",(0,l.jsx)(n.code,{children:"vllm.entrypoints.openai.protocol.ChatCompletionResponseChoice"})," for\nmore information."]}),"\n",(0,l.jsx)(n.p,{children:(0,l.jsx)(n.strong,{children:"Attributes:"})}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"index"}),": The zero-based index of this choice in the response."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"message"}),": The generated message for this choice."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"logprobs"}),": Token log-probabilities for\nthis choice, if they were requested."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"finish_reason"}),": The reason the model stopped generating.\nDefaults to ",(0,l.jsx)(n.code,{children:'"stop"'})," per the OpenAI specification."]}),"\n"]}),"\n",(0,l.jsx)("div",{className:"w-full h-px bg-gray-200 dark:bg-gray-700 my-4"}),"\n",(0,l.jsxs)(n.h3,{id:"class-chatcompletionresponse",children:[(0,l.jsx)("span",{className:"ml-2 inline-flex items-center rounded-full px-2 py-1 text-[0.7rem] font-bold tracking-wide bg-[#4ADE8033]/20 text-[#15803D]",children:"CLASS"})," ",(0,l.jsx)(n.code,{children:"ChatCompletionResponse"})," ",(0,l.jsx)("sup",{children:(0,l.jsx)("a",{href:"https://github.com/generative-computing/mellea/blob/v0.7.0/mellea/formatters/granite/base/types.py#L601",target:"_blank",children:(0,l.jsx)(t,{icon:"github",style:"width: 0.85em; height: 0.85em;"})})})]}),"\n",(0,l.jsx)(n.p,{children:"Chat completion result from vLLM API."}),"\n",(0,l.jsx)(n.p,{children:"Subset of the schema of a chat completion result in vLLM's OpenAI-compatible\ninference API that is exercised by Granite intrinsics."}),"\n",(0,l.jsxs)(n.p,{children:["See the class ",(0,l.jsx)(n.code,{children:"vllm.entrypoints.openai.protocol.ChatCompletionResponse"})," for\nmore information."]}),"\n",(0,l.jsx)(n.p,{children:(0,l.jsx)(n.strong,{children:"Attributes:"})}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"choices"}),": The list of generated\nresponse choices returned by the model."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"prompt_logprobs"}),": Per-token\nprompt log-probabilities returned by vLLM, if requested. This\nfield is not part of the OpenAI specification."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"model_config"}),": Pydantic configuration allowing extra fields\nto be passed through when transforming data."]}),"\n"]}),"\n",(0,l.jsx)("div",{className:"w-full h-px bg-gray-200 dark:bg-gray-700 my-4"})]})}function h(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,l.jsx)(n,{...e,children:(0,l.jsx)(d,{...e})}):d(e)}},28453(e,n,t){t.d(n,{R:()=>o,x:()=>r});var s=t(96540);const l={},i=s.createContext(l);function o(e){const n=s.useContext(i);return s.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function r(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(l):e.components||l:o(e.components),s.createElement(i.Provider,{value:n},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.