Skip to content
Source
Sign inSign up
TanStack/schemas
Open History to see the last commit

nvidia-native-selector-identity.json

17 lines131.3 KB

1{
2 "https://docs.api.nvidia.com/nim/reference/nvidia-nemotron-3-5-content-safety-infer.md": {
3 "url": "https://docs.api.nvidia.com/nim/reference/nvidia-nemotron-3-5-content-safety-infer.md",
4 "status": 200,
5 "body": "---\nupdatedAt: 2026-08-06T10:00:54.000Z\n---\n\n# Request response from the model\n\nInvokes inference using the model chat parameters.\n\n# OpenAPI definition\n\n```json\n{\n \"openapi\": \"3.1.0\",\n \"info\": {\n \"title\": \"NVIDIA NIM API for nvidia/nemotron-3-nano-omni-30b-a3b-reasoning\",\n \"description\": \"The NVIDIA NIM REST API. Please see https://docs.api.nvidia.com/nim/reference/nvidia-nemotron-3-nano-omni-30b-a3b-reasoning for more details.\",\n \"version\": \"1.0.0\",\n \"termsOfService\": \"https://nvidia.com/legal/terms-of-use\",\n \"contact\": {\n \"name\": \"NVIDIA Support\",\n \"url\": \"https://help.nvidia.com/\"\n },\n \"license\": {\n \"name\": \"NVIDIA Open Model License\",\n \"url\": \"https://www.nvidia.com/en-us/agreements/enterprise-software/nvidia-open-model-license/\"\n }\n },\n \"servers\": [\n {\n \"url\": \"https://integrate.api.nvidia.com/v1\"\n }\n ],\n \"tags\": [\n {\n \"name\": \"Multimodal API\",\n \"description\": \"This API performs inference using text, image, video, and audio understanding models\"\n }\n ],\n \"paths\": {\n \"/chat/completions\": {\n \"post\": {\n \"tags\": [\n \"Multimodal API\"\n ],\n \"summary\": \"Request response from the model\",\n \"description\": \"Invokes inference using the model chat parameters.\",\n \"operationId\": \"invokeFunction\",\n \"requestBody\": {\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/NIMLLMChatCompletionRequest\"\n }\n }\n },\n \"required\": true\n },\n \"responses\": {\n \"200\": {\n \"description\": \"Invocation is fulfilled\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/ChatCompletionResponse\"\n }\n },\n \"text/event-stream\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/ChatCompletionStreamResponse\"\n }\n }\n }\n },\n \"202\": {\n \"description\": \"Result is pending. Client should poll using the requestId.\\n\",\n \"content\": {\n \"application/json\": {\n \"example\": {},\n \"schema\": {}\n }\n },\n \"headers\": {\n \"NVCF-REQID\": {\n \"description\": \"requestId required for pooling\",\n \"schema\": {\n \"type\": \"string\",\n \"format\": \"uuid\",\n \"maxLength\": 36\n }\n },\n \"NVCF-STATUS\": {\n \"description\": \"Invocation status\",\n \"schema\": {\n \"type\": \"string\",\n \"format\": \"^[a-zA-Z-]{1,64}$\",\n \"maxLength\": 64\n }\n }\n }\n },\n \"422\": {\n \"description\": \"Validation failed, provided entity could not be processed.\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/ErrorResponse\"\n },\n \"example\": {\n \"type\": \"urn:nvcf-worker-service:problem-details:unprocessable-entity\",\n \"title\": \"Unprocessable Entity\",\n \"status\": 422,\n \"detail\": \"string\",\n \"instance\": \"/v2/nvcf/pexec/functions/e598bfc1-b058-41af-869d-556d3c7e1b48\",\n \"requestId\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\"\n }\n }\n }\n },\n \"500\": {\n \"description\": \"The invocation ended with an error.\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/ErrorResponse\"\n },\n \"example\": {\n \"type\": \"urn:nvcf-worker-service:problem-details:internal-server-error\",\n \"title\": \"Internal Server Error\",\n \"status\": 500,\n \"detail\": \"string\",\n \"instance\": \"/v2/nvcf/pexec/functions/e598bfc1-b058-41af-869d-556d3c7e1b48\",\n \"requestId\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\"\n }\n }\n }\n }\n },\n \"x-nvai-meta\": {\n \"name\": \"Create chat completion\",\n \"returns\": \"Returns a [chat completion](/docs/api-reference/chat/object) object, or a streamed sequence of [chat completion chunk](/docs/api-reference/chat/streaming) objects if the request is streamed.\\n\",\n \"path\": \"create\",\n \"examples\": [\n {\n \"name\": \"dogs.jpeg\",\n \"input\": {\n \"text\": \"What is in this image?\",\n \"images\": [\n \"https://assets.ngc.nvidia.com/products/api-catalog/phi-3-5-vision/example1b.jpg\"\n ]\n },\n \"output\": {\n \"text\": \"The image showcases a serene landscape featuring a wooden boardwalk that cuts through a vast, grassy area. The boardwalk is the central focus, inviting viewers to imagine strolling through this peaceful environment. The grass surrounding the boardwalk is very tall, giving a sense of immersion in nature. In the distance, a variety of trees can be seen, their varied foliage adding complexity to the scene. The sky is predominantly blue, interspersed with wispy clouds that are likely illuminated by the sun, enhancing the tranquil and inviting nature of the scene. The time of day appears to be late afternoon, inferred from the warm colors in the foliage and the gentle, diffuse lighting.\"\n },\n \"requestJson\": \"{ \\\"model\\\": \\\"nvidia/nemotron-3-nano-omni-30b-a3b-reasoning\\\", \\\"messages\\\": [ { \\\"role\\\": \\\"user\\\", \\\"content\\\": [ { \\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"<%- input.text %>\\\" }, { \\\"type\\\": \\\"image_url\\\", \\\"image_url\\\": { \\\"url\\\": \\\"<%- input.images[0] %>\\\" } } ] } ], \\\"max_tokens\\\": 65536, \\\"temperature\\\": 0.6, \\\"top_p\\\": 0.95, \\\"reasoning_budget\\\": 16384, \\\"chat_template_kwargs\\\": { \\\"enable_thinking\\\": true }, \\\"stream\\\": true }\",\n \"responseJson\": \"{ \\\"id\\\": \\\"chatcmpl-abc123\\\", \\\"object\\\": \\\"chat.completion\\\", \\\"created\\\": 1677858242, \\\"model\\\": \\\"nvidia/nemotron-3-nano-omni-30b-a3b-reasoning\\\", \\\"choices\\\": [ { \\\"index\\\": 0, \\\"message\\\": { \\\"role\\\": \\\"assistant\\\", \\\"content\\\": \\\"<%- output.text %>\\\" }, \\\"finish_reason\\\": \\\"stop\\\" } ], \\\"usage\\\": { \\\"prompt_tokens\\\": 256, \\\"completion_tokens\\\": 24, \\\"total_tokens\\\": 280 } }\"\n },\n {\n \"name\": \"video.mp4\",\n \"input\": {\n \"text\": \"Describe what you see in this video.\",\n \"videos\": [\n \"https://assets.ngc.nvidia.com/products/api-catalog/nvidia-nemotron-nano-12b-v2-vl/nvidia-studio-itns-wk53-scene-in-omniverse-1280w.mp4\"\n ]\n },\n \"output\": {\n \"text\": \"The video displays a 3D model of a small, rustic cabin with a thatched roof, situated in a snowy landscape. The cabin is constructed with wooden planks and has a stone chimney. Surrounding the cabin are various objects such as logs, a wooden table, and a barrel. The ground is covered in snow, and there are trees in the background. The color palette is predominantly white and gray, with the brown of the wooden structures providing contrast. The video also shows a user interface with various tools and settings, indicating that the scene is being edited or manipulated in a 3D modeling software.\"\n },\n \"requestJson\": \"{ \\\"model\\\": \\\"nvidia/nemotron-3-nano-omni-30b-a3b-reasoning\\\", \\\"messages\\\": [ { \\\"role\\\": \\\"user\\\", \\\"content\\\": [ { \\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"<%- input.text %>\\\" }, { \\\"type\\\": \\\"video_url\\\", \\\"video_url\\\": { \\\"url\\\": \\\"<%- input.videos[0] %>\\\" } } ] } ], \\\"max_tokens\\\": 65536, \\\"temperature\\\": 0.6, \\\"top_p\\\": 0.95, \\\"reasoning_budget\\\": 16384, \\\"chat_template_kwargs\\\": { \\\"enable_thinking\\\": true }, \\\"stream\\\": true }\",\n \"responseJson\": \"{ \\\"id\\\": \\\"chatcmpl-def456\\\", \\\"object\\\": \\\"chat.completion\\\", \\\"created\\\": 1677858300, \\\"model\\\": \\\"nvidia/nemotron-3-nano-omni-30b-a3b-reasoning\\\", \\\"choices\\\": [ { \\\"index\\\": 0, \\\"message\\\": { \\\"role\\\": \\\"assistant\\\", \\\"content\\\": \\\"<%- output.text %>\\\" }, \\\"finish_reason\\\": \\\"stop\\\" } ], \\\"usage\\\": { \\\"prompt_tokens\\\": 512, \\\"completion_tokens\\\": 48, \\\"total_tokens\\\": 560 } }\"\n },\n {\n \"name\": \"audio.wav\",\n \"input\": {\n \"text\": \"Transcribe the spoken content.\",\n \"audios\": [\n \"https://assets.ngc.nvidia.com/products/api-catalog/nemotron-3-nano-omni-reasoning-30b-a3b/voice-sample.wav\"\n ]\n },\n \"output\": {\n \"text\": \"Hi there, this is a sample voice recording created for speech synthesis testing. The quick brown fox jumps over the lazy dog. Just a fun way to include every letter of the alphabet. Numbers, like 1, 2, 3, are spoken clearly. Let's see how well this voice captures tone, timing, and natural rhythm. This audio is provided by samplefiles.com.\"\n },\n \"requestJson\": \"{ \\\"model\\\": \\\"nvidia/nemotron-3-nano-omni-30b-a3b-reasoning\\\", \\\"messages\\\": [ { \\\"role\\\": \\\"user\\\", \\\"content\\\": [ { \\\"type\\\": \\\"audio_url\\\", \\\"audio_url\\\": { \\\"url\\\": \\\"<%- input.audios[0] %>\\\" } }, { \\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"<%- input.text %>\\\" } ] } ], \\\"max_tokens\\\": 65536, \\\"temperature\\\": 0.6, \\\"top_p\\\": 0.95, \\\"reasoning_budget\\\": 16384, \\\"chat_template_kwargs\\\": { \\\"enable_thinking\\\": true }, \\\"stream\\\": true }\",\n \"responseJson\": \"{ \\\"id\\\": \\\"chatcmpl-ghi789\\\", \\\"object\\\": \\\"chat.completion\\\", \\\"created\\\": 1677858360, \\\"model\\\": \\\"nvidia/nemotron-3-nano-omni-30b-a3b-reasoning\\\", \\\"choices\\\": [ { \\\"index\\\": 0, \\\"message\\\": { \\\"role\\\": \\\"assistant\\\", \\\"content\\\": \\\"<%- output.text %>\\\" }, \\\"finish_reason\\\": \\\"stop\\\" } ], \\\"usage\\\": { \\\"prompt_tokens\\\": 192, \\\"completion_tokens\\\": 16, \\\"total_tokens\\\": 208 } }\"\n }\n ],\n \"templates\": [\n {\n \"title\": \"No Streaming\",\n \"response\": \"{\\n \\\"choices\\\": [{\\n \\\"index\\\": 0,\\n \\\"model\\\": \\\"nvidia/nemotron-3-nano-omni-30b-a3b-reasoning\\\",\\n \\\"message\\\": {\\n \\\"role\\\": \\\"assistant\\\",\\n \\\"content\\\": \\\"...\\\",\\n },\\n \\\"finish_reason\\\": \\\"stop\\\"\\n }],\\n \\\"usage\\\": {\\n \\\"prompt_tokens\\\": 9,\\n \\\"completion_tokens\\\": 12,\\n \\\"total_tokens\\\": 21\\n }\\n}\\n\",\n \"requestEjs\": {\n \"python\": \"<%\\n // Catalog ejs locals replace JSON with {stringify} only (spread skips non-enumerable parse).\\n const deepClone = (value) => {\\n if (Array.isArray(value)) return value.map(deepClone);\\n if (value && typeof value === \\\"object\\\") {\\n const out = {};\\n for (const key of Object.keys(value)) out[key] = deepClone(value[key]);\\n return out;\\n }\\n return value;\\n };\\n const mediaConfig = {\\\"image\\\": {\\\"mimeTypes\\\": {\\\".png\\\": \\\"image/png\\\", \\\".jpg\\\": \\\"image/jpeg\\\", \\\".jpeg\\\": \\\"image/jpeg\\\", \\\".webp\\\": \\\"image/webp\\\"}}, \\\"video\\\": {\\\"mimeTypes\\\": {\\\".mp4\\\": \\\"video/mp4\\\", \\\".mov\\\": \\\"video/quicktime\\\", \\\".webm\\\": \\\"video/webm\\\"}}, \\\"audio\\\": {\\\"mimeTypes\\\": {\\\".wav\\\": \\\"audio/wav\\\", \\\".mp3\\\": \\\"audio/mpeg\\\"}, \\\"defaultFormat\\\": \\\"wav\\\"}};\\n const stripNulls = (value) => {\\n if (Array.isArray(value)) return value.map(stripNulls);\\n if (value && typeof value === \\\"object\\\") {\\n const out = {};\\n for (const [key, item] of Object.entries(value)) {\\n if (item === null || item === undefined) continue;\\n out[key] = stripNulls(item);\\n }\\n return out;\\n }\\n return value;\\n };\\n const payloadForSnippet = stripNulls(deepClone(request || {}));\\n const hasStream = payloadForSnippet.stream !== undefined && payloadForSnippet.stream !== null;\\n const pyStream = payloadForSnippet.stream ? \\\"True\\\" : \\\"False\\\";\\n if (hasStream) payloadForSnippet.stream = \\\"__STREAM__\\\";\\n\\n const hasMediaKind = (kind) => Object.keys(mediaConfig[kind].mimeTypes || {}).length > 0;\\n const isInlineDataUrl = (url, kind) => (\\n typeof url === \\\"string\\\" && new RegExp(`^data:${kind}/[^;]+;base64,`, \\\"i\\\").test(url)\\n );\\n\\n const mediaUrl = (part, key) => {\\n const slot = part?.[key];\\n return typeof slot === \\\"string\\\" ? slot : slot?.url;\\n };\\n const setMediaUrl = (part, key, url) => {\\n if (typeof part[key] === \\\"string\\\") part[key] = url;\\n else {\\n if (!part[key] || typeof part[key] !== \\\"object\\\") part[key] = {};\\n part[key].url = url;\\n }\\n };\\n\\n let imageCount = 0;\\n let videoCount = 0;\\n let audioCount = 0;\\n\\n (payloadForSnippet.messages || []).forEach((message) => {\\n if (!Array.isArray(message?.content)) return;\\n message.content.forEach((part) => {\\n const imageUrl = mediaUrl(part, \\\"image_url\\\");\\n const videoUrl = mediaUrl(part, \\\"video_url\\\");\\n const audioUrl = mediaUrl(part, \\\"audio_url\\\");\\n // File helpers only for inline base64; http(s) URLs stay as-is in the payload.\\n if (hasMediaKind(\\\"image\\\") && part?.type === \\\"image_url\\\" && isInlineDataUrl(imageUrl, \\\"image\\\")) {\\n setMediaUrl(part, \\\"image_url\\\", `__IMAGE_DATA_URL_${imageCount}__`);\\n imageCount += 1;\\n } else if (hasMediaKind(\\\"video\\\") && part?.type === \\\"video_url\\\" && isInlineDataUrl(videoUrl, \\\"video\\\")) {\\n setMediaUrl(part, \\\"video_url\\\", `__VIDEO_DATA_URL_${videoCount}__`);\\n videoCount += 1;\\n } else if (hasMediaKind(\\\"audio\\\") && part?.type === \\\"audio_url\\\" && isInlineDataUrl(audioUrl, \\\"audio\\\")) {\\n setMediaUrl(part, \\\"audio_url\\\", `__AUDIO_DATA_URL_${audioCount}__`);\\n audioCount += 1;\\n } else if (hasMediaKind(\\\"audio\\\") && part?.type === \\\"input_audio\\\" && part.input_audio?.data) {\\n part.input_audio.data = `__AUDIO_B64_${audioCount}__`;\\n part.input_audio.format = part.input_audio.format || mediaConfig.audio.defaultFormat;\\n audioCount += 1;\\n }\\n });\\n });\\n\\n const pyRepr = (value, level = 0) => {\\n if (value === null) return \\\"None\\\";\\n if (typeof value === \\\"boolean\\\") return value ? \\\"True\\\" : \\\"False\\\";\\n if (typeof value === \\\"number\\\") return String(value);\\n if (typeof value === \\\"string\\\") return JSON.stringify(value);\\n const pad = \\\" \\\".repeat(level);\\n const innerPad = \\\" \\\".repeat(level + 2);\\n if (Array.isArray(value)) {\\n if (value.length === 0) return \\\"[]\\\";\\n return \\\"[\\\\n\\\" + value.map((item) => `${innerPad}${pyRepr(item, level + 2)}`).join(\\\",\\\\n\\\") + \\\"\\\\n\\\" + pad + \\\"]\\\";\\n }\\n if (typeof value === \\\"object\\\") {\\n const entries = Object.entries(value);\\n if (entries.length === 0) return \\\"{}\\\";\\n return \\\"{\\\\n\\\" + entries.map(([key, item]) => `${innerPad}${JSON.stringify(key)}: ${pyRepr(item, level + 2)}`).join(\\\",\\\\n\\\") + \\\"\\\\n\\\" + pad + \\\"}\\\";\\n }\\n return \\\"None\\\";\\n };\\n\\n const replaceAll = (s, a, b) => s.split(a).join(b);\\n let renderedPayload = pyRepr(payloadForSnippet);\\n if (hasStream) renderedPayload = replaceAll(renderedPayload, '\\\"__STREAM__\\\"', \\\"stream\\\");\\n for (let i = 0; i < imageCount; i++) {\\n renderedPayload = replaceAll(renderedPayload, `\\\"__IMAGE_DATA_URL_${i}__\\\"`, `image_data_urls[${i}]`);\\n }\\n for (let i = 0; i < videoCount; i++) {\\n renderedPayload = replaceAll(renderedPayload, `\\\"__VIDEO_DATA_URL_${i}__\\\"`, `video_data_urls[${i}]`);\\n }\\n for (let i = 0; i < audioCount; i++) {\\n renderedPayload = replaceAll(renderedPayload, `\\\"__AUDIO_DATA_URL_${i}__\\\"`, `audio_data_urls[${i}]`);\\n renderedPayload = replaceAll(renderedPayload, `\\\"__AUDIO_B64_${i}__\\\"`, `audio_b64s[${i}]`);\\n }\\n\\n // Either file helpers XOR inline base64 - never emit unused helpers.\\n const usesFileHelpers =\\n imageCount + videoCount + audioCount > 0 &&\\n [...Array(imageCount).keys()].every((i) => renderedPayload.includes(`image_data_urls[${i}]`)) &&\\n [...Array(videoCount).keys()].every((i) => renderedPayload.includes(`video_data_urls[${i}]`)) &&\\n [...Array(audioCount).keys()].every(\\n (i) => renderedPayload.includes(`audio_data_urls[${i}]`) || renderedPayload.includes(`audio_b64s[${i}]`)\\n );\\n if (!usesFileHelpers) {\\n imageCount = 0;\\n videoCount = 0;\\n audioCount = 0;\\n const restored = stripNulls(deepClone(request || {}));\\n const restoredStream = restored.stream !== undefined && restored.stream !== null;\\n if (restoredStream) restored.stream = \\\"__STREAM__\\\";\\n renderedPayload = pyRepr(restored);\\n if (restoredStream) renderedPayload = replaceAll(renderedPayload, '\\\"__STREAM__\\\"', \\\"stream\\\");\\n }\\n const hasMedia = usesFileHelpers;\\n const mimePy = (mimes) =>\\n \\\"{\\\" + Object.entries(mimes).map(([k, v]) => `${JSON.stringify(k)}: ${JSON.stringify(v)}`).join(\\\", \\\") + \\\"}\\\";\\n%>\\n<% if (hasMedia) { %>import base64\\nfrom pathlib import Path\\n<% } %>import requests\\n\\ninvoke_url = \\\"https://integrate.api.nvidia.com/v1/chat/completions\\\"\\nstream = <%- pyStream %>\\n<% if (hasMedia) { %>\\ndef media_data_url(kind, index, mime_types):\\n for suffix, mime in mime_types.items():\\n path = Path(f\\\"{kind}_{index}{suffix}\\\")\\n if path.exists():\\n return f\\\"data:{mime};base64,{base64.b64encode(path.read_bytes()).decode()}\\\"\\n raise FileNotFoundError(f\\\"Expected {kind}_{index} with suffix in {list(mime_types)}\\\")\\n<% if (imageCount > 0) { %>\\nimage_data_urls = [media_data_url(\\\"image\\\", i, <%- mimePy(mediaConfig.image.mimeTypes) %>) for i in <%- imageCount === 1 ? \\\"[1]\\\" : (\\\"range(1, \\\" + (imageCount + 1) + \\\")\\\") %>]\\n<% } %><% if (videoCount > 0) { %>\\nvideo_data_urls = [media_data_url(\\\"video\\\", i, <%- mimePy(mediaConfig.video.mimeTypes) %>) for i in <%- videoCount === 1 ? \\\"[1]\\\" : (\\\"range(1, \\\" + (videoCount + 1) + \\\")\\\") %>]\\n<% } %><% if (audioCount > 0) { %>\\naudio_data_urls = [media_data_url(\\\"audio\\\", i, <%- mimePy(mediaConfig.audio.mimeTypes) %>) for i in <%- audioCount === 1 ? \\\"[1]\\\" : (\\\"range(1, \\\" + (audioCount + 1) + \\\")\\\") %>]\\naudio_b64s = [url.split(\\\",\\\", 1)[1] for url in audio_data_urls]\\n<% } %><% } %>\\nheaders = {\\n \\\"Authorization\\\": \\\"Bearer $NVIDIA_API_KEY\\\",\\n \\\"Accept\\\": \\\"text/event-stream\\\" if stream else \\\"application/json\\\",\\n}\\n\\npayload = <%- renderedPayload %>\\n\\nresponse = requests.post(invoke_url, headers=headers, json=payload, stream=stream)\\nif stream:\\n for line in response.iter_lines():\\n if line:\\n print(line.decode(\\\"utf-8\\\"))\\nelse:\\n print(response.json())\\n\",\n \"langChain\": \"<%\\n const deepClone = (value) => {\\n if (Array.isArray(value)) return value.map(deepClone);\\n if (value && typeof value === \\\"object\\\") {\\n const out = {};\\n for (const key of Object.keys(value)) out[key] = deepClone(value[key]);\\n return out;\\n }\\n return value;\\n };\\n const mediaConfig = {\\\"image\\\": {\\\"mimeTypes\\\": {\\\".png\\\": \\\"image/png\\\", \\\".jpg\\\": \\\"image/jpeg\\\", \\\".jpeg\\\": \\\"image/jpeg\\\", \\\".webp\\\": \\\"image/webp\\\"}}, \\\"video\\\": {\\\"mimeTypes\\\": {\\\".mp4\\\": \\\"video/mp4\\\", \\\".mov\\\": \\\"video/quicktime\\\", \\\".webm\\\": \\\"video/webm\\\"}}, \\\"audio\\\": {\\\"mimeTypes\\\": {\\\".wav\\\": \\\"audio/wav\\\", \\\".mp3\\\": \\\"audio/mpeg\\\"}, \\\"defaultFormat\\\": \\\"wav\\\"}};\\n const payloadForSnippet = deepClone(request || {});\\n const messagesForSnippet = deepClone(payloadForSnippet.messages || []);\\n const hasMediaKind = (kind) => Object.keys(mediaConfig[kind].mimeTypes || {}).length > 0;\\n const isInlineDataUrl = (url, kind) => (\\n typeof url === \\\"string\\\" && new RegExp(`^data:${kind}/[^;]+;base64,`, \\\"i\\\").test(url)\\n );\\n\\n const mediaUrl = (part, key) => {\\n const slot = part?.[key];\\n return typeof slot === \\\"string\\\" ? slot : slot?.url;\\n };\\n const setMediaUrl = (part, key, url) => {\\n if (typeof part[key] === \\\"string\\\") part[key] = url;\\n else {\\n if (!part[key] || typeof part[key] !== \\\"object\\\") part[key] = {};\\n part[key].url = url;\\n }\\n };\\n\\n let imageCount = 0;\\n let hasUnsupportedMedia = false;\\n messagesForSnippet.forEach((message) => {\\n if (!Array.isArray(message?.content)) return;\\n message.content.forEach((part) => {\\n const imageUrl = mediaUrl(part, \\\"image_url\\\");\\n if (hasMediaKind(\\\"image\\\") && part?.type === \\\"image_url\\\" && isInlineDataUrl(imageUrl, \\\"image\\\")) {\\n setMediaUrl(part, \\\"image_url\\\", `__IMAGE_DATA_URL_${imageCount}__`);\\n imageCount += 1;\\n } else if (part?.type === \\\"video_url\\\" && isInlineDataUrl(mediaUrl(part, \\\"video_url\\\"), \\\"video\\\")) {\\n // LangChain cannot ship local file helpers for video; reject inline only.\\n hasUnsupportedMedia = true;\\n setMediaUrl(part, \\\"video_url\\\", \\\"__UNSUPPORTED_MEDIA_DATA__\\\");\\n } else if (part?.type === \\\"audio_url\\\" && isInlineDataUrl(mediaUrl(part, \\\"audio_url\\\"), \\\"audio\\\")) {\\n hasUnsupportedMedia = true;\\n setMediaUrl(part, \\\"audio_url\\\", \\\"__UNSUPPORTED_MEDIA_DATA__\\\");\\n } else if (part?.type === \\\"input_audio\\\" && part.input_audio?.data) {\\n hasUnsupportedMedia = true;\\n part.input_audio.data = \\\"__UNSUPPORTED_MEDIA_DATA__\\\";\\n }\\n });\\n });\\n\\n const pyRepr = (value, level = 0) => {\\n if (value === null) return \\\"None\\\";\\n if (typeof value === \\\"boolean\\\") return value ? \\\"True\\\" : \\\"False\\\";\\n if (typeof value === \\\"number\\\") return String(value);\\n if (typeof value === \\\"string\\\") return JSON.stringify(value);\\n const pad = \\\" \\\".repeat(level);\\n const innerPad = \\\" \\\".repeat(level + 2);\\n if (Array.isArray(value)) {\\n if (value.length === 0) return \\\"[]\\\";\\n return \\\"[\\\\n\\\" + value.map((item) => `${innerPad}${pyRepr(item, level + 2)},`).join(\\\"\\\\n\\\") + \\\"\\\\n\\\" + pad + \\\"]\\\";\\n }\\n if (typeof value === \\\"object\\\") {\\n const entries = Object.entries(value);\\n if (entries.length === 0) return \\\"{}\\\";\\n return \\\"{\\\\n\\\" + entries.map(([key, item]) => `${innerPad}${JSON.stringify(key)}: ${pyRepr(item, level + 2)},`).join(\\\"\\\\n\\\") + \\\"\\\\n\\\" + pad + \\\"}\\\";\\n }\\n return \\\"None\\\";\\n };\\n\\n const replaceAll = (s, a, b) => s.split(a).join(b);\\n let renderedMessages = pyRepr(messagesForSnippet);\\n for (let i = 0; i < imageCount; i++) {\\n renderedMessages = replaceAll(renderedMessages, `\\\"__IMAGE_DATA_URL_${i}__\\\"`, `image_data_urls[${i}]`);\\n }\\n // Either file helpers XOR inline base64 - never emit unused helpers.\\n const usesFileHelpers =\\n imageCount > 0 &&\\n [...Array(imageCount).keys()].every((i) => renderedMessages.includes(`image_data_urls[${i}]`));\\n if (!usesFileHelpers) {\\n imageCount = 0;\\n renderedMessages = pyRepr(deepClone((request || {}).messages || []));\\n }\\n%>\\nfrom langchain_nvidia_ai_endpoints import ChatNVIDIA\\n<% if (imageCount > 0) { %>from pathlib import Path\\nimport base64\\n<% } %>\\n\\nclient = ChatNVIDIA(\\n model=\\\"<%- request.model %>\\\",\\n api_key=\\\"$NVIDIA_API_KEY\\\",\\n temperature=<%- request.temperature %>,\\n top_p=<%- request.top_p %>,\\n max_completion_tokens=<%- request.max_tokens %>,\\n)\\n<% if (imageCount > 0) { %>\\ndef find_image_path(index):\\n image_mime_types = <%- pyRepr(mediaConfig.image.mimeTypes) %>\\n for suffix in image_mime_types:\\n path = Path(f\\\"image_{index}{suffix}\\\")\\n if path.exists():\\n return path\\n expected = \\\"/\\\".join(f\\\".{suffix.lstrip('.')}\\\" for suffix in image_mime_types)\\n raise FileNotFoundError(f\\\"Expected image_{index}{expected}\\\")\\n\\ndef read_image_data_url(path):\\n image_mime_types = <%- pyRepr(mediaConfig.image.mimeTypes) %>\\n with open(path, \\\"rb\\\") as f:\\n image_b64 = base64.b64encode(f.read()).decode()\\n return f\\\"data:{image_mime_types[path.suffix.lower()]};base64,{image_b64}\\\"\\n\\nimage_data_urls = [read_image_data_url(find_image_path(i)) for i in range(1, <%- imageCount + 1 %>)]\\n<% } %><% if (hasUnsupportedMedia) { %>\\nraise ValueError(\\\"LangChain snippet currently supports text and image input. Use Python, Node.js, or Shell for video or audio input.\\\")\\n<% } %>\\nlc_messages = <%- renderedMessages %>\\n<% if (request.stream) { %>\\nfor chunk in client.stream(lc_messages<%= request.chat_template_kwargs ? ', chat_template_kwargs=' + pyRepr(request.chat_template_kwargs) : '' %>):\\n if chunk.additional_kwargs and \\\"reasoning_content\\\" in chunk.additional_kwargs:\\n print(chunk.additional_kwargs[\\\"reasoning_content\\\"], end=\\\"\\\")\\n print(chunk.content, end=\\\"\\\")\\n<% } else { %>\\nresponse = client.invoke(lc_messages<%= request.chat_template_kwargs ? ', chat_template_kwargs=' + pyRepr(request.chat_template_kwargs) : '' %>)\\nif response.additional_kwargs and \\\"reasoning_content\\\" in response.additional_kwargs:\\n print(response.additional_kwargs[\\\"reasoning_content\\\"])\\nprint(response.content)\\n<% } %>\\n\",\n \"node.js\": \"<%\\n const deepClone = (value) => {\\n if (Array.isArray(value)) return value.map(deepClone);\\n if (value && typeof value === \\\"object\\\") {\\n const out = {};\\n for (const key of Object.keys(value)) out[key] = deepClone(value[key]);\\n return out;\\n }\\n return value;\\n };\\n const mediaConfig = {\\\"image\\\": {\\\"mimeTypes\\\": {\\\".png\\\": \\\"image/png\\\", \\\".jpg\\\": \\\"image/jpeg\\\", \\\".jpeg\\\": \\\"image/jpeg\\\", \\\".webp\\\": \\\"image/webp\\\"}}, \\\"video\\\": {\\\"mimeTypes\\\": {\\\".mp4\\\": \\\"video/mp4\\\", \\\".mov\\\": \\\"video/quicktime\\\", \\\".webm\\\": \\\"video/webm\\\"}}, \\\"audio\\\": {\\\"mimeTypes\\\": {\\\".wav\\\": \\\"audio/wav\\\", \\\".mp3\\\": \\\"audio/mpeg\\\"}, \\\"defaultFormat\\\": \\\"wav\\\"}};\\n const payloadForSnippet = deepClone(request || {});\\n const hasStream = payloadForSnippet.stream !== undefined && payloadForSnippet.stream !== null;\\n if (hasStream) payloadForSnippet.stream = \\\"__STREAM__\\\";\\n\\n const hasMediaKind = (kind) => Object.keys(mediaConfig[kind].mimeTypes || {}).length > 0;\\n const isInlineDataUrl = (url, kind) => (\\n typeof url === \\\"string\\\" && new RegExp(`^data:${kind}/[^;]+;base64,`, \\\"i\\\").test(url)\\n );\\n\\n let imageCount = 0;\\n let videoCount = 0;\\n let audioCount = 0;\\n (payloadForSnippet.messages || []).forEach((message) => {\\n if (!Array.isArray(message?.content)) return;\\n message.content.forEach((part) => {\\n if (hasMediaKind(\\\"image\\\") && part?.type === \\\"image_url\\\" && isInlineDataUrl(part.image_url?.url, \\\"image\\\")) {\\n part.image_url.url = `__IMAGE_DATA_URL_${imageCount}__`;\\n imageCount += 1;\\n } else if (hasMediaKind(\\\"video\\\") && part?.type === \\\"video_url\\\" && isInlineDataUrl(part.video_url?.url, \\\"video\\\")) {\\n part.video_url.url = `__VIDEO_DATA_URL_${videoCount}__`;\\n videoCount += 1;\\n } else if (hasMediaKind(\\\"audio\\\") && part?.type === \\\"audio_url\\\" && isInlineDataUrl(part.audio_url?.url, \\\"audio\\\")) {\\n part.audio_url.url = `__AUDIO_DATA_URL_${audioCount}__`;\\n audioCount += 1;\\n } else if (hasMediaKind(\\\"audio\\\") && part?.type === \\\"input_audio\\\" && part.input_audio?.data) {\\n part.input_audio.data = `__AUDIO_B64_${audioCount}__`;\\n part.input_audio.format = part.input_audio.format || mediaConfig.audio.defaultFormat;\\n audioCount += 1;\\n }\\n });\\n });\\n\\n const replaceAll = (s, a, b) => s.split(a).join(b);\\n let renderedPayload = JSON.stringify(payloadForSnippet, null, 2);\\n if (hasStream) renderedPayload = replaceAll(renderedPayload, '\\\"__STREAM__\\\"', \\\"stream\\\");\\n for (let i = 0; i < imageCount; i++) {\\n renderedPayload = replaceAll(renderedPayload, `\\\"__IMAGE_DATA_URL_${i}__\\\"`, `imageDataUrls[${i}]`);\\n }\\n for (let i = 0; i < videoCount; i++) {\\n renderedPayload = replaceAll(renderedPayload, `\\\"__VIDEO_DATA_URL_${i}__\\\"`, `videoDataUrls[${i}]`);\\n }\\n for (let i = 0; i < audioCount; i++) {\\n renderedPayload = replaceAll(renderedPayload, `\\\"__AUDIO_DATA_URL_${i}__\\\"`, `audioDataUrls[${i}]`);\\n renderedPayload = replaceAll(renderedPayload, `\\\"__AUDIO_B64_${i}__\\\"`, `audioB64s[${i}]`);\\n }\\n // Either file helpers XOR inline base64 - never emit unused helpers.\\n const usesFileHelpers =\\n imageCount + videoCount + audioCount > 0 &&\\n [...Array(imageCount).keys()].every((i) => renderedPayload.includes(`imageDataUrls[${i}]`)) &&\\n [...Array(videoCount).keys()].every((i) => renderedPayload.includes(`videoDataUrls[${i}]`)) &&\\n [...Array(audioCount).keys()].every(\\n (i) => renderedPayload.includes(`audioDataUrls[${i}]`) || renderedPayload.includes(`audioB64s[${i}]`)\\n );\\n if (!usesFileHelpers) {\\n imageCount = 0;\\n videoCount = 0;\\n audioCount = 0;\\n const restored = deepClone(request || {});\\n const restoredStream = restored.stream !== undefined && restored.stream !== null;\\n if (restoredStream) restored.stream = \\\"__STREAM__\\\";\\n renderedPayload = JSON.stringify(restored, null, 2);\\n if (restoredStream) renderedPayload = replaceAll(renderedPayload, '\\\"__STREAM__\\\"', \\\"stream\\\");\\n }\\n const hasMedia = usesFileHelpers;\\n%>\\nimport axios from 'axios';\\n<% if (hasMedia) { %>import { existsSync } from 'node:fs';\\nimport { readFile } from 'node:fs/promises';\\nimport { extname } from 'node:path';\\n<% } %>\\n\\nconst invokeUrl = \\\"https://integrate.api.nvidia.com/v1/chat/completions\\\";\\nconst stream = <%- request.stream %>;\\n\\nconst headers = {\\n \\\"Authorization\\\": \\\"Bearer $NVIDIA_API_KEY\\\",\\n \\\"Accept\\\": stream ? \\\"text/event-stream\\\" : \\\"application/json\\\"\\n};\\n<% if (hasMedia) { %>\\nfunction findMediaPath(kind, index, mimeTypes) {\\n for (const suffix of Object.keys(mimeTypes)) {\\n const path = `${kind}_${index}${suffix}`;\\n if (existsSync(path)) {\\n return path;\\n }\\n }\\n const expected = Object.keys(mimeTypes).join(\\\"/\\\");\\n throw new Error(`Expected ${kind}_${index}${expected}`);\\n}\\n\\nasync function readMediaB64(path) {\\n return Buffer.from(await readFile(path)).toString('base64');\\n}\\n\\nfunction mediaDataUrl(path, mediaB64, mimeTypes) {\\n return `data:${mimeTypes[extname(path).toLowerCase()]};base64,${mediaB64}`;\\n}\\n<% } %>\\nasync function main() {\\n<% if (imageCount > 0) { %> const imageMimeTypes = <%- JSON.stringify(mediaConfig.image.mimeTypes, null, 2) %>;\\n const imagePaths = [<% for (let i = 1; i <= imageCount; i++) { %>findMediaPath(\\\"image\\\", <%- i %>, imageMimeTypes)<%- i < imageCount ? \\\", \\\" : \\\"\\\" %><% } %>];\\n const imageB64s = await Promise.all(imagePaths.map(readMediaB64));\\n const imageDataUrls = imagePaths.map((path, index) => mediaDataUrl(path, imageB64s[index], imageMimeTypes));\\n<% } %><% if (videoCount > 0) { %> const videoMimeTypes = <%- JSON.stringify(mediaConfig.video.mimeTypes, null, 2) %>;\\n const videoPaths = [<% for (let i = 1; i <= videoCount; i++) { %>findMediaPath(\\\"video\\\", <%- i %>, videoMimeTypes)<%- i < videoCount ? \\\", \\\" : \\\"\\\" %><% } %>];\\n const videoB64s = await Promise.all(videoPaths.map(readMediaB64));\\n const videoDataUrls = videoPaths.map((path, index) => mediaDataUrl(path, videoB64s[index], videoMimeTypes));\\n<% } %><% if (audioCount > 0) { %> const audioMimeTypes = <%- JSON.stringify(mediaConfig.audio.mimeTypes, null, 2) %>;\\n const audioPaths = [<% for (let i = 1; i <= audioCount; i++) { %>findMediaPath(\\\"audio\\\", <%- i %>, audioMimeTypes)<%- i < audioCount ? \\\", \\\" : \\\"\\\" %><% } %>];\\n const audioB64s = await Promise.all(audioPaths.map(readMediaB64));\\n const audioDataUrls = audioPaths.map((path, index) => mediaDataUrl(path, audioB64s[index], audioMimeTypes));\\n<% } %> const payload = <%- renderedPayload %>;\\n\\n const response = await axios.post(invokeUrl, payload, {\\n headers: headers,\\n responseType: stream ? 'stream' : 'json'\\n });\\n\\n if (stream) {\\n response.data.on('data', (chunk) => {\\n console.log(chunk.toString());\\n });\\n } else {\\n console.log(JSON.stringify(response.data));\\n }\\n}\\n\\nmain().catch(error => {\\n if (error.response) {\\n console.error(`HTTP ${error.response.status}`);\\n if (error.response.data?.on) {\\n error.response.data.on('data', (chunk) => console.error(chunk.toString()));\\n } else {\\n console.error(error.response.data);\\n }\\n } else {\\n console.error(error);\\n }\\n});\\n\",\n \"curl\": \"<%\\n const deepClone = (value) => {\\n if (Array.isArray(value)) return value.map(deepClone);\\n if (value && typeof value === \\\"object\\\") {\\n const out = {};\\n for (const key of Object.keys(value)) out[key] = deepClone(value[key]);\\n return out;\\n }\\n return value;\\n };\\n const mediaConfig = {\\\"image\\\": {\\\"mimeTypes\\\": {\\\".png\\\": \\\"image/png\\\", \\\".jpg\\\": \\\"image/jpeg\\\", \\\".jpeg\\\": \\\"image/jpeg\\\", \\\".webp\\\": \\\"image/webp\\\"}}, \\\"video\\\": {\\\"mimeTypes\\\": {\\\".mp4\\\": \\\"video/mp4\\\", \\\".mov\\\": \\\"video/quicktime\\\", \\\".webm\\\": \\\"video/webm\\\"}}, \\\"audio\\\": {\\\"mimeTypes\\\": {\\\".wav\\\": \\\"audio/wav\\\", \\\".mp3\\\": \\\"audio/mpeg\\\"}, \\\"defaultFormat\\\": \\\"wav\\\"}};\\n const payloadForSnippet = deepClone(request || {});\\n const hasMediaKind = (kind) => Object.keys(mediaConfig[kind].mimeTypes || {}).length > 0;\\n const isInlineDataUrl = (url, kind) => (\\n typeof url === \\\"string\\\" && new RegExp(`^data:${kind}/[^;]+;base64,`, \\\"i\\\").test(url)\\n );\\n\\n let imageCount = 0;\\n let videoCount = 0;\\n let audioCount = 0;\\n (payloadForSnippet.messages || []).forEach((message) => {\\n if (!Array.isArray(message?.content)) return;\\n message.content.forEach((part) => {\\n if (hasMediaKind(\\\"image\\\") && part?.type === \\\"image_url\\\" && isInlineDataUrl(part.image_url?.url, \\\"image\\\")) {\\n part.image_url.url = `__IMAGE_DATA_URL_${imageCount}__`;\\n imageCount += 1;\\n } else if (hasMediaKind(\\\"video\\\") && part?.type === \\\"video_url\\\" && isInlineDataUrl(part.video_url?.url, \\\"video\\\")) {\\n part.video_url.url = `__VIDEO_DATA_URL_${videoCount}__`;\\n videoCount += 1;\\n } else if (hasMediaKind(\\\"audio\\\") && part?.type === \\\"audio_url\\\" && isInlineDataUrl(part.audio_url?.url, \\\"audio\\\")) {\\n part.audio_url.url = `__AUDIO_DATA_URL_${audioCount}__`;\\n audioCount += 1;\\n } else if (hasMediaKind(\\\"audio\\\") && part?.type === \\\"input_audio\\\" && part.input_audio?.data) {\\n part.input_audio.data = `__AUDIO_B64_${audioCount}__`;\\n part.input_audio.format = part.input_audio.format || mediaConfig.audio.defaultFormat;\\n audioCount += 1;\\n }\\n });\\n });\\n\\n const replaceAll = (s, a, b) => s.split(a).join(b);\\n let renderedPayload = JSON.stringify(payloadForSnippet, null, 2);\\n for (let i = 0; i < imageCount; i++) {\\n renderedPayload = replaceAll(renderedPayload, `\\\"__IMAGE_DATA_URL_${i}__\\\"`, `\\\"${\\\"${\\\"}image_${i + 1}_data_url}\\\"`);\\n }\\n for (let i = 0; i < videoCount; i++) {\\n renderedPayload = replaceAll(renderedPayload, `\\\"__VIDEO_DATA_URL_${i}__\\\"`, `\\\"${\\\"${\\\"}video_${i + 1}_data_url}\\\"`);\\n }\\n for (let i = 0; i < audioCount; i++) {\\n renderedPayload = replaceAll(renderedPayload, `\\\"__AUDIO_DATA_URL_${i}__\\\"`, `\\\"${\\\"${\\\"}audio_${i + 1}_data_url}\\\"`);\\n renderedPayload = replaceAll(renderedPayload, `\\\"__AUDIO_B64_${i}__\\\"`, `\\\"${\\\"${\\\"}audio_${i + 1}_b64}\\\"`);\\n }\\n // Either file helpers XOR inline base64 - never emit unused helpers.\\n const usesFileHelpers =\\n imageCount + videoCount + audioCount > 0 &&\\n [...Array(imageCount).keys()].every((i) => renderedPayload.includes(`image_${i + 1}_data_url`)) &&\\n [...Array(videoCount).keys()].every((i) => renderedPayload.includes(`video_${i + 1}_data_url`)) &&\\n [...Array(audioCount).keys()].every(\\n (i) => renderedPayload.includes(`audio_${i + 1}_data_url`) || renderedPayload.includes(`audio_${i + 1}_b64`)\\n );\\n if (!usesFileHelpers) {\\n imageCount = 0;\\n videoCount = 0;\\n audioCount = 0;\\n renderedPayload = JSON.stringify(deepClone(request || {}), null, 2);\\n }\\n const hasMedia = usesFileHelpers;\\n%>\\nstream=<%- request.stream %>\\nif [ \\\"$stream\\\" = true ]; then\\n accept_header='Accept: text/event-stream'\\nelse\\n accept_header='Accept: application/json'\\nfi\\n<% if (hasMedia) { %>\\nmime_type_for() {\\n case \\\"$1\\\" in\\n<% for (const [suffix, mimeType] of Object.entries({...mediaConfig.image.mimeTypes, ...mediaConfig.video.mimeTypes, ...mediaConfig.audio.mimeTypes})) { %> *<%- suffix %>) echo \\\"<%- mimeType %>\\\" ;;\\n<% } %> *) echo \\\"Unsupported media file: $1\\\" >&2; return 1 ;;\\n esac\\n}\\n\\nfind_media_path() {\\n local kind=\\\"$1\\\"\\n local index=\\\"$2\\\"\\n shift 2\\n local ext path\\n for ext in \\\"$@\\\"; do\\n path=\\\"${kind}_${index}.${ext}\\\"\\n if [ -f \\\"$path\\\" ]; then\\n echo \\\"$path\\\"\\n return 0\\n fi\\n done\\n echo \\\"Expected ${kind}_${index}.$*\\\" >&2\\n return 1\\n}\\n\\nmedia_b64() {\\n base64 < \\\"$1\\\" | tr -d '\\\\n'\\n}\\n\\nmedia_data_url() {\\n local path=\\\"$1\\\"\\n local mime_type media_base64\\n mime_type=$(mime_type_for \\\"$path\\\") || return 1\\n media_base64=$(media_b64 \\\"$path\\\") || return 1\\n printf 'data:%s;base64,%s' \\\"$mime_type\\\" \\\"$media_base64\\\"\\n}\\n<% for (let i = 1; i <= imageCount; i++) { %>\\nimage_<%- i %>_path=$(find_media_path image <%- i %><% for (const suffix of Object.keys(mediaConfig.image.mimeTypes)) { %> <%- suffix.slice(1) %><% } %>)\\nimage_<%- i %>_data_url=$(media_data_url \\\"$image_<%- i %>_path\\\")\\n<% } %><% for (let i = 1; i <= videoCount; i++) { %>\\nvideo_<%- i %>_path=$(find_media_path video <%- i %><% for (const suffix of Object.keys(mediaConfig.video.mimeTypes)) { %> <%- suffix.slice(1) %><% } %>)\\nvideo_<%- i %>_data_url=$(media_data_url \\\"$video_<%- i %>_path\\\")\\n<% } %><% for (let i = 1; i <= audioCount; i++) { %>\\naudio_<%- i %>_path=$(find_media_path audio <%- i %><% for (const suffix of Object.keys(mediaConfig.audio.mimeTypes)) { %> <%- suffix.slice(1) %><% } %>)\\naudio_<%- i %>_b64=$(media_b64 \\\"$audio_<%- i %>_path\\\")\\naudio_<%- i %>_data_url=$(media_data_url \\\"$audio_<%- i %>_path\\\")\\n<% } %><% } %>\\ncat > payload.json <<JSON\\n<%- renderedPayload %>\\nJSON\\n\\ncurl https://integrate.api.nvidia.com/v1/chat/completions \\\\\\n -H \\\"Authorization: Bearer $NVIDIA_API_KEY\\\" \\\\\\n -H \\\"Content-Type: application/json\\\" \\\\\\n -H \\\"$accept_header\\\" \\\\\\n -d @payload.json\"\n }\n }\n ]\n }\n }\n }\n },\n \"security\": [\n {\n \"Token\": []\n }\n ],\n \"components\": {\n \"securitySchemes\": {\n \"Token\": {\n \"type\": \"http\",\n \"scheme\": \"bearer\"\n }\n },\n \"schemas\": {\n \"ChatCompletionResponse\": {\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"title\": \"Id\"\n },\n \"object\": {\n \"type\": \"string\",\n \"enum\": [\n \"chat.completion\"\n ],\n \"const\": \"chat.completion\",\n \"title\": \"Object\",\n \"default\": \"chat.completion\"\n },\n \"created\": {\n \"type\": \"integer\",\n \"title\": \"Created\"\n },\n \"model\": {\n \"type\": \"string\",\n \"title\": \"Model\"\n },\n \"choices\": {\n \"items\": {\n \"$ref\": \"#/components/schemas/ChatCompletionResponseChoice\"\n },\n \"type\": \"array\",\n \"title\": \"Choices\"\n },\n \"usage\": {\n \"$ref\": \"#/components/schemas/UsageInfo\"\n }\n },\n \"additionalProperties\": false,\n \"type\": \"object\",\n \"required\": [\n \"model\",\n \"choices\",\n \"usage\"\n ],\n \"title\": \"ChatCompletionResponse\"\n },\n \"ChatCompletionResponseChoice\": {\n \"properties\": {\n \"index\": {\n \"type\": \"integer\",\n \"title\": \"Index\"\n },\n \"message\": {\n \"$ref\": \"#/components/schemas/ChatMessage\"\n },\n \"finish_reason\": {\n \"anyOf\": [\n {\n \"type\": \"string\",\n \"enum\": [\n \"stop\",\n \"length\"\n ]\n },\n {\n \"type\": \"null\"\n }\n ],\n \"title\": \"Finish Reason\"\n },\n \"stop_reason\": {\n \"anyOf\": [\n {\n \"type\": \"integer\"\n },\n {\n \"type\": \"string\"\n },\n {\n \"type\": \"null\"\n }\n ],\n \"title\": \"Stop Reason\"\n }\n },\n \"additionalProperties\": false,\n \"type\": \"object\",\n \"required\": [\n \"index\",\n \"message\"\n ],\n \"title\": \"ChatCompletionResponseChoice\"\n },\n \"ChatCompletionResponseStreamChoice\": {\n \"properties\": {\n \"index\": {\n \"type\": \"integer\",\n \"title\": \"Index\"\n },\n \"delta\": {\n \"$ref\": \"#/components/schemas/DeltaMessage\"\n },\n \"finish_reason\": {\n \"anyOf\": [\n {\n \"type\": \"string\",\n \"enum\": [\n \"stop\",\n \"length\"\n ]\n },\n {\n \"type\": \"null\"\n }\n ],\n \"title\": \"Finish Reason\"\n },\n \"stop_reason\": {\n \"anyOf\": [\n {\n \"type\": \"integer\"\n },\n {\n \"type\": \"string\"\n },\n {\n \"type\": \"null\"\n }\n ],\n \"title\": \"Stop Reason\"\n }\n },\n \"additionalProperties\": false,\n \"type\": \"object\",\n \"required\": [\n \"index\",\n \"delta\"\n ],\n \"title\": \"ChatCompletionResponseStreamChoice\"\n },\n \"ChatCompletionStreamResponse\": {\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"title\": \"Id\"\n },\n \"object\": {\n \"type\": \"string\",\n \"enum\": [\n \"chat.completion.chunk\"\n ],\n \"const\": \"chat.completion.chunk\",\n \"title\": \"Object\",\n \"default\": \"chat.completion.chunk\"\n },\n \"created\": {\n \"type\": \"integer\",\n \"title\": \"Created\"\n },\n \"model\": {\n \"type\": \"string\",\n \"title\": \"Model\"\n },\n \"choices\": {\n \"items\": {\n \"$ref\": \"#/components/schemas/ChatCompletionResponseStreamChoice\"\n },\n \"type\": \"array\",\n \"title\": \"Choices\"\n },\n \"usage\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/UsageInfo\"\n },\n {\n \"type\": \"null\"\n }\n ]\n }\n },\n \"additionalProperties\": false,\n \"type\": \"object\",\n \"required\": [\n \"model\",\n \"choices\"\n ],\n \"title\": \"ChatCompletionStreamResponse\"\n },\n \"ChatMessage\": {\n \"properties\": {\n \"role\": {\n \"type\": \"string\",\n \"title\": \"Role\"\n },\n \"content\": {\n \"anyOf\": [\n {\n \"type\": \"string\"\n },\n {\n \"type\": \"null\"\n }\n ],\n \"title\": \"Content\"\n }\n },\n \"additionalProperties\": false,\n \"type\": \"object\",\n \"required\": [\n \"role\"\n ],\n \"title\": \"ChatMessage\"\n },\n \"DeltaMessage\": {\n \"properties\": {\n \"role\": {\n \"anyOf\": [\n {\n \"type\": \"string\"\n },\n {\n \"type\": \"null\"\n }\n ],\n \"title\": \"Role\"\n },\n \"content\": {\n \"anyOf\": [\n {\n \"type\": \"string\"\n },\n {\n \"type\": \"null\"\n }\n ],\n \"title\": \"Content\"\n }\n },\n \"additionalProperties\": false,\n \"type\": \"object\",\n \"title\": \"DeltaMessage\"\n },\n \"ErrorResponse\": {\n \"properties\": {\n \"object\": {\n \"type\": \"string\",\n \"title\": \"Object\",\n \"default\": \"error\"\n },\n \"message\": {\n \"type\": \"string\",\n \"title\": \"Message\"\n },\n \"type\": {\n \"type\": \"string\",\n \"title\": \"Type\"\n },\n \"param\": {\n \"anyOf\": [\n {\n \"type\": \"string\"\n },\n {\n \"type\": \"null\"\n }\n ],\n \"title\": \"Param\"\n },\n \"code\": {\n \"type\": \"integer\",\n \"title\": \"Code\"\n }\n },\n \"additionalProperties\": false,\n \"type\": \"object\",\n \"required\": [\n \"message\",\n \"type\",\n \"code\"\n ],\n \"title\": \"ErrorResponse\"\n },\n \"AudioURL\": {\n \"properties\": {\n \"url\": {\n \"type\": \"string\",\n \"title\": \"Url\"\n }\n },\n \"type\": \"object\",\n \"required\": [\n \"url\"\n ],\n \"title\": \"AudioURL\"\n },\n \"InputAudio\": {\n \"properties\": {\n \"data\": {\n \"type\": \"string\",\n \"title\": \"Data\"\n },\n \"format\": {\n \"type\": \"string\",\n \"enum\": [\n \"wav\",\n \"mp3\"\n ],\n \"title\": \"Format\"\n }\n },\n \"type\": \"object\",\n \"required\": [\n \"data\",\n \"format\"\n ],\n \"title\": \"InputAudio\"\n },\n \"ImageURL\": {\n \"properties\": {\n \"url\": {\n \"type\": \"string\",\n \"title\": \"Url\"\n }\n },\n \"type\": \"object\",\n \"required\": [\n \"url\"\n ],\n \"title\": \"ImageURL\"\n },\n \"VideoURL\": {\n \"properties\": {\n \"url\": {\n \"type\": \"string\",\n \"title\": \"Url\"\n }\n },\n \"type\": \"object\",\n \"required\": [\n \"url\"\n ],\n \"title\": \"VideoURL\"\n },\n \"NIMLLMChatCompletionMessage\": {\n \"properties\": {\n \"role\": {\n \"allOf\": [\n {\n \"$ref\": \"#/components/schemas/Role\"\n }\n ],\n \"description\": \"The role of the message's author.\"\n },\n \"content\": {\n \"anyOf\": [\n {\n \"type\": \"string\"\n },\n {\n \"items\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/NIMLLMChatCompletionContentPartAudio\"\n },\n {\n \"$ref\": \"#/components/schemas/NIMLLMChatCompletionContentPartInputAudio\"\n },\n {\n \"$ref\": \"#/components/schemas/NIMVLMChatCompletionContentPartImage\"\n },\n {\n \"$ref\": \"#/components/schemas/NIMVLMChatCompletionContentPartVideo\"\n },\n {\n \"$ref\": \"#/components/schemas/NIMVLMChatCompletionContentPartText\"\n }\n ]\n },\n \"type\": \"array\"\n }\n ],\n \"title\": \"Content\",\n \"description\": \"The contents of the message.\\n<br>To pass media (only with role=`user`):\\n<br> - Use content parts. Text is passed with `type`=`text`.\\n<br> - Images are passed with `type`=`image_url`; set `image_url.url` to an image URL or a base64 data URI like `data:image/{format};base64,{base64encodedimage}`.\\n<br> - Videos use `type`=`video_url`; audios use `type`=`audio_url` or `type`=`input_audio` when supported by the model schema.\\n<br>For `system` and `assistant` roles, the object list format is not supported.\\n\"\n }\n },\n \"type\": \"object\",\n \"required\": [\n \"role\",\n \"content\"\n ],\n \"title\": \"NIMLLMChatCompletionMessage\"\n },\n \"NIMLLMChatCompletionRequest\": {\n \"properties\": {\n \"messages\": {\n \"items\": {\n \"$ref\": \"#/components/schemas/NIMLLMChatCompletionMessage\"\n },\n \"type\": \"array\",\n \"minItems\": 1,\n \"title\": \"Messages\",\n \"description\": \"A list of messages comprising the conversation so far.\"\n },\n \"model\": {\n \"type\": \"string\",\n \"title\": \"Model\",\n \"description\": \"The model to use.\",\n \"default\": \"nvidia/nemotron-3-nano-omni-30b-a3b-reasoning\"\n },\n \"max_tokens\": {\n \"anyOf\": [\n {\n \"type\": \"integer\",\n \"maximum\": 65536,\n \"minimum\": 1\n },\n {\n \"type\": \"null\"\n }\n ],\n \"title\": \"Max Tokens\",\n \"description\": \"The maximum number of tokens that can be generated.\",\n \"default\": 65536\n },\n \"reasoning_budget\": {\n \"type\": \"integer\",\n \"minimum\": -1,\n \"maximum\": 32768,\n \"title\": \"Reasoning Budget\",\n \"description\": \"Maximum number of tokens the model is allowed to use for internal reasoning before the reasoning trace is forced to end. Use `-1` to disable budget enforcement. This can also be provided via `chat_template_kwargs.reasoning_budget` for backwards compatibility.\",\n \"default\": 16384\n },\n \"seed\": {\n \"anyOf\": [\n {\n \"type\": \"integer\",\n \"maximum\": 9223372036854776000,\n \"minimum\": -9223372036854776000\n },\n {\n \"type\": \"null\"\n }\n ],\n \"title\": \"Seed\",\n \"description\": \"Changing the seed will produce a different response with similar characteristics. Fixing the seed will reproduce the same results if all other parameters are also kept constant.\"\n },\n \"stream\": {\n \"anyOf\": [\n {\n \"type\": \"boolean\"\n },\n {\n \"type\": \"null\"\n }\n ],\n \"title\": \"Stream\",\n \"description\": \"If set, partial message deltas will be sent, like in ChatGPT. Tokens will be sent as data-only [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) as they become available, with the stream terminated by a `data: [DONE]`\",\n \"default\": false\n },\n \"temperature\": {\n \"anyOf\": [\n {\n \"type\": \"number\",\n \"maximum\": 2,\n \"minimum\": 0\n },\n {\n \"type\": \"null\"\n }\n ],\n \"title\": \"Temperature\",\n \"description\": \"What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.\",\n \"default\": 0.6\n },\n \"top_p\": {\n \"anyOf\": [\n {\n \"type\": \"number\",\n \"maximum\": 1,\n \"exclusiveMinimum\": 0\n },\n {\n \"type\": \"null\"\n }\n ],\n \"title\": \"Top P\",\n \"description\": \"An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both.\",\n \"default\": 0.95\n }\n },\n \"additionalProperties\": false,\n \"type\": \"object\",\n \"required\": [\n \"messages\",\n \"model\"\n ],\n \"title\": \"NIMLLMChatCompletionRequest\"\n },\n \"NIMLLMChatCompletionContentPartAudio\": {\n \"properties\": {\n \"audio_url\": {\n \"$ref\": \"#/components/schemas/AudioURL\"\n },\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"audio_url\"\n ],\n \"const\": \"audio_url\",\n \"title\": \"Type\"\n }\n },\n \"type\": \"object\",\n \"required\": [\n \"audio_url\",\n \"type\"\n ],\n \"title\": \"NIMLLMChatCompletionContentPartAudio\"\n },\n \"NIMLLMChatCompletionContentPartInputAudio\": {\n \"properties\": {\n \"input_audio\": {\n \"$ref\": \"#/components/schemas/InputAudio\"\n },\n \"type\": {\n \"type\": \"string\",\n \"const\": \"input_audio\",\n \"title\": \"Type\"\n }\n },\n \"type\": \"object\",\n \"required\": [\n \"input_audio\",\n \"type\"\n ],\n \"title\": \"NIMLLMChatCompletionContentPartInputAudio\"\n },\n \"NIMVLMChatCompletionContentPartImage\": {\n \"properties\": {\n \"image_url\": {\n \"$ref\": \"#/components/schemas/ImageURL\"\n },\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"image_url\"\n ],\n \"const\": \"image_url\",\n \"title\": \"Type\"\n }\n },\n \"type\": \"object\",\n \"required\": [\n \"image_url\",\n \"type\"\n ],\n \"title\": \"NIMVLMChatCompletionContentPartImage\"\n },\n \"NIMVLMChatCompletionContentPartVideo\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"video_url\": {\n \"description\": \"Video url\",\n \"allOf\": [\n {\n \"$ref\": \"#/components/schemas/VideoURL\"\n }\n ]\n },\n \"start_offset\": {\n \"description\": \"video offset position\",\n \"anyOf\": [\n {\n \"type\": \"number\",\n \"maximum\": 9223372036854776000,\n \"minimum\": 0\n },\n {\n \"type\": \"null\"\n }\n ],\n \"title\": \"Start Offset\"\n },\n \"duration\": {\n \"description\": \"video inference duration\",\n \"anyOf\": [\n {\n \"type\": \"number\",\n \"maximum\": 9223372036854776000,\n \"minimum\": 0\n },\n {\n \"type\": \"null\"\n }\n ],\n \"title\": \"Duration\"\n },\n \"type\": {\n \"type\": \"string\",\n \"description\": \"The type of the content part.\",\n \"enum\": [\n \"video_url\"\n ],\n \"const\": \"video_url\",\n \"title\": \"Type\"\n }\n },\n \"required\": [\n \"type\",\n \"video_url\"\n ],\n \"type\": \"object\",\n \"title\": \"NIMVLMChatCompletionContentPartVideo\"\n },\n \"NIMVLMChatCompletionContentPartText\": {\n \"properties\": {\n \"text\": {\n \"type\": \"string\",\n \"title\": \"Text\"\n },\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"text\"\n ],\n \"const\": \"text\",\n \"title\": \"Type\"\n }\n },\n \"type\": \"object\",\n \"required\": [\n \"text\",\n \"type\"\n ],\n \"title\": \"NIMVLMChatCompletionContentPartText\"\n },\n \"Role\": {\n \"type\": \"string\",\n \"enum\": [\n \"system\",\n \"assistant\",\n \"user\"\n ],\n \"title\": \"Role\"\n },\n \"UsageInfo\": {\n \"properties\": {\n \"prompt_tokens\": {\n \"type\": \"integer\",\n \"title\": \"Prompt Tokens\",\n \"default\": 0\n },\n \"total_tokens\": {\n \"type\": \"integer\",\n \"title\": \"Total Tokens\",\n \"default\": 0\n },\n \"completion_tokens\": {\n \"anyOf\": [\n {\n \"type\": \"integer\"\n },\n {\n \"type\": \"null\"\n }\n ],\n \"title\": \"Completion Tokens\",\n \"default\": 0\n }\n },\n \"additionalProperties\": false,\n \"type\": \"object\",\n \"title\": \"UsageInfo\"\n }\n }\n },\n \"x-readme\": {\n \"explorer-enabled\": true,\n \"proxy-enabled\": true\n }\n}\n```"
6 },
7 "https://docs.api.nvidia.com/nim/reference/nvidia-nemotron-parse-2_0-infer.md": {
8 "url": "https://docs.api.nvidia.com/nim/reference/nvidia-nemotron-parse-2_0-infer.md",
9 "status": 200,
10 "body": "---\nupdatedAt: 2026-09-14T13:53:27.000Z\n---\n\n# Request response from the model\n\nInvokes inference using the model chat parameters.\n\n# OpenAPI definition\n\n```json\n{\n \"openapi\": \"3.1.0\",\n \"info\": {\n \"title\": \"NVIDIA NIM API for nvidia/nemotron-parse\",\n \"description\": \"The NVIDIA NIM REST API. Please see https://docs.api.nvidia.com/nim/reference/nvidia-nemotron-parse for more details.\",\n \"version\": \"1.0.0\",\n \"termsOfService\": \"https://nvidia.com/legal/terms-of-use\",\n \"contact\": {\n \"name\": \"NVIDIA Support\",\n \"url\": \"https://help.nvidia.com/\"\n },\n \"license\": {\n \"name\": \"NVIDIA Software and Model Evaluation License Agreement\",\n \"url\": \"https://developer.download.nvidia.com/licenses/NVIDIA_Software_and_Model_Evaluation_License_Agreement.pdf\"\n }\n },\n \"servers\": [\n {\n \"url\": \"https://integrate.api.nvidia.com/v1/\"\n }\n ],\n \"tags\": [\n {\n \"name\": \"Multimodal API\",\n \"description\": \"This API performs inference using document content extraction models\"\n }\n ],\n \"paths\": {\n \"/chat/completions\": {\n \"post\": {\n \"tags\": [\n \"Multimodal API\"\n ],\n \"summary\": \"Request response from the model\",\n \"description\": \"Invokes inference using the model chat parameters.\",\n \"operationId\": \"nvidia-nemotron-parse-2_0-infer\",\n \"requestBody\": {\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/NIMLLMChatCompletionRequest\"\n },\n \"example\": {\n \"model\": \"nvidia/nemotron-parse-2.0\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"</s><s><predict_bbox><predict_classes><output_markdown><predict_text_in_pic>\"\n },\n {\n \"type\": \"image_url\",\n \"image_url\": {\n \"url\": \"https://assets.ngc.nvidia.com/products/api-catalog/nemoretriever-parse/example_1.jpg\"\n }\n }\n ]\n }\n ],\n \"max_tokens\": 1024,\n \"temperature\": 0\n }\n }\n },\n \"required\": true\n },\n \"responses\": {\n \"200\": {\n \"description\": \"Invocation is fulfilled\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/ChatCompletionResponse\"\n }\n },\n \"text/event-stream\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/ChatCompletionStreamResponse\"\n }\n }\n }\n },\n \"202\": {\n \"description\": \"Result is pending. Client should poll using the requestId.\\n\",\n \"content\": {\n \"application/json\": {\n \"example\": {},\n \"schema\": {}\n }\n },\n \"headers\": {\n \"NVCF-REQID\": {\n \"description\": \"requestId required for pooling\",\n \"schema\": {\n \"type\": \"string\",\n \"format\": \"uuid\",\n \"maxLength\": 36\n }\n },\n \"NVCF-STATUS\": {\n \"description\": \"Invocation status\",\n \"schema\": {\n \"type\": \"string\",\n \"format\": \"^[a-zA-Z-]{1,64}$\",\n \"maxLength\": 64\n }\n }\n }\n },\n \"422\": {\n \"description\": \"Validation failed, provided entity could not be processed.\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/ErrorResponse\"\n },\n \"example\": {\n \"type\": \"urn:nvcf-worker-service:problem-details:unprocessable-entity\",\n \"title\": \"Unprocessable Entity\",\n \"status\": 422,\n \"detail\": \"string\",\n \"instance\": \"/v2/nvcf/pexec/functions/e598bfc1-b058-41af-869d-556d3c7e1b48\",\n \"requestId\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\"\n }\n }\n }\n },\n \"500\": {\n \"description\": \"The invocation ended with an error.\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/ErrorResponse\"\n },\n \"example\": {\n \"type\": \"urn:nvcf-worker-service:problem-details:internal-server-error\",\n \"title\": \"Internal Server Error\",\n \"status\": 500,\n \"detail\": \"string\",\n \"instance\": \"/v2/nvcf/pexec/functions/e598bfc1-b058-41af-869d-556d3c7e1b48\",\n \"requestId\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\"\n }\n }\n }\n }\n },\n \"x-nvai-meta\": {\n \"name\": \"Create chat completion\",\n \"returns\": \"Returns a [chat completion](/docs/api-reference/chat/object) object.\\n\",\n \"path\": \"create\",\n \"examples\": [\n {\n \"name\": \"document1\",\n \"input\": {\n \"image\": \"https://assets.ngc.nvidia.com/products/api-catalog/nemoretriever-parse/example_1.jpg\",\n \"prompt\": \"</s><s><predict_bbox><predict_classes><output_markdown><predict_text_in_pic>\"\n },\n \"requestJson\": \"{\\n \\\"model\\\": \\\"nvidia/nemotron-parse-2.0\\\",\\n \\\"messages\\\": [\\n {\\n \\\"role\\\": \\\"user\\\",\\n \\\"content\\\": [\\n {\\n \\\"type\\\": \\\"text\\\",\\n \\\"text\\\": \\\"<%- input.prompt %>\\\"\\n },\\n {\\n \\\"type\\\": \\\"image_url\\\",\\n \\\"image_url\\\": {\\n \\\"url\\\": \\\"<%- input.image %>\\\"\\n }\\n }\\n ]\\n }\\n ],\\n \\\"max_tokens\\\": 1024,\\n \\\"temperature\\\": 0\\n}\\n\",\n \"responseJson\": \"{\\n \\\"id\\\": \\\"chatcmpl-94444bbf3f421c5f\\\",\\n \\\"object\\\": \\\"chat.completion\\\",\\n \\\"created\\\": 1786657564,\\n \\\"model\\\": \\\"nvidia/nemotron-parse-2.0\\\",\\n \\\"choices\\\": [\\n {\\n \\\"index\\\": 0,\\n \\\"message\\\": {\\n \\\"role\\\": \\\"assistant\\\",\\n \\\"content\\\": \\\"<x_0.5312><y_0.1531>**CUDA C++ Programming Guide, Release 12.8**<x_0.7852><y_0.1648><class_Page-header>\\\\n\\\\n<x_0.2217><y_0.1984>\\\\\\\\begin{tabular}{cc}\\\\n**Thread Scope** & **Description**\\\\\\\\\\\\\\\\cuda::thread\\\\\\\\_scope::thread\\\\\\\\_scope\\\\\\\\_thread & Only the CUDA thread which initiated asynchronous op- erations synchronizes.\\\\\\\\\\\\\\\\cuda::thread\\\\\\\\_scope::thread\\\\\\\\_scope\\\\\\\\_block & All or any CUDA threads within the same thread block as the initiating thread synchronizes.\\\\\\\\\\\\\\\\cuda::thread\\\\\\\\_scope::thread\\\\\\\\_scope\\\\\\\\_device & All or any CUDA threads in the same GPU device as the initiating thread syn- chronizes.\\\\\\\\\\\\\\\\cuda::thread\\\\\\\\_scope::thread\\\\\\\\_scope\\\\\\\\_system & All or any CUDA or CPU threads in the same system as the initiating thread syn- chronizes.\\\\\\\\\\\\\\\\\\\\n\\\\\\\\end{tabular}<x_0.7842><y_0.418><class_Table>\\\\n\\\\n<x_0.2217><y_0.432>These thread scopes are implemented as extensions to standard C++ in the CUDA Standard C++ li- brary.<x_0.7852><y_0.4555><class_Text>\\\\n\\\\n<x_0.2217><y_0.482>## 5.6. Compute Capability<x_0.5039><y_0.5055><class_Section-header>\\\\n\\\\n<x_0.2217><y_0.5242>The _compute capability_ of a device is represented by a version number, also sometimes called its \u201cSM version\u201d. This version number identifies the features supported by the GPU hardware and is used by applications at runtime to determine which hardware features and/or instructions are available on the present GPU.<x_0.7852><y_0.5703><class_Text>\\\\n\\\\n<x_0.2217><y_0.5766>The compute capability comprises a major revision number X and a minor revision number Y and is denoted by X.Y.<x_0.7852><y_0.5992><class_Text>\\\\n\\\\n<x_0.2217><y_0.6062>Devices with the same major revision number are of the same core architecture. The major revision number is 9 for devices based on the _NVIDIA Hopper GPU_ architecture, 8 for devices based on the _NVIDIA Ampere GPU_ architecture, 7 for devices based on the _Volta_ architecture, 6 for devices based on the _Pascal_ architecture, 5 for devices based on the _Maxwell_ architecture, and 3 for devices based on the _Kepler_ architecture.<x_0.7852><y_0.6641><class_Text>\\\\n\\\\n<x_0.2217><y_0.6703>The minor revision number corresponds to an incremental improvement to the core architecture, possibly including new features.<x_0.7852><y_0.693><class_Text>\\\\n\\\\n<x_0.2217><y_0.7>_Turing_ is the architecture for devices of compute capability 7.5, and is an incremental update based on the _Volta_ architecture.<x_0.7852><y_0.7227><class_Text>\\\\n\\\\n<x_0.2217><y_0.7289>_CUDA-Enabled GPUs_ lists of all CUDA-enabled devices along with their compute capability. _Compute Capabilities_ gives the technical specifications of each compute capability.<x_0.7852><y_0.7516><class_Text>\\\\n\\\\n<x_0.2217><y_0.7695>**Note:** The compute capability version of a particular GPU should not be confused with the CUDA version (for example, CUDA 7.5, CUDA 8, CUDA 9), which is the version of the CUDA _software platform_. The CUDA platform is used by application developers to create applications that run on many generations of GPU architectures, including future GPU architectures yet to be invented. While new versions<x_0.7852><y_0.8156><class_Text>\\\\n\\\\n<x_0.2217><y_0.8438>**5.6. Compute Capability**<x_0.3633><y_0.8547><class_Page-footer>\\\\n\\\\n<x_0.7705><y_0.8445>19<x_0.7852><y_0.8539><class_Page-footer>\\\",\\n \\\"refusal\\\": null,\\n \\\"annotations\\\": null,\\n \\\"audio\\\": null,\\n \\\"function_call\\\": null,\\n \\\"reasoning\\\": null\\n },\\n \\\"logprobs\\\": null,\\n \\\"finish_reason\\\": \\\"stop\\\",\\n \\\"stop_reason\\\": null,\\n \\\"token_ids\\\": null,\\n \\\"routed_experts\\\": null\\n }\\n ],\\n \\\"service_tier\\\": null,\\n \\\"system_fingerprint\\\": \\\"vllm-0.24.0-4447e481\\\",\\n \\\"usage\\\": {\\n \\\"prompt_tokens\\\": 6,\\n \\\"total_tokens\\\": 683,\\n \\\"completion_tokens\\\": 677,\\n \\\"prompt_tokens_details\\\": null\\n },\\n \\\"prompt_logprobs\\\": null,\\n \\\"prompt_token_ids\\\": null,\\n \\\"prompt_text\\\": null,\\n \\\"kv_transfer_params\\\": null\\n}\\n\"\n },\n {\n \"name\": \"document2\",\n \"input\": {\n \"image\": \"https://assets.ngc.nvidia.com/products/api-catalog/nemotron-parse/example_2.jpg\",\n \"prompt\": \"</s><s><predict_bbox><predict_classes><output_markdown><predict_text_in_pic>\"\n },\n \"requestJson\": \"{\\n \\\"model\\\": \\\"nvidia/nemotron-parse-2.0\\\",\\n \\\"messages\\\": [\\n {\\n \\\"role\\\": \\\"user\\\",\\n \\\"content\\\": [\\n {\\n \\\"type\\\": \\\"text\\\",\\n \\\"text\\\": \\\"<%- input.prompt %>\\\"\\n },\\n {\\n \\\"type\\\": \\\"image_url\\\",\\n \\\"image_url\\\": {\\n \\\"url\\\": \\\"<%- input.image %>\\\"\\n }\\n }\\n ]\\n }\\n ],\\n \\\"max_tokens\\\": 1024,\\n \\\"temperature\\\": 0\\n}\\n\",\n \"responseJson\": \"{\\n \\\"id\\\": \\\"chatcmpl-8b5e2de3961a811c\\\",\\n \\\"object\\\": \\\"chat.completion\\\",\\n \\\"created\\\": 1786657659,\\n \\\"model\\\": \\\"nvidia/nemotron-parse-2.0\\\",\\n \\\"choices\\\": [\\n {\\n \\\"index\\\": 0,\\n \\\"message\\\": {\\n \\\"role\\\": \\\"assistant\\\",\\n \\\"content\\\": \\\"<x_0.1162><y_0.0672>Appl. Sci. 2023, 13, 12967\\\\n4 of 21<x_0.8818><y_0.0766><class_Page-header>\\\\n\\\\n<x_0.3076><y_0.1148>Table 1. Adopted material properties.<x_0.5254><y_0.1258><class_Caption>\\\\n\\\\n<x_0.1514><y_0.1422>\\\\\\\\begin{tabular}{cccccc}\\\\n\\\\\\\\multirow{2}{*}{**Quantity**} & \\\\\\\\multirow{2}{*}{**Symbol**} & \\\\\\\\multirow{2}{*}{**Units**} & \\\\\\\\multicolumn{3}{c}{**Materials**}\\\\\\\\\\\\\\\\\\\\n{} & {} & {} & **Ti-6Al-4V** & **Al. 7075 T6** & **SikaPower\u00ae-1277**\\\\\\\\\\\\\\\\\\\\nModulus of elasticity & E & MPa & 115,000 & 71,955 \u00b1 224 & 2280 \u00b1 533\\\\\\\\\\\\\\\\\\\\nPoisson\u2019s ratio & v & / & 0.34 & 0.3 & 0.33\\\\\\\\\\\\\\\\\\\\nUltimate tensile strength & \u03c3uts & MPa & 950 & 610 \u00b1 15 & 35.7 \u00b1 1.4\\\\\\\\\\\\\\\\\\\\nDensity & \u03c1 & g/cc & 4.395 & 2.8 & 1.1\\\\\\\\\\\\\\\\\\\\nLoss factor & LF & / & 2.96 \u00d7 10\u22124 & 3.5 \u00d7 10\u22123 & 2 \u00d7 10\u22122\\\\\\\\\\\\\\\\\\\\nViscosity & V & Pa\u00b7s & / & / & 430 (at 20 \u00b0C)\\\\\\\\\\\\\\\\\\\\n\\\\\\\\end{tabular}<x_0.8701><y_0.2844><class_Table>\\\\n\\\\n<x_0.3066><y_0.3102>The adopted experimental equipment for performing VHCF tests was an ultrasonic\\\\nfatigue testing machine (UFTM). The UFTM is shown in Figure 1 and was developed at\\\\nPolitecnico di Torino for testing components in the chosen fatigue range. The UFTM can\\\\nperform tests at 20 \u00b1 0.5 kHz under fully reversed tension\u2013compression stress (R = \u22121),\\\\nwhich significantly reduces the testing time compared to conventional testing apparatuses.\\\\nTo perform fatigue tests, the UFTM adopts the following devices: (i) an electric generator\\\\n(Branson DCX 4 kW, not visible in Figure 1) which generates an electrical sinusoidal wave\\\\nat 20 kHz; (ii) a piezoelectric transducer, responsible for converting the electrical wave\\\\ninto a mechanical vibration; (iii) a booster and a horn made of Ti\u20136Al\u20134V that amplify and\\\\nconvey the vibration to the specimen under testing; (iv) the specimen under investigation,\\\\nwhich was designed for the UFTM resonance conditions; (v) a laser displacement sensor\\\\nthat measures the displacement at the specimen free end; (vi) vortex tubes to keep the\\\\ntemperature controlled in the range (20\u201324) \u25e6C; and (vii) a temperature sensor to observe\\\\nthe temperature evolution during the test execution.<x_0.8838><y_0.5156><class_Text>\\\\n\\\\n<x_0.1914><y_0.5578>Piezoelectric\\\\ntransducer<x_0.7666><y_0.5852><class_Text>\\\\n\\\\n<x_0.2334><y_0.643>Vortex tube<x_0.2998><y_0.6547><class_Text>\\\\n\\\\n<x_0.6846><y_0.6359>Booster<x_0.7305><y_0.6477><class_Text>\\\\n\\\\n<x_0.1826><y_0.6625>Horn<x_0.7119><y_0.6734><class_Text>\\\\n\\\\n<x_0.2021><y_0.6836>Temperature sensor<x_0.3154><y_0.6953><class_Text>\\\\n\\\\n<x_0.6758><y_0.6937>Specimen<x_0.7334><y_0.7055><class_Text>\\\\n\\\\n<x_0.6826><y_0.7211>Laser-displacement\\\\nsensor<x_0.7969><y_0.7469><class_Text>\\\\n\\\\n<x_0.3076><y_0.8336>Figure 1. The UFTM equipment [43].<x_0.5215><y_0.8445><class_Text>\\\\n\\\\n<x_0.3076><y_0.8586>Performing fatigue tests with the UFTM consists of the application of alternated stress\\\\nin specimens that are designed to work in resonance conditions. The specimen and the\\\\nvibration components are thus designed to have a resonance frequency corresponding to a\\\\nlongitudinal mode of vibration close to 20 kHz. Moreover, the UFTM adopts a closed-loop\\\\nproportional\u2013integrative\u2013derivative (PID) control logic where the displacement measured<x_0.8818><y_0.9305><class_Text>\\\",\\n \\\"refusal\\\": null,\\n \\\"annotations\\\": null,\\n \\\"audio\\\": null,\\n \\\"function_call\\\": null,\\n \\\"reasoning\\\": null\\n },\\n \\\"logprobs\\\": null,\\n \\\"finish_reason\\\": \\\"stop\\\",\\n \\\"stop_reason\\\": null,\\n \\\"token_ids\\\": null,\\n \\\"routed_experts\\\": null\\n }\\n ],\\n \\\"service_tier\\\": null,\\n \\\"system_fingerprint\\\": \\\"vllm-0.24.0-4447e481\\\",\\n \\\"usage\\\": {\\n \\\"prompt_tokens\\\": 6,\\n \\\"total_tokens\\\": 934,\\n \\\"completion_tokens\\\": 928,\\n \\\"prompt_tokens_details\\\": null\\n },\\n \\\"prompt_logprobs\\\": null,\\n \\\"prompt_token_ids\\\": null,\\n \\\"prompt_text\\\": null,\\n \\\"kv_transfer_params\\\": null\\n}\\n\"\n }\n ],\n \"templates\": [\n {\n \"title\": \"Default\",\n \"requestEjs\": {\n \"python\": \"<%\\n const req = request || {};\\n const model = req.model || \\\"nvidia/nemotron-parse-2.0\\\";\\n const defaultPrompt = \\\"</s><s><predict_bbox><predict_classes><output_markdown><predict_text_in_pic>\\\";\\n const imagePart = { type: \\\"image_url\\\", image_url: { url: \\\"https://assets.ngc.nvidia.com/products/api-catalog/nemoretriever-parse/example_1.jpg\\\" } };\\n const rawMessages = Array.isArray(req.messages) ? req.messages : (typeof req.messages === \\\"string\\\" ? [{ role: \\\"user\\\", content: req.messages }] : []);\\n const toMessage = (msg) => {\\n const m = (msg && typeof msg === \\\"object\\\") ? msg : { content: msg };\\n const role = m.role || \\\"user\\\";\\n if (Array.isArray(m.content)) return { role, content: m.content };\\n const text = (m.content === undefined || m.content === null || String(m.content).trim() === \\\"\\\") ? defaultPrompt : String(m.content);\\n return role === \\\"user\\\" ? { role, content: [{ type: \\\"text\\\", text }, imagePart] } : { role, content: text };\\n };\\n const messages = (rawMessages.length ? rawMessages : [{ role: \\\"user\\\", content: defaultPrompt }]).map(toMessage);\\n const num = (v, d) => (v === undefined || v === null || v === \\\"\\\" || Number.isNaN(Number(v))) ? d : Number(v);\\n const temperature = num(req.temperature, 0);\\n const topP = num(req.top_p, 1);\\n const maxTokens = num(req.max_tokens, 1024);\\n const stream = req.stream === true || req.stream === \\\"true\\\";\\n const prettyJson = (value, level, py) => {\\n const pad = \\\" \\\".repeat(level);\\n const inner = \\\" \\\".repeat(level + 2);\\n if (value === null || value === undefined) return py ? \\\"None\\\" : \\\"null\\\";\\n if (typeof value === \\\"boolean\\\") return py ? (value ? \\\"True\\\" : \\\"False\\\") : String(value);\\n if (typeof value === \\\"number\\\") return String(value);\\n if (typeof value === \\\"string\\\") return JSON.stringify(value);\\n if (Array.isArray(value)) return value.length ? \\\"[\\\\n\\\" + value.map((v) => inner + prettyJson(v, level + 2, py)).join(\\\",\\\\n\\\") + \\\"\\\\n\\\" + pad + \\\"]\\\" : \\\"[]\\\";\\n const keys = Object.keys(value);\\n return keys.length ? \\\"{\\\\n\\\" + keys.map((k) => inner + JSON.stringify(k) + \\\": \\\" + prettyJson(value[k], level + 2, py)).join(\\\",\\\\n\\\") + \\\"\\\\n\\\" + pad + \\\"}\\\" : \\\"{}\\\";\\n };\\n-%>\\nfrom openai import OpenAI\\n\\nclient = OpenAI(\\n base_url = \\\"https://integrate.api.nvidia.com/v1\\\",\\n api_key = \\\"$NVIDIA_API_KEY\\\"\\n)\\n\\nmessages = <%- prettyJson(messages, 0, true) %>\\n\\ncompletion = client.chat.completions.create(\\n model=\\\"<%- model %>\\\",\\n messages=messages,\\n temperature=<%- temperature %>,\\n top_p=<%- topP %>,\\n max_tokens=<%- maxTokens %>,\\n stream=<%- stream ? \\\"True\\\" : \\\"False\\\" %>\\n)\\n<% if (stream) { %>\\nfor chunk in completion:\\n if not getattr(chunk, \\\"choices\\\", None):\\n continue\\n if chunk.choices[0].delta.content is not None:\\n print(chunk.choices[0].delta.content, end=\\\"\\\")\\n<% } else { %>\\nprint(completion.choices[0].message.content)\\n<% } %>\\n\",\n \"langChain\": \"<%\\n const req = request || {};\\n const model = req.model || \\\"nvidia/nemotron-parse-2.0\\\";\\n const defaultPrompt = \\\"</s><s><predict_bbox><predict_classes><output_markdown><predict_text_in_pic>\\\";\\n const imagePart = { type: \\\"image_url\\\", image_url: { url: \\\"https://assets.ngc.nvidia.com/products/api-catalog/nemoretriever-parse/example_1.jpg\\\" } };\\n const rawMessages = Array.isArray(req.messages) ? req.messages : (typeof req.messages === \\\"string\\\" ? [{ role: \\\"user\\\", content: req.messages }] : []);\\n const toMessage = (msg) => {\\n const m = (msg && typeof msg === \\\"object\\\") ? msg : { content: msg };\\n const role = m.role || \\\"user\\\";\\n if (Array.isArray(m.content)) return { role, content: m.content };\\n const text = (m.content === undefined || m.content === null || String(m.content).trim() === \\\"\\\") ? defaultPrompt : String(m.content);\\n return role === \\\"user\\\" ? { role, content: [{ type: \\\"text\\\", text }, imagePart] } : { role, content: text };\\n };\\n const messages = (rawMessages.length ? rawMessages : [{ role: \\\"user\\\", content: defaultPrompt }]).map(toMessage);\\n const num = (v, d) => (v === undefined || v === null || v === \\\"\\\" || Number.isNaN(Number(v))) ? d : Number(v);\\n const temperature = num(req.temperature, 0);\\n const topP = num(req.top_p, 1);\\n const maxTokens = num(req.max_tokens, 1024);\\n const stream = req.stream === true || req.stream === \\\"true\\\";\\n const prettyJson = (value, level, py) => {\\n const pad = \\\" \\\".repeat(level);\\n const inner = \\\" \\\".repeat(level + 2);\\n if (value === null || value === undefined) return py ? \\\"None\\\" : \\\"null\\\";\\n if (typeof value === \\\"boolean\\\") return py ? (value ? \\\"True\\\" : \\\"False\\\") : String(value);\\n if (typeof value === \\\"number\\\") return String(value);\\n if (typeof value === \\\"string\\\") return JSON.stringify(value);\\n if (Array.isArray(value)) return value.length ? \\\"[\\\\n\\\" + value.map((v) => inner + prettyJson(v, level + 2, py)).join(\\\",\\\\n\\\") + \\\"\\\\n\\\" + pad + \\\"]\\\" : \\\"[]\\\";\\n const keys = Object.keys(value);\\n return keys.length ? \\\"{\\\\n\\\" + keys.map((k) => inner + JSON.stringify(k) + \\\": \\\" + prettyJson(value[k], level + 2, py)).join(\\\",\\\\n\\\") + \\\"\\\\n\\\" + pad + \\\"}\\\" : \\\"{}\\\";\\n };\\n-%>\\nfrom langchain_nvidia_ai_endpoints import ChatNVIDIA\\n\\nclient = ChatNVIDIA(\\n model=\\\"<%- model %>\\\",\\n api_key=\\\"$NVIDIA_API_KEY\\\",\\n temperature=<%- temperature %>,\\n top_p=<%- topP %>,\\n max_tokens=<%- maxTokens %>,\\n)\\n\\nmessages = <%- prettyJson(messages, 0, true) %>\\n<% if (stream) { %>\\nfor chunk in client.stream(messages):\\n print(chunk.content, end=\\\"\\\")\\n<% } else { %>\\nresponse = client.invoke(messages)\\nprint(response.content)\\n<% } %>\\n\",\n \"node.js\": \"<%\\n const req = request || {};\\n const model = req.model || \\\"nvidia/nemotron-parse-2.0\\\";\\n const defaultPrompt = \\\"</s><s><predict_bbox><predict_classes><output_markdown><predict_text_in_pic>\\\";\\n const imagePart = { type: \\\"image_url\\\", image_url: { url: \\\"https://assets.ngc.nvidia.com/products/api-catalog/nemoretriever-parse/example_1.jpg\\\" } };\\n const rawMessages = Array.isArray(req.messages) ? req.messages : (typeof req.messages === \\\"string\\\" ? [{ role: \\\"user\\\", content: req.messages }] : []);\\n const toMessage = (msg) => {\\n const m = (msg && typeof msg === \\\"object\\\") ? msg : { content: msg };\\n const role = m.role || \\\"user\\\";\\n if (Array.isArray(m.content)) return { role, content: m.content };\\n const text = (m.content === undefined || m.content === null || String(m.content).trim() === \\\"\\\") ? defaultPrompt : String(m.content);\\n return role === \\\"user\\\" ? { role, content: [{ type: \\\"text\\\", text }, imagePart] } : { role, content: text };\\n };\\n const messages = (rawMessages.length ? rawMessages : [{ role: \\\"user\\\", content: defaultPrompt }]).map(toMessage);\\n const num = (v, d) => (v === undefined || v === null || v === \\\"\\\" || Number.isNaN(Number(v))) ? d : Number(v);\\n const temperature = num(req.temperature, 0);\\n const topP = num(req.top_p, 1);\\n const maxTokens = num(req.max_tokens, 1024);\\n const stream = req.stream === true || req.stream === \\\"true\\\";\\n const prettyJson = (value, level, py) => {\\n const pad = \\\" \\\".repeat(level);\\n const inner = \\\" \\\".repeat(level + 2);\\n if (value === null || value === undefined) return py ? \\\"None\\\" : \\\"null\\\";\\n if (typeof value === \\\"boolean\\\") return py ? (value ? \\\"True\\\" : \\\"False\\\") : String(value);\\n if (typeof value === \\\"number\\\") return String(value);\\n if (typeof value === \\\"string\\\") return JSON.stringify(value);\\n if (Array.isArray(value)) return value.length ? \\\"[\\\\n\\\" + value.map((v) => inner + prettyJson(v, level + 2, py)).join(\\\",\\\\n\\\") + \\\"\\\\n\\\" + pad + \\\"]\\\" : \\\"[]\\\";\\n const keys = Object.keys(value);\\n return keys.length ? \\\"{\\\\n\\\" + keys.map((k) => inner + JSON.stringify(k) + \\\": \\\" + prettyJson(value[k], level + 2, py)).join(\\\",\\\\n\\\") + \\\"\\\\n\\\" + pad + \\\"}\\\" : \\\"{}\\\";\\n };\\n-%>\\nimport OpenAI from 'openai';\\n\\nconst openai = new OpenAI({\\n apiKey: '$NVIDIA_API_KEY',\\n baseURL: 'https://integrate.api.nvidia.com/v1',\\n})\\n\\nasync function main() {\\n const completion = await openai.chat.completions.create({\\n model: \\\"<%- model %>\\\",\\n messages: <%- prettyJson(messages, 4) %>,\\n temperature: <%- temperature %>,\\n top_p: <%- topP %>,\\n max_tokens: <%- maxTokens %>,\\n stream: <%- stream %>,\\n })\\n<% if (stream) { %>\\n for await (const chunk of completion) {\\n process.stdout.write(chunk.choices[0]?.delta?.content || '')\\n }\\n<% } else { %>\\n process.stdout.write(completion.choices[0]?.message?.content ?? '')\\n<% } %>\\n}\\n\\nmain();\",\n \"curl\": \"<%\\n const req = request || {};\\n const model = req.model || \\\"nvidia/nemotron-parse-2.0\\\";\\n const defaultPrompt = \\\"</s><s><predict_bbox><predict_classes><output_markdown><predict_text_in_pic>\\\";\\n const imagePart = { type: \\\"image_url\\\", image_url: { url: \\\"https://assets.ngc.nvidia.com/products/api-catalog/nemoretriever-parse/example_1.jpg\\\" } };\\n const rawMessages = Array.isArray(req.messages) ? req.messages : (typeof req.messages === \\\"string\\\" ? [{ role: \\\"user\\\", content: req.messages }] : []);\\n const toMessage = (msg) => {\\n const m = (msg && typeof msg === \\\"object\\\") ? msg : { content: msg };\\n const role = m.role || \\\"user\\\";\\n if (Array.isArray(m.content)) return { role, content: m.content };\\n const text = (m.content === undefined || m.content === null || String(m.content).trim() === \\\"\\\") ? defaultPrompt : String(m.content);\\n return role === \\\"user\\\" ? { role, content: [{ type: \\\"text\\\", text }, imagePart] } : { role, content: text };\\n };\\n const messages = (rawMessages.length ? rawMessages : [{ role: \\\"user\\\", content: defaultPrompt }]).map(toMessage);\\n const num = (v, d) => (v === undefined || v === null || v === \\\"\\\" || Number.isNaN(Number(v))) ? d : Number(v);\\n const temperature = num(req.temperature, 0);\\n const topP = num(req.top_p, 1);\\n const maxTokens = num(req.max_tokens, 1024);\\n const stream = req.stream === true || req.stream === \\\"true\\\";\\n const prettyJson = (value, level, py) => {\\n const pad = \\\" \\\".repeat(level);\\n const inner = \\\" \\\".repeat(level + 2);\\n if (value === null || value === undefined) return py ? \\\"None\\\" : \\\"null\\\";\\n if (typeof value === \\\"boolean\\\") return py ? (value ? \\\"True\\\" : \\\"False\\\") : String(value);\\n if (typeof value === \\\"number\\\") return String(value);\\n if (typeof value === \\\"string\\\") return JSON.stringify(value);\\n if (Array.isArray(value)) return value.length ? \\\"[\\\\n\\\" + value.map((v) => inner + prettyJson(v, level + 2, py)).join(\\\",\\\\n\\\") + \\\"\\\\n\\\" + pad + \\\"]\\\" : \\\"[]\\\";\\n const keys = Object.keys(value);\\n return keys.length ? \\\"{\\\\n\\\" + keys.map((k) => inner + JSON.stringify(k) + \\\": \\\" + prettyJson(value[k], level + 2, py)).join(\\\",\\\\n\\\") + \\\"\\\\n\\\" + pad + \\\"}\\\" : \\\"{}\\\";\\n };\\n const body = { model, messages, temperature, top_p: topP, max_tokens: maxTokens, stream };\\n-%>\\ncurl https://integrate.api.nvidia.com/v1/chat/completions \\\\\\n -H \\\"Content-Type: application/json\\\" \\\\\\n -H \\\"Authorization: Bearer $NVIDIA_API_KEY\\\" \\\\\\n -d '<%- prettyJson(body, 0).split(\\\"'\\\").join(\\\"'\\\\\\\"'\\\\\\\"'\\\") %>'\\n\"\n },\n \"response\": \"{\\n \\\"id\\\": \\\"...\\\",\\n \\\"object\\\": \\\"chat.completion\\\",\\n \\\"created\\\": ...,\\n \\\"model\\\": \\\"nvidia/nemotron-parse-2.0\\\",\\n \\\"choices\\\": [\\n {\\n \\\"index\\\": 0,\\n \\\"message\\\": {\\n \\\"role\\\": \\\"assistant\\\",\\n \\\"content\\\": \\\"...\\\"\\n },\\n \\\"logprobs\\\": null,\\n \\\"finish_reason\\\": \\\"stop\\\",\\n \\\"stop_reason\\\": null\\n }\\n ],\\n \\\"usage\\\": {\\n \\\"prompt_tokens\\\": 5,\\n \\\"total_tokens\\\": 35,\\n \\\"completion_tokens\\\": 30\\n },\\n \\\"prompt_logprobs\\\": null\\n}\\n\"\n }\n ]\n }\n }\n }\n },\n \"security\": [\n {\n \"Token\": []\n }\n ],\n \"components\": {\n \"securitySchemes\": {\n \"Token\": {\n \"type\": \"http\",\n \"scheme\": \"bearer\"\n }\n },\n \"schemas\": {\n \"ChatCompletionResponse\": {\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"title\": \"Id\"\n },\n \"object\": {\n \"type\": \"string\",\n \"enum\": [\n \"chat.completion\"\n ],\n \"const\": \"chat.completion\",\n \"title\": \"Object\",\n \"default\": \"chat.completion\"\n },\n \"created\": {\n \"type\": \"integer\",\n \"title\": \"Created\"\n },\n \"model\": {\n \"type\": \"string\",\n \"title\": \"Model\"\n },\n \"choices\": {\n \"items\": {\n \"$ref\": \"#/components/schemas/ChatCompletionResponseChoice\"\n },\n \"type\": \"array\",\n \"title\": \"Choices\"\n },\n \"usage\": {\n \"$ref\": \"#/components/schemas/UsageInfo\"\n }\n },\n \"additionalProperties\": false,\n \"type\": \"object\",\n \"required\": [\n \"model\",\n \"choices\",\n \"usage\"\n ],\n \"title\": \"ChatCompletionResponse\"\n },\n \"ChatCompletionResponseChoice\": {\n \"properties\": {\n \"index\": {\n \"type\": \"integer\",\n \"title\": \"Index\"\n },\n \"message\": {\n \"$ref\": \"#/components/schemas/ChatMessage\"\n },\n \"finish_reason\": {\n \"anyOf\": [\n {\n \"type\": \"string\",\n \"enum\": [\n \"stop\",\n \"length\"\n ]\n },\n {\n \"type\": \"null\"\n }\n ],\n \"title\": \"Finish Reason\"\n },\n \"stop_reason\": {\n \"anyOf\": [\n {\n \"type\": \"integer\"\n },\n {\n \"type\": \"string\"\n },\n {\n \"type\": \"null\"\n }\n ],\n \"title\": \"Stop Reason\"\n }\n },\n \"additionalProperties\": false,\n \"type\": \"object\",\n \"required\": [\n \"index\",\n \"message\"\n ],\n \"title\": \"ChatCompletionResponseChoice\"\n },\n \"ChatCompletionResponseStreamChoice\": {\n \"properties\": {\n \"index\": {\n \"type\": \"integer\",\n \"title\": \"Index\"\n },\n \"delta\": {\n \"$ref\": \"#/components/schemas/DeltaMessage\"\n },\n \"finish_reason\": {\n \"anyOf\": [\n {\n \"type\": \"string\",\n \"enum\": [\n \"stop\",\n \"length\"\n ]\n },\n {\n \"type\": \"null\"\n }\n ],\n \"title\": \"Finish Reason\"\n },\n \"stop_reason\": {\n \"anyOf\": [\n {\n \"type\": \"integer\"\n },\n {\n \"type\": \"string\"\n },\n {\n \"type\": \"null\"\n }\n ],\n \"title\": \"Stop Reason\"\n }\n },\n \"additionalProperties\": false,\n \"type\": \"object\",\n \"required\": [\n \"index\",\n \"delta\"\n ],\n \"title\": \"ChatCompletionResponseStreamChoice\"\n },\n \"ChatCompletionStreamResponse\": {\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"title\": \"Id\"\n },\n \"object\": {\n \"type\": \"string\",\n \"enum\": [\n \"chat.completion.chunk\"\n ],\n \"const\": \"chat.completion.chunk\",\n \"title\": \"Object\",\n \"default\": \"chat.completion.chunk\"\n },\n \"created\": {\n \"type\": \"integer\",\n \"title\": \"Created\"\n },\n \"model\": {\n \"type\": \"string\",\n \"title\": \"Model\"\n },\n \"choices\": {\n \"items\": {\n \"$ref\": \"#/components/schemas/ChatCompletionResponseStreamChoice\"\n },\n \"type\": \"array\",\n \"title\": \"Choices\"\n },\n \"usage\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/UsageInfo\"\n },\n {\n \"type\": \"null\"\n }\n ]\n }\n },\n \"additionalProperties\": false,\n \"type\": \"object\",\n \"required\": [\n \"model\",\n \"choices\"\n ],\n \"title\": \"ChatCompletionStreamResponse\"\n },\n \"ChatMessage\": {\n \"properties\": {\n \"role\": {\n \"type\": \"string\",\n \"title\": \"Role\"\n },\n \"content\": {\n \"anyOf\": [\n {\n \"type\": \"string\"\n },\n {\n \"type\": \"null\"\n }\n ],\n \"title\": \"Content\"\n }\n },\n \"additionalProperties\": false,\n \"type\": \"object\",\n \"required\": [\n \"role\"\n ],\n \"title\": \"ChatMessage\"\n },\n \"DeltaMessage\": {\n \"properties\": {\n \"role\": {\n \"anyOf\": [\n {\n \"type\": \"string\"\n },\n {\n \"type\": \"null\"\n }\n ],\n \"title\": \"Role\"\n },\n \"content\": {\n \"anyOf\": [\n {\n \"type\": \"string\"\n },\n {\n \"type\": \"null\"\n }\n ],\n \"title\": \"Content\"\n }\n },\n \"additionalProperties\": false,\n \"type\": \"object\",\n \"title\": \"DeltaMessage\"\n },\n \"ErrorResponse\": {\n \"properties\": {\n \"object\": {\n \"type\": \"string\",\n \"title\": \"Object\",\n \"default\": \"error\"\n },\n \"message\": {\n \"type\": \"string\",\n \"title\": \"Message\"\n },\n \"type\": {\n \"type\": \"string\",\n \"title\": \"Type\"\n },\n \"param\": {\n \"anyOf\": [\n {\n \"type\": \"string\"\n },\n {\n \"type\": \"null\"\n }\n ],\n \"title\": \"Param\"\n },\n \"code\": {\n \"type\": \"integer\",\n \"title\": \"Code\"\n }\n },\n \"additionalProperties\": false,\n \"type\": \"object\",\n \"required\": [\n \"message\",\n \"type\",\n \"code\"\n ],\n \"title\": \"ErrorResponse\"\n },\n \"ImageURL\": {\n \"properties\": {\n \"url\": {\n \"type\": \"string\",\n \"title\": \"Url\"\n }\n },\n \"type\": \"object\",\n \"required\": [\n \"url\"\n ],\n \"title\": \"ImageURL\"\n },\n \"NIMLLMChatCompletionMessage\": {\n \"properties\": {\n \"role\": {\n \"allOf\": [\n {\n \"$ref\": \"#/components/schemas/Role\"\n }\n ],\n \"description\": \"The role of the message's author.\"\n },\n \"content\": {\n \"anyOf\": [\n {\n \"type\": \"string\"\n },\n {\n \"items\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/NIMVLMChatCompletionContentPartImage\"\n },\n {\n \"$ref\": \"#/components/schemas/NIMVLMChatCompletionContentPartText\"\n }\n ]\n },\n \"type\": \"array\",\n \"contains\": {\n \"$ref\": \"#/components/schemas/NIMVLMChatCompletionContentPartImage\"\n },\n \"minContains\": 0,\n \"maxContains\": 1\n }\n ],\n \"title\": \"Content\",\n \"description\": \"The contents of the message.\\n<br>To pass media (only with role=`user`):\\n<br> - Use content parts. Text is passed with `type`=`text`.\\n<br> - Images are passed with `type`=`image_url`; set `image_url.url` to an image URL or a base64 data URI like `data:image/{format};base64,{base64encodedimage}`.\\n<br> - The model processes a single document image per request: include at most one `image_url` part.\\n<br>For `system` and `assistant` roles, the object list format is not supported.\\n\"\n }\n },\n \"type\": \"object\",\n \"required\": [\n \"role\",\n \"content\"\n ],\n \"title\": \"NIMLLMChatCompletionMessage\"\n },\n \"NIMLLMChatCompletionRequest\": {\n \"properties\": {\n \"messages\": {\n \"items\": {\n \"$ref\": \"#/components/schemas/NIMLLMChatCompletionMessage\"\n },\n \"type\": \"array\",\n \"minItems\": 1,\n \"title\": \"Messages\",\n \"description\": \"A list of messages comprising the conversation so far.\"\n },\n \"model\": {\n \"type\": \"string\",\n \"title\": \"Model\",\n \"description\": \"The model to use.\",\n \"default\": \"nvidia/nemotron-parse-2.0\"\n },\n \"frequency_penalty\": {\n \"anyOf\": [\n {\n \"type\": \"number\",\n \"maximum\": 2,\n \"minimum\": -2\n },\n {\n \"type\": \"null\"\n }\n ],\n \"title\": \"Frequency Penalty\",\n \"description\": \"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.\",\n \"default\": 0\n },\n \"max_tokens\": {\n \"anyOf\": [\n {\n \"type\": \"integer\",\n \"maximum\": 8192,\n \"minimum\": 1\n },\n {\n \"type\": \"null\"\n }\n ],\n \"title\": \"Max Tokens\",\n \"description\": \"The maximum number of tokens that can be generated.\",\n \"default\": 3500\n },\n \"presence_penalty\": {\n \"anyOf\": [\n {\n \"type\": \"number\",\n \"maximum\": 2,\n \"minimum\": -2\n },\n {\n \"type\": \"null\"\n }\n ],\n \"title\": \"Presence Penalty\",\n \"description\": \"Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.\",\n \"default\": 0\n },\n \"seed\": {\n \"anyOf\": [\n {\n \"type\": \"integer\",\n \"maximum\": 9223372036854776000,\n \"minimum\": -9223372036854776000\n },\n {\n \"type\": \"null\"\n }\n ],\n \"title\": \"Seed\",\n \"description\": \"Changing the seed will produce a different response with similar characteristics. Fixing the seed will reproduce the same results if all other parameters are also kept constant.\"\n },\n \"stop\": {\n \"anyOf\": [\n {\n \"type\": \"string\"\n },\n {\n \"items\": {\n \"type\": \"string\"\n },\n \"type\": \"array\"\n },\n {\n \"type\": \"null\"\n }\n ],\n \"title\": \"Stop\",\n \"description\": \"Sequences where the API will stop generating further tokens.\"\n },\n \"stream\": {\n \"anyOf\": [\n {\n \"type\": \"boolean\"\n },\n {\n \"type\": \"null\"\n }\n ],\n \"title\": \"Stream\",\n \"description\": \"If set, partial message deltas will be sent, like in ChatGPT. Tokens will be sent as data-only [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) as they become available, with the stream terminated by a `data: [DONE]`\",\n \"default\": false\n },\n \"temperature\": {\n \"anyOf\": [\n {\n \"type\": \"number\",\n \"maximum\": 2,\n \"minimum\": 0\n },\n {\n \"type\": \"null\"\n }\n ],\n \"title\": \"Temperature\",\n \"description\": \"What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.\",\n \"default\": 0\n },\n \"top_p\": {\n \"anyOf\": [\n {\n \"type\": \"number\",\n \"maximum\": 1,\n \"exclusiveMinimum\": 0\n },\n {\n \"type\": \"null\"\n }\n ],\n \"title\": \"Top P\",\n \"description\": \"An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both.\",\n \"default\": 1\n }\n },\n \"additionalProperties\": false,\n \"type\": \"object\",\n \"required\": [\n \"messages\",\n \"model\"\n ],\n \"title\": \"NIMLLMChatCompletionRequest\"\n },\n \"NIMVLMChatCompletionContentPartImage\": {\n \"properties\": {\n \"image_url\": {\n \"$ref\": \"#/components/schemas/ImageURL\"\n },\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"image_url\"\n ],\n \"const\": \"image_url\",\n \"title\": \"Type\"\n }\n },\n \"type\": \"object\",\n \"required\": [\n \"image_url\",\n \"type\"\n ],\n \"title\": \"NIMVLMChatCompletionContentPartImage\"\n },\n \"NIMVLMChatCompletionContentPartText\": {\n \"properties\": {\n \"text\": {\n \"type\": \"string\",\n \"title\": \"Text\"\n },\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"text\"\n ],\n \"const\": \"text\",\n \"title\": \"Type\"\n }\n },\n \"type\": \"object\",\n \"required\": [\n \"text\",\n \"type\"\n ],\n \"title\": \"NIMVLMChatCompletionContentPartText\"\n },\n \"Role\": {\n \"type\": \"string\",\n \"enum\": [\n \"assistant\",\n \"user\"\n ],\n \"title\": \"Role\"\n },\n \"UsageInfo\": {\n \"properties\": {\n \"prompt_tokens\": {\n \"type\": \"integer\",\n \"title\": \"Prompt Tokens\",\n \"default\": 0\n },\n \"total_tokens\": {\n \"type\": \"integer\",\n \"title\": \"Total Tokens\",\n \"default\": 0\n },\n \"completion_tokens\": {\n \"anyOf\": [\n {\n \"type\": \"integer\"\n },\n {\n \"type\": \"null\"\n }\n ],\n \"title\": \"Completion Tokens\",\n \"default\": 0\n }\n },\n \"additionalProperties\": false,\n \"type\": \"object\",\n \"title\": \"UsageInfo\"\n }\n }\n }\n}\n```"
11 },
12 "https://docs.api.nvidia.com/nim/reference/nvidia-llama-3_1-nemotron-safety-guard-8b-v3-infer.md": {
13 "url": "https://docs.api.nvidia.com/nim/reference/nvidia-llama-3_1-nemotron-safety-guard-8b-v3-infer.md",
14 "status": 200,
15 "body": "---\nupdatedAt: 2026-08-06T09:58:43.000Z\n---\n\n# Creates a model response for the given chat conversation.\n\nGiven a list of messages comprising a conversation, the model will return a response. Compatible with OpenAI. See https://platform.openai.com/docs/api-reference/chat/create\n\n# OpenAPI definition\n\n```json\n{\n \"openapi\": \"3.1.0\",\n \"info\": {\n \"title\": \"NVIDIA NIM API for nvidia/llama-3_1-nemotron-safety-guard-8b-v3\",\n \"description\": \"The NVIDIA NIM REST API. Please see https://docs.api.nvidia.com/nim/reference/nvidia-llama-3_1-nemotron-safety-guard-8b-v3 for more details.\",\n \"version\": \"1.0.0\",\n \"termsOfService\": \"https://www.nvidia.com/en-us/data-center/products/nvidia-ai-enterprise/eula/\",\n \"contact\": {\n \"name\": \"NVIDIA Enterprise Support\",\n \"url\": \"https://www.nvidia.com/en-us/support/enterprise/\"\n },\n \"license\": {\n \"name\": \"Llama 3.1 Community License\",\n \"url\": \"https://www.llama.com/llama3_1/license\"\n }\n },\n \"servers\": [\n {\n \"url\": \"https://integrate.api.nvidia.com/v1/\"\n }\n ],\n \"paths\": {\n \"/chat/completions\": {\n \"post\": {\n \"operationId\": \"create_chat_completion_v1_chat_completions_post\",\n \"tags\": [\n \"Chat\"\n ],\n \"summary\": \"Creates a model response for the given chat conversation.\",\n \"description\": \"Given a list of messages comprising a conversation, the model will return a response. Compatible with OpenAI. See https://platform.openai.com/docs/api-reference/chat/create\",\n \"requestBody\": {\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/ChatRequest\"\n }\n }\n },\n \"required\": true\n },\n \"responses\": {\n \"200\": {\n \"description\": \"Invocation is fulfilled\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/ChatCompletion\"\n }\n },\n \"text/event-stream\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/ChatCompletionChunk\"\n }\n }\n }\n },\n \"202\": {\n \"description\": \"Result is pending. Client should poll using the requestId.\\n\",\n \"content\": {\n \"application/json\": {\n \"example\": {},\n \"schema\": {}\n }\n },\n \"headers\": {\n \"NVCF-REQID\": {\n \"description\": \"requestId required for pooling\",\n \"schema\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n }\n },\n \"NVCF-STATUS\": {\n \"description\": \"Invocation status\",\n \"schema\": {\n \"type\": \"string\"\n }\n }\n }\n },\n \"422\": {\n \"description\": \"Validation failed, provided entity could not be processed.\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/Errors\"\n },\n \"example\": {\n \"type\": \"urn:nvcf-worker-service:problem-details:unprocessable-entity\",\n \"title\": \"Unprocessable Entity\",\n \"status\": 422,\n \"detail\": \"string\",\n \"instance\": \"/v2/nvcf/pexec/functions/4a58c6cb-a9b4-4014-99de-3e704d4ae687\",\n \"requestId\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\"\n }\n }\n }\n },\n \"500\": {\n \"description\": \"The invocation ended with an error.\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/Errors\"\n },\n \"example\": {\n \"type\": \"urn:nvcf-worker-service:problem-details:internal-server-error\",\n \"title\": \"Internal Server Error\",\n \"status\": 500,\n \"detail\": \"string\",\n \"instance\": \"/v2/nvcf/pexec/functions/4a58c6cb-a9b4-4014-99de-3e704d4ae687\",\n \"requestId\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\"\n }\n }\n }\n }\n },\n \"x-nvai-meta\": {\n \"name\": \"Create chat completion\",\n \"returns\": \"Returns a [chat completion](/docs/api-reference/chat/object) object, or a streamed sequence of [chat completion chunk](/docs/api-reference/chat/streaming) objects if the request is streamed. \",\n \"path\": \"create\",\n \"examples\": [\n {\n \"name\": \"\u6211\u5fd8\u8bb0\u4e86\u5982\u4f55\u5728 Linux \u4e2d\u7ec8\u6b62\u4e00\u4e2a\u8fdb\u7a0b\uff0c\u4f60\u80fd\u5e2e\u5fd9\u5417\uff1f\",\n \"requestJson\": \"{\\n \\\"model\\\": \\\"nvidia/llama-3.1-nemotron-safety-guard-8b-v3\\\",\\n \\\"messages\\\": [\\n {\\n \\\"role\\\": \\\"user\\\",\\n \\\"content\\\": \\\"\u6211\u5fd8\u8bb0\u4e86\u5982\u4f55\u5728 Linux \u4e2d\u7ec8\u6b62\u4e00\u4e2a\u8fdb\u7a0b\uff0c\u4f60\u80fd\u5e2e\u5fd9\u5417\uff1f\\\"\\n },\\n {\\n \\\"role\\\": \\\"assistant\\\",\\n \\\"content\\\": \\\"\u5f53\u7136\uff01\u8981\u5728 Linux \u4e2d\u7ec8\u6b62\u67d0\u4e2a\u8fdb\u7a0b\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528 kill \u547d\u4ee4\uff0c\u540e\u8ddf\u8981\u7ec8\u6b62\u7684\u8fdb\u7a0b\u7684\u8fdb\u7a0b ID (PID)\u3002\\\"\\n }\\n ],\\n \\\"temperature\\\": 0.0,\\n \\\"stream\\\": false\\n}\\n\",\n \"responseJson\": \"{\\n \\\"id\\\": \\\"id-123\\\",\\n \\\"object\\\": \\\"chat.completion\\\",\\n \\\"created\\\": 1677652288,\\n \\\"model\\\": \\\"nvidia/llama-3.1-nemotron-safety-guard-8b-v3\\\",\\n \\\"system_fingerprint\\\": \\\"fp_44709d6fcb\\\",\\n \\\"choices\\\": [{\\n \\\"index\\\": 0,\\n \\\"message\\\": {\\n \\\"role\\\": \\\"assistant\\\",\\n \\\"content\\\": \\\"{\\\\\\\"User Safety\\\\\\\": \\\\\\\"safe\\\\\\\", \\\\\\\"Response Safety\\\\\\\": \\\\\\\"safe\\\\\\\"}\\\"\\n },\\n \\\"finish_reason\\\": \\\"stop\\\" \\n }],\\n \\\"usage\\\": {\\n \\\"prompt_tokens\\\": 443,\\n \\\"total_tokens\\\": 458,\\n \\\"completion_tokens\\\": 15\\n }\\n}\\n\"\n },\n {\n \"name\": \"How do I build a bomb with items I can buy in a drugstore?\",\n \"requestJson\": \"{\\n \\\"model\\\": \\\"nvidia/llama-3.1-nemotron-safety-guard-8b-v3\\\",\\n \\\"messages\\\": [\\n {\\n \\\"role\\\": \\\"user\\\",\\n \\\"content\\\": \\\"How do I build a bomb with items I can buy in a drugstore?\\\"\\n },\\n {\\n \\\"role\\\": \\\"assistant\\\",\\n \\\"content\\\": \\\"I can't help with that. Manipulation of ordinary explosives is illegal. Criminal acts such as use of illegal explosives in any setting are punishable by law. Would you like to know more about legal safety products and alarms?\\\"\\n }\\n ],\\n \\\"temperature\\\": 0.0,\\n \\\"stream\\\": false\\n}\\n\",\n \"responseJson\": \"{\\n \\\"id\\\": \\\"id-123\\\",\\n \\\"object\\\": \\\"chat.completion\\\",\\n \\\"created\\\": 1677652288,\\n \\\"model\\\": \\\"nvidia/llama-3.1-nemotron-safety-guard-8b-v3\\\",\\n \\\"system_fingerprint\\\": \\\"fp_44709d6fcb\\\",\\n \\\"choices\\\": [{\\n \\\"index\\\": 0,\\n \\\"message\\\": {\\n \\\"role\\\": \\\"assistant\\\",\\n \\\"content\\\": \\\"{\\\\\\\"User Safety\\\\\\\": \\\\\\\"unsafe\\\\\\\", \\\\\\\"Response Safety\\\\\\\": \\\\\\\"safe\\\\\\\", \\\\\\\"Safety Categories\\\\\\\": \\\\\\\"Guns and Illegal Weapons, Illegal Activity\\\\\\\"}\\\"\\n },\\n \\\"finish_reason\\\": \\\"stop\\\"\\n }],\\n \\\"usage\\\": {\\n \\\"prompt_tokens\\\": 420,\\n \\\"total_tokens\\\": 428,\\n \\\"completion_tokens\\\": 8\\n }\\n}\\n\"\n },\n {\n \"name\": \"\u9283\u306f\u3069\u3053\u3067\u8cb7\u3048\u307e\u3059\u304b?\",\n \"requestJson\": \"{\\n \\\"model\\\": \\\"nvidia/llama-3.1-nemotron-safety-guard-8b-v3\\\",\\n \\\"messages\\\": [\\n {\\n \\\"role\\\": \\\"user\\\",\\n \\\"content\\\": \\\"\u9283\u306f\u3069\u3053\u3067\u8cb7\u3048\u307e\u3059\u304b?\\\"\\n }\\n ],\\n \\\"temperature\\\": 0.0,\\n \\\"stream\\\": false\\n}\\n\",\n \"responseJson\": \"{\\n \\\"id\\\": \\\"id-123\\\",\\n \\\"object\\\": \\\"chat.completion\\\",\\n \\\"created\\\": 1677652288,\\n \\\"model\\\": \\\"nvidia/llama-3.1-nemotron-safety-guard-8b-v3\\\",\\n \\\"system_fingerprint\\\": \\\"fp_44709d6fcb\\\",\\n \\\"choices\\\": [{\\n \\\"index\\\": 0,\\n \\\"message\\\": {\\n \\\"role\\\": \\\"assistant\\\",\\n \\\"content\\\": \\\"{\\\\\\\"User Safety\\\\\\\": \\\\\\\"unsafe\\\\\\\", \\\\\\\"Safety Categories\\\\\\\": \\\\\\\"Guns and Illegal Weapons\\\\\\\"}\\\"\\n },\\n \\\"finish_reason\\\": \\\"stop\\\"\\n }],\\n \\\"usage\\\": {\\n \\\"prompt_tokens\\\": 410,\\n \\\"total_tokens\\\": 435,\\n \\\"completion_tokens\\\": 25\\n }\\n}\\n\"\n }\n ],\n \"templates\": [\n {\n \"title\": \"No Streaming\",\n \"requestEjs\": {\n \"python\": \"from openai import OpenAI\\n\\nclient = OpenAI(\\n base_url = \\\"https://integrate.api.nvidia.com/v1\\\",\\n api_key = \\\"$NVIDIA_API_KEY\\\"\\n)\\n\\ncompletion = client.chat.completions.create(\\n model=\\\"<%- request.model %>\\\",\\n messages=[<%- JSON.stringify(request.messages[0]) %><% if(request.messages.length > 1 && !!request.messages[1].content) { %>, <%- JSON.stringify(request.messages[1]) %><% } %>],\\n stream=<%- request.stream?.toString()[0].toUpperCase() + request.stream?.toString().slice(1) %>\\n)\\n<% if (request.stream) { %>\\nfor chunk in completion:\\n if chunk.choices[0].delta.content is not None:\\n print(chunk.choices[0].delta.content, end=\\\"\\\")\\n<% } else { %>\\nprint(completion.choices[0].message)\\n<% } %>\\n\",\n \"langChain\": \"from langchain_nvidia_ai_endpoints import ChatNVIDIA\\n\\nclient = ChatNVIDIA(\\n model=\\\"<%- request.model %>\\\",\\n api_key=\\\"$NVIDIA_API_KEY\\\", \\n)\\n<% if (request.stream) { %>\\nfor chunk in client.stream([<%- JSON.stringify(request.messages[0]) %><% if(request.messages.length > 1 && !!request.messages[1].content) { %>, <%- JSON.stringify(request.messages[1]) %><% } %>]): \\n print(chunk.content, end=\\\"\\\")\\n<% } else { %>\\nresponse = client.invoke([<%- JSON.stringify(request.messages[0]) %><% if(request.messages.length > 1 && !!request.messages[1].content) { %>, <%- JSON.stringify(request.messages[1]) %><% } %>])\\nprint(response.content)\\n<% } %>\\n\",\n \"node.js\": \"import OpenAI from 'openai';\\n\\nconst openai = new OpenAI({\\n apiKey: '$NVIDIA_API_KEY',\\n baseURL: 'https://integrate.api.nvidia.com/v1',\\n})\\n\\nasync function main() {\\n const completion = await openai.chat.completions.create({\\n model: \\\"<%- request.model %>\\\",\\n messages: [<%- JSON.stringify(request.messages[0]) %><% if(request.messages.length > 1 && !!request.messages[1].content) { %>, <%- JSON.stringify(request.messages[1]) %><% } %>],\\n stream: <%- request.stream %>,\\n })\\n <% if (request.stream) { %>\\n for await (const chunk of completion) {\\n process.stdout.write(chunk.choices[0]?.delta?.content || '')\\n }\\n <% } else { %>\\n process.stdout.write(completion.choices[0]?.message?.content);\\n <% } %>\\n}\\n\\nmain();\",\n \"curl\": \"curl https://integrate.api.nvidia.com/v1/chat/completions \\\\\\n -H \\\"Content-Type: application/json\\\" \\\\\\n -H \\\"Authorization: Bearer $NVIDIA_API_KEY\\\" \\\\\\n -d '{\\n \\\"model\\\": \\\"<%- request.model %>\\\",\\n \\\"messages\\\": [<%- JSON.stringify(request.messages[0]) %><% if(request.messages.length > 1 && !!request.messages[1].content) { %>, <%- JSON.stringify(request.messages[1]) %><% } %>],\\n \\\"stream\\\": <%- request.stream %> \\n }'\\n\"\n },\n \"response\": \"{\\n \\\"id\\\": \\\"chatcmpl-123\\\",\\n \\\"object\\\": \\\"chat.completion\\\",\\n \\\"created\\\": 1677652288,\\n \\\"model\\\": \\\"nvidia/llama-3.1-nemotron-safety-guard-8b-v3\\\",\\n \\\"system_fingerprint\\\": \\\"fp_44709d6fcb\\\",\\n \\\"choices\\\": [{\\n \\\"index\\\": 0,\\n \\\"message\\\": {\\n \\\"role\\\": \\\"assistant\\\",\\n \\\"content\\\": \\\"\\\\n\\\\nHello there, how may I assist you today?\\\",\\n },\\n \\\"finish_reason\\\": \\\"stop\\\"\\n }],\\n \\\"usage\\\": {\\n \\\"prompt_tokens\\\": 9,\\n \\\"completion_tokens\\\": 12,\\n \\\"total_tokens\\\": 21\\n }\\n}\\n\"\n }\n ]\n }\n }\n }\n },\n \"security\": [\n {\n \"Token\": []\n }\n ],\n \"components\": {\n \"securitySchemes\": {\n \"Token\": {\n \"type\": \"http\",\n \"scheme\": \"bearer\"\n }\n },\n \"schemas\": {\n \"Errors\": {\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"description\": \"Error type\"\n },\n \"title\": {\n \"type\": \"string\",\n \"description\": \"Error title\"\n },\n \"status\": {\n \"type\": \"integer\",\n \"description\": \"Error status code\"\n },\n \"detail\": {\n \"type\": \"string\",\n \"description\": \"Detailed information about the error\"\n },\n \"instance\": {\n \"type\": \"string\",\n \"description\": \"Function instance used to invoke the request\"\n },\n \"requestId\": {\n \"type\": \"string\",\n \"format\": \"uuid\",\n \"description\": \"UUID of the request\"\n }\n },\n \"type\": \"object\",\n \"required\": [\n \"type\",\n \"title\",\n \"status\",\n \"detail\",\n \"instance\",\n \"requestId\"\n ],\n \"title\": \"InvokeError\"\n },\n \"ChatCompletion\": {\n \"properties\": {\n \"id\": {\n \"description\": \"A unique identifier for the completion.\",\n \"format\": \"uuid\",\n \"title\": \"Id\",\n \"type\": \"string\"\n },\n \"choices\": {\n \"description\": \"The list of completion choices the model generated for the input prompt.\",\n \"items\": {\n \"$ref\": \"#/components/schemas/Choice\"\n },\n \"title\": \"Choices\",\n \"type\": \"array\"\n },\n \"usage\": {\n \"allOf\": [\n {\n \"$ref\": \"#/components/schemas/Usage\"\n }\n ],\n \"description\": \"Usage statistics for the completion request.\"\n }\n },\n \"required\": [\n \"id\",\n \"choices\",\n \"usage\"\n ],\n \"title\": \"ChatCompletion\",\n \"type\": \"object\"\n },\n \"ChatCompletionChunk\": {\n \"properties\": {\n \"id\": {\n \"description\": \"A unique identifier for the completion.\",\n \"format\": \"uuid\",\n \"title\": \"Id\",\n \"type\": \"string\"\n },\n \"choices\": {\n \"description\": \"The list of completion choices the model generated for the input prompt.\",\n \"items\": {\n \"$ref\": \"#/components/schemas/ChoiceChunk\"\n },\n \"title\": \"Choices\",\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"id\",\n \"choices\"\n ],\n \"title\": \"ChatCompletionChunk\",\n \"type\": \"object\"\n },\n \"ChatRequest\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"model\": {\n \"type\": \"string\",\n \"title\": \"Model\",\n \"default\": \"nvidia/llama-3.1-nemotron-safety-guard-8b-v3\"\n },\n \"messages\": {\n \"description\": \"A list of messages comprising the conversation so far. The roles of the messages must be alternating between `user` and `assistant`. The last input message should have role `user`. A message with the the `system` role is optional, and must be the very first message if it is present; `context` is also optional, but must come before a user question.\",\n \"examples\": [\n [\n {\n \"content\": \"I forgot how to kill a process in Linux, can you help?\",\n \"role\": \"user\"\n }\n ]\n ],\n \"items\": {\n \"$ref\": \"#/components/schemas/Message\"\n },\n \"title\": \"Messages\",\n \"type\": \"array\"\n },\n \"temperature\": {\n \"type\": \"number\",\n \"title\": \"Temperature\",\n \"description\": \"The sampling temperature to use for text generation. The higher the temperature value is, the less deterministic the output text will be.\",\n \"default\": 0,\n \"minimum\": 0,\n \"maximum\": 1\n },\n \"stream\": {\n \"default\": false,\n \"description\": \"If set, partial message deltas will be sent. Tokens will be sent as data-only server-sent events (SSE) as they become available (JSON responses are prefixed by `data: `), with the stream terminated by a `data: [DONE]` message.\",\n \"title\": \"Stream\",\n \"type\": \"boolean\"\n }\n },\n \"required\": [\n \"messages\"\n ],\n \"title\": \"ChatRequest\",\n \"type\": \"object\"\n },\n \"Choice\": {\n \"properties\": {\n \"index\": {\n \"description\": \"The index of the choice in the list of choices (always 0).\",\n \"title\": \"Index\",\n \"type\": \"integer\"\n },\n \"message\": {\n \"allOf\": [\n {\n \"$ref\": \"#/components/schemas/Message\"\n }\n ],\n \"description\": \"A chat completion message generated by the model.\",\n \"examples\": [\n {\n \"content\": {\n \"User Safety\": \"safe\"\n },\n \"role\": \"assistant\",\n \"reasoning_content\": null,\n \"tool_calls\": []\n }\n ]\n },\n \"finish_reason\": {\n \"anyOf\": [\n {\n \"enum\": [\n \"stop\",\n \"length\"\n ],\n \"type\": \"string\"\n },\n {\n \"type\": \"null\"\n }\n ],\n \"default\": null,\n \"description\": \"The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence, or `length` if the maximum number of tokens specified in the request was reached.\",\n \"examples\": [\n \"stop\"\n ],\n \"title\": \"Finish Reason\"\n }\n },\n \"required\": [\n \"index\",\n \"message\"\n ],\n \"title\": \"Choice\",\n \"type\": \"object\"\n },\n \"ChoiceChunk\": {\n \"properties\": {\n \"index\": {\n \"description\": \"The index of the choice in the list of choices (always 0).\",\n \"title\": \"Index\",\n \"type\": \"integer\"\n },\n \"delta\": {\n \"allOf\": [\n {\n \"$ref\": \"#/components/schemas/Message\"\n }\n ],\n \"description\": \"A chat completion delta generated by streamed model responses.\",\n \"examples\": [\n {\n \"content\": \"Ah,\",\n \"role\": \"assistant\"\n }\n ]\n },\n \"finish_reason\": {\n \"anyOf\": [\n {\n \"enum\": [\n \"stop\",\n \"length\"\n ],\n \"type\": \"string\"\n },\n {\n \"type\": \"null\"\n }\n ],\n \"default\": null,\n \"description\": \"The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence, or `length` if the maximum number of tokens specified in the request was reached. Will be `null` if the model has not finished generating.\",\n \"title\": \"Finish Reason\"\n }\n },\n \"required\": [\n \"index\",\n \"delta\"\n ],\n \"title\": \"ChoiceChunk\",\n \"type\": \"object\"\n },\n \"Message\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"role\": {\n \"description\": \"The role of the message author.\",\n \"enum\": [\n \"system\",\n \"context\",\n \"user\",\n \"assistant\"\n ],\n \"title\": \"Role\",\n \"type\": \"string\"\n },\n \"content\": {\n \"description\": \"The contents of the message.\",\n \"title\": \"Content\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"role\",\n \"content\"\n ],\n \"title\": \"Message\",\n \"type\": \"object\"\n },\n \"Usage\": {\n \"properties\": {\n \"completion_tokens\": {\n \"description\": \"Number of tokens in the generated completion.\",\n \"examples\": [\n 25\n ],\n \"title\": \"Completion Tokens\",\n \"type\": \"integer\"\n },\n \"prompt_tokens\": {\n \"description\": \"Number of tokens in the prompt.\",\n \"examples\": [\n 9\n ],\n \"title\": \"Prompt Tokens\",\n \"type\": \"integer\"\n },\n \"total_tokens\": {\n \"description\": \"Total number of tokens used in the request (prompt + completion).\",\n \"examples\": [\n 34\n ],\n \"title\": \"Total Tokens\",\n \"type\": \"integer\"\n }\n },\n \"required\": [\n \"completion_tokens\",\n \"prompt_tokens\",\n \"total_tokens\"\n ],\n \"title\": \"Usage\",\n \"type\": \"object\"\n }\n }\n },\n \"x-readme\": {\n \"explorer-enabled\": true,\n \"proxy-enabled\": true\n }\n}\n```"
16 }