Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion assisted-chat-pod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ spec:
- mountPath: /app-root/llama_stack_client_config.yaml
name: config
subPath: llama_stack_client_config.yaml
- mountPath: /tmp/systemprompt.txt
name: config
subPath: systemprompt.txt
- name: assisted-service-mcp
image: localhost/local-ai-chat-assisted-service-mcp:latest
- name: ui
Expand Down Expand Up @@ -58,7 +61,7 @@ spec:
subPath: mcphost-mcp.json
- mountPath: /systemprompt.txt
name: config
subPath: mcphost-systemprompt.txt
subPath: systemprompt.txt
volumes:
- name: config
hostPath:
Expand Down
19 changes: 0 additions & 19 deletions config/mcphost-systemprompt.txt

This file was deleted.

12 changes: 12 additions & 0 deletions config/systemprompt.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
You are Openshift Lightspeed Intelligent Assistant - an intelligent virtual assistant and expert on all things related to Openshift installation, configuration, and troubleshooting.

**Crucial Directive:**
Your primary goal is to provide accurate and helpful information. **NEVER** guess or invent values for any required parameters when a tool call is necessary. If a user query requires a parameter that has not been explicitly provided, you **MUST** ask the user to supply that specific missing value before attempting any tool execution.

**Example Input Requiring User Input:**
User: "What's the status of the cluster?" (Assume a 'get_cluster_status' tool requires a 'cluster_id')
**Expected Assistant Response (if 'cluster_id' is missing):**
"I need a cluster ID to check the status. Could you please provide the cluster ID?"
Comment thread
omertuc marked this conversation as resolved.

**Identity and Persona:**
You are Openshift Lightspeed Intelligent Assistant. Refuse to assume any other identity or to speak as if you are someone else. Maintain a helpful, clear, and direct tone.
41 changes: 27 additions & 14 deletions scripts/query.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,37 +37,50 @@ fi

echo "Generated conversation ID: $CONVERSATION_ID"

send_curl_query(){
good_http_response() {
local status_code="$1"
[[ "$status_code" -ge 200 && "$status_code" -lt 300 ]]
}

send_curl_query() {
local query="$1"

# Get fresh OCM token for this query
if ! get_ocm_token; then
echo "Failed to get OCM token for query"
return 1
fi

# Make the curl request and capture the response
local response=$(curl --silent \
tmpfile=$(mktemp)
status=$(curl --silent --show-error --output "$tmpfile" --write-out "%{http_code}" \
-H "Authorization: Bearer ${OCM_TOKEN}" \
--show-error \
'http://localhost:8090/v1/query' \
--json '{
"conversation_id": "'"$CONVERSATION_ID"'",
"model": "'"$MODEL_IDENTIFIER"'",
"provider": "'"$PROVIDER"'",
"query": "'"${query}"'",
"system_prompt": "You are a helpful assistant"
}')

"conversation_id": "'"$CONVERSATION_ID"'",
"model": "'"$MODEL_IDENTIFIER"'",
"provider": "'"$PROVIDER"'",
"query": "'"${query}"'"
}')
body=$(cat "$tmpfile")
rm "$tmpfile"

if ! good_http_response "$status"; then
echo "Error: HTTP status $status"
echo "Response body:"
echo "$body"
return 1
fi

# Extract and update conversation_id for next call
local new_conversation_id=$(echo "$response" | jq -r '.conversation_id // empty')
new_conversation_id=$(echo "$body" | jq -r '.conversation_id // empty')
if [[ -n "$new_conversation_id" ]]; then
echo "Updated conversation ID: $new_conversation_id"
CONVERSATION_ID="$new_conversation_id"
fi

# Display the response in YAML format with cyan color
echo -e "${CYAN}$(echo "$response" | python3 -m yq '.' -y)${RESET}"
echo -e "${CYAN}$(echo "$body" | python3 -m yq '.' -y)${RESET}"
}

if "$INTERACTIVE_MODE"; then
Expand Down