fix default target

This commit is contained in:
Adil Hafeez 2025-04-16 15:01:01 -07:00
parent a8d3abeaf1
commit 1142ab875a
No known key found for this signature in database
GPG key ID: 9B18EF7691369645
2 changed files with 32 additions and 13 deletions

View file

@ -105,3 +105,25 @@ async def create_policy(req: PolicyPut, res: Response):
logger.info(f"Response: {resp_text}")
return {"status: ": resp_text}
class DefaultTargetRequest(BaseModel):
messages: list = []
@app.post("/default_target")
async def default_target(req: DefaultTargetRequest, res: Response):
logger.info(f"Received messages: {req.messages}")
resp = {
"choices": [
{
"message": {
"role": "assistant",
"content": "I can help you with k8s policy creation, getting policy details, cluster details and node details. When creating a policy please provide the policy name, namespace, and remediation action.",
},
}
],
"model": "api_server",
}
logger.info(f"sending response: {json.dumps(resp)}")
return resp

View file

@ -1,8 +1,9 @@
version: "0.1-beta"
listeners:
prompt_gateway:
ingress_traffic:
address: 0.0.0.0
port: 10000
message_format: openai
timeout: 30s
@ -111,19 +112,15 @@ prompt_targets:
- name: default_target
default: true
description: This is the default target for all unmatched prompts.
endpoint:
name: local_proxy_service
path: /default_target
http_method: POST
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.
endpoint:
http_method: GET
name: acm_service
path: /apis/cluster.open-cluster-management.io/v1/managedclusters
system_prompt: |
You are a helpful assistant. You are given response in json. Only show name of the cluster and its status.
auto_llm_dispatch_on_response: true
You are a helpful assistant! Summarize the user's request and provide a helpful response.
# if it is set to false arch will send response that it received from this prompt target to the user
# if true arch will forward the response to the default LLM
auto_llm_dispatch_on_response: false
tracing:
random_sampling: 100