apiVersion: v1
kind: Pod
metadata:
  name: "{{ include "nim-llm.fullname" . }}-test-completions"
  labels:
    {{- include "nim-llm.labels" . | nindent 4 }}
    sidecar.istio.io/inject: "false"
  annotations:
    "helm.sh/hook": test
spec:
  containers:
    - name: curl
      image: curlimages/curl:8.6.0
      command: ['curl']
      args:
        - -X
        - "POST"
        - 'http://{{ .Values.service.name | default (include "nim-llm.fullname" .) }}:{{ .Values.service.openai_port | default .Values.service.openaiPort }}/v1/completions'
        - -H
        - 'accept: application/json'
        - -H
        - 'Content-Type: application/json'
        - -f
        - -d
        - |
            {
            "model": "{{ .Values.model.name }}",
            "prompt": "Once upon a time",
            "temperature": 0.0,
            "max_tokens": 50
            }
  restartPolicy: Never
