Skip to content

Commit 91ef98f

Browse files
committed
add metadata config to all config files and add endpoint logic
Signed-off-by: Zvi Grinberg <zgrinber@redhat.com>
1 parent 3b6b998 commit 91ef98f

3 files changed

Lines changed: 59 additions & 2 deletions

File tree

kustomize/base/exploit-iq-config.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ general:
2121
method: GET
2222
description: Perform a health check.
2323
function_name: health_check
24+
- path: /metadata
25+
method: GET
26+
description: "Gets the metadata tags of the agent"
27+
function_name: get_agent_metadata
2428
use_uvloop: true
2529
telemetry:
2630
tracing:
@@ -144,7 +148,8 @@ functions:
144148
insist_analysis: false
145149
health_check:
146150
_type: health_check
147-
151+
get_agent_metadata:
152+
_type: get_agent_metadata
148153
llms:
149154
checklist_llm:
150155
_type: ${LLM_TYPE_CHECKLIST:-nim}

src/vuln_analysis/configs/config-http-openai.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ general:
2121
method: GET
2222
description: Perform a health check.
2323
function_name: health_check
24-
- path: /version-config
24+
- path: /metadata
2525
method: GET
2626
description: "Gets the metadata tags of the agent"
2727
function_name: get_agent_metadata
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
from pydantic import BaseModel
17+
18+
from aiq.builder.builder import Builder
19+
from aiq.builder.function_info import FunctionInfo
20+
from aiq.cli.register_workflow import register_function
21+
from aiq.data_models.function import FunctionBaseConfig
22+
23+
24+
class MetadataTool(FunctionBaseConfig, name="get_agent_metadata"):
25+
pass
26+
27+
28+
class MetadataResponse(BaseModel):
29+
agent_version: str
30+
agent_git_ref: str
31+
32+
33+
34+
@register_function(config_type=MetadataTool)
35+
async def get_agent_metadata(config: MetadataTool, builder: Builder):
36+
"""
37+
Registers a health-check function used to verify that the agent runtime
38+
is operational and capable of handling requests.
39+
"""
40+
41+
async def _get_metadata(request: None = None) -> MetadataResponse:
42+
"""
43+
Returns operational status data for the agent runtime.
44+
45+
Returns:
46+
HealthStatusResponse: Structured health-status payload.
47+
"""
48+
return MetadataResponse()
49+
50+
yield FunctionInfo.from_fn(
51+
_get_metadata, description="metadata endpoint returning agent metadata keys-values"
52+
)

0 commit comments

Comments
 (0)