-
Notifications
You must be signed in to change notification settings - Fork 603
Expand file tree
/
Copy pathconfig.yml
More file actions
77 lines (71 loc) · 2.58 KB
/
config.yml
File metadata and controls
77 lines (71 loc) · 2.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Example configuration for testing the OpenAI Responses API endpoint format.
#
# This config demonstrates using the FastAPI frontend's /v1/responses endpoint
# which accepts the OpenAI Responses API format (with 'input' field) and routes
# requests through a standard tool_calling_agent workflow.
#
# NOTE: The Responses API format is provided for pass-through compatibility.
# NAT agents do not inherently support stateful backends; features like
# 'previous_response_id' will be ignored.
#
# Prerequisites:
# uv pip install -e '.[langchain]' # Required for tool_calling_agent
# export NVIDIA_API_KEY=<YOUR_KEY>
#
# Usage:
# nat serve --config_file examples/front_ends/responses_api_endpoint/configs/config.yml
#
# Test with curl (Responses API format):
# curl -X POST http://localhost:8088/v1/responses \
# -H 'Content-Type: application/json' \
# -d '{"model": "gpt-4o-mini", "input": "What time is it?"}'
#
# Test with curl (Streaming):
# curl -X POST http://localhost:8088/v1/responses \
# -H 'Content-Type: application/json' \
# -d '{"model": "gpt-4o-mini", "input": "What time is it?", "stream": true}'
#
# The /generate and /chat endpoints still use the Chat Completions format:
# curl -X POST http://localhost:8088/generate \
# -H 'Content-Type: application/json' \
# -d '{"messages": [{"role": "user", "content": "What time is it?"}]}'
general:
use_uvloop: true
front_end:
_type: fastapi
port: 8088
workflow:
method: POST
path: /generate
openai_api_path: /chat
openai_api_v1_path: /v1/responses
description: "Test OpenAI Responses API endpoint format"
llms:
nim_llm:
_type: nim
model_name: meta/llama-3.1-70b-instruct
temperature: 0.0
max_tokens: 250
functions:
current_datetime:
_type: current_datetime
workflow:
_type: tool_calling_agent
llm_name: nim_llm
tool_names: [current_datetime]
verbose: true
handle_tool_errors: true