This commit is contained in:
Adil Hafeez 2024-12-05 10:11:55 -08:00
parent af02807004
commit 5e182b6c09
8 changed files with 125 additions and 42 deletions

View file

@ -66,7 +66,6 @@ paths:
application/json:
schema:
$ref: "#/components/schemas/ManagedCluster"
components:
schemas:
ManagedCluster:

View file

@ -10,9 +10,7 @@ def main():
app.app.json_encoder = encoder.JSONEncoder
app.add_api(
"openapi.yaml",
arguments={
"title": "ACM API for cluster management - https://docs.redhat.com/en/documentation/red_hat_advanced_cluster_management_for_kubernetes/2.12/html/apis/apis#tags"
},
arguments={"title": "ACM API for cluster management"},
pythonic_params=True,
)

View file

@ -4,7 +4,8 @@ info:
email: support@katanemo.com
name: Katanemo Labs Inc.
url: https://katanemo.com
title: ACM API for cluster management - https://docs.redhat.com/en/documentation/red_hat_advanced_cluster_management_for_kubernetes/2.12/html/apis/apis#tags
description: This is the API for managing clusters using ACM - https://docs.redhat.com/en/documentation/red_hat_advanced_cluster_management_for_kubernetes/2.12/html/apis/apis#tags
title: ACM API for cluster management
version: 2.12.0
servers:
- url: /

View file

@ -16,19 +16,16 @@ REQUIRES = ["connexion>=2.0.2", "swagger-ui-bundle>=0.0.2", "python_dateutil>=2.
setup(
name=NAME,
version=VERSION,
description="ACM API for cluster management - https://docs.redhat.com/en/documentation/red_hat_advanced_cluster_management_for_kubernetes/2.12/html/apis/apis#tags",
description="ACM API for cluster management",
author_email="support@katanemo.com",
url="",
keywords=[
"OpenAPI",
"ACM API for cluster management - https://docs.redhat.com/en/documentation/red_hat_advanced_cluster_management_for_kubernetes/2.12/html/apis/apis#tags",
],
keywords=["OpenAPI", "ACM API for cluster management"],
install_requires=REQUIRES,
packages=find_packages(),
package_data={"": ["openapi/openapi.yaml"]},
include_package_data=True,
entry_points={"console_scripts": ["openapi_server=openapi_server.__main__:main"]},
long_description="""\
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
This is the API for managing clusters using ACM - https://docs.redhat.com/en/documentation/red_hat_advanced_cluster_management_for_kubernetes/2.12/html/apis/apis#tags
""",
)

View file

@ -42,14 +42,14 @@ prompt_guards:
message: Looks like you're curious about my abilities, but I can only provide assistance for weather forecasting.
prompt_targets:
- name: listManagedClusters
- name: listAllClusterDetails
description: Query your clusters for more details.
http_method: GET
endpoint:
name: acm_service
path: /cluster.open-cluster-management.io/v1/managedclusters
- name: getCluster
- name: getClusterDetails
description: Query a single cluster for more details
http_method: GET
endpoint:
@ -62,6 +62,34 @@ prompt_targets:
required: true
type: str
- name: default_target
default: true
description: This is the default target for all unmatched prompts.
system_prompt: |
You are a helpful assistant that can help answer ACM queries. Following is a list of available commands user can ask. Based on question asked, tell me which command you want to execute.
- name: listAllClusterDetails
description: Query your clusters for more details.
http_method: GET
endpoint:
name: acm_service
path: /cluster.open-cluster-management.io/v1/managedclusters
- name: getClusterDetails
description: Query a single cluster for more details
http_method: GET
endpoint:
name: acm_service
path: /cluster.open-cluster-management.io/v1/managedclusters/{cluster_name}
parameters:
- name: cluster_name
in_path: true
description: The name of the cluster to retrieve
required: true
type: str
auto_llm_dispatch_on_response: true
tracing:
random_sampling: 100
trace_arch_internal: true

View file

@ -2,5 +2,4 @@ docker run --rm -v "${PWD}:/local" openapitools/openapi-generator-cli:latest gen
--skip-validate-spec \
-i /local/acm_api.yaml \
-g python-flask \
-o /local/acm_server \
# --additional-properties=defaultController=your.package.YourController \
-o /local/acm_service \