Skip to content

Commit acd4fb9

Browse files
committed
Addressing Action Recognition Issues
1 parent 2f7f899 commit acd4fb9

File tree

7 files changed

+23
-17
lines changed

7 files changed

+23
-17
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,15 @@ Features:
1818

1919
```sh
2020
# Option 1: OpenAI
21+
export OPENAI_API_KEY="<replace-this>"
2122
helm install kube-copilot kube-copilot \
2223
--repo https://feisky.xyz/kube-copilot \
2324
--set openai.apiModel=gpt-4 \
24-
--set openai.apiKey=$OPENAI_API_KEY \
25-
--set openai.apiBase=$OPENAI_API_BASE
25+
--set openai.apiKey=$OPENAI_API_KEY
2626

2727
# Option 2: Azure OpenAI Service
28+
export OPENAI_API_KEY="<replace-this>"
29+
export OPENAI_API_BASE="<replace-this>"
2830
helm install kube-copilot kube-copilot \
2931
--repo https://feisky.xyz/kube-copilot \
3032
--set openai.apiModel=gpt-4 \

helm/kube-copilot/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ type: application
1313
# This is the chart version. This version number should be incremented each time you make changes
1414
# to the chart and its templates, including the app version.
1515
# Versions are expected to follow Semantic Versioning (https://semver.org/)
16-
version: 0.1.19
16+
version: 0.1.20
1717
# This is the version number of the application being deployed. This version number should be
1818
# incremented each time you make changes to the application. Versions are not expected to
1919
# follow Semantic Versioning. They should reflect the version the application is using.
2020
# It is recommended to use it with quotes.
21-
appVersion: 0.1.19
21+
appVersion: 0.1.20

helm/kube-copilot/templates/NOTES.txt

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,12 @@
77
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
88
{{- end }}
99
{{- end }}
10-
{{- else if contains "NodePort" .Values.service.type }}
11-
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "kube-copilot.fullname" . }})
12-
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
13-
echo http://$NODE_IP:$NODE_PORT
1410
{{- else if contains "LoadBalancer" .Values.service.type }}
1511
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
1612
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "kube-copilot.fullname" . }}'
1713
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "kube-copilot.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
1814
echo http://$SERVICE_IP:{{ .Values.service.port }}
19-
{{- else if contains "ClusterIP" .Values.service.type }}
20-
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "kube-copilot.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
21-
export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
22-
echo "Visit http://127.0.0.1:8080 to use your application"
23-
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
15+
{{- else }}
16+
echo "Visit http://127.0.0.1:8080 to use the copilot"
17+
kubectl port-forward --namespace {{ .Release.Namespace }} service/kube-copilot 8080:80
2418
{{- end }}

helm/kube-copilot/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ replicaCount: 1
66
image:
77
repository: ghcr.io/feiskyer/kube-copilot
88
pullPolicy: Always
9-
tag: v0.1.19
9+
tag: v0.1.20
1010
imagePullSecrets: []
1111
nameOverride: ""
1212
fullnameOverride: ""

kube_copilot/output.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def get_format_instructions(self) -> str:
1515
def parse(self, text: str) -> Union[AgentAction, AgentFinish]:
1616
includes_answer = FINAL_ANSWER_ACTION in text
1717
try:
18-
action = text.split("```")[1]
18+
action = text.split("```")[1].strip()
1919
if action.startswith('python\n'):
2020
# Ensure the Python code snippets are handled by the Python action.
2121
response = {
@@ -30,7 +30,7 @@ def parse(self, text: str) -> Union[AgentAction, AgentFinish]:
3030
}
3131
else:
3232
# JSON object is expected by default.
33-
response = json.loads(action.strip())
33+
response = json.loads(action.strip(), strict=False)
3434

3535
includes_action = "action" in response and "action_input" in response
3636
if includes_answer and includes_action:

kubernetes.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
### Option 1: Install with OpenAI
66

77
```sh
8+
export OPENAI_API_KEY="<replace-this>"
9+
810
helm install kube-copilot kube-copilot \
911
--repo https://feisky.xyz/kube-copilot \
1012
--set openai.apiModel=gpt-4 \
@@ -14,6 +16,9 @@ helm install kube-copilot kube-copilot \
1416
### Option 2: Install with Azure OpenAI Service
1517

1618
```sh
19+
export OPENAI_API_KEY="<replace-this>"
20+
export OPENAI_API_BASE="<replace-this>"
21+
1722
helm install kube-copilot kube-copilot \
1823
--repo https://feisky.xyz/kube-copilot \
1924
--set openai.apiModel=gpt-4 \
@@ -24,6 +29,11 @@ helm install kube-copilot kube-copilot \
2429
### Option 3: Azure OpenAI Service + Google Search
2530

2631
```sh
32+
export OPENAI_API_KEY="<replace-this>"
33+
export OPENAI_API_BASE="<replace-this>"
34+
export GOOGLE_API_KEY="<replace-this>"
35+
export GOOGLE_CSE_ID="<replace-this>"
36+
2737
helm install kube-copilot kube-copilot \
2838
--repo https://feisky.xyz/kube-copilot \
2939
--set openai.apiModel=gpt-4 \

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "kube-copilot"
3-
version = "0.1.19"
3+
version = "0.1.20"
44
description = "Kubernetes Copilot"
55
authors = ["Pengfei Ni <feiskyer@gmail.com>"]
66
readme = "README.md"

0 commit comments

Comments
 (0)