---
apiVersion: v1
kind: Pod
metadata:
  name: "{{ include "nim-llm.fullname" . }}-test-streaming-chat"
  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/chat/completions'
        - -H
        - 'accept: application/json'
        - -H
        - 'Content-Type: application/json'
        - --fail-with-body
        - -d
        - |
            {
                "model": "{{.Values.model.name}}",
                "messages": [
                    {
                        "role":"user",
                        "content":"Hello there how are you?",
                        "name": "aleks"
                    },
                    {
                        "role":"assistant",
                        "content":"How may I help you?"
                    },
                    {
                        "role":"user",
                        "content":"Do something for me?"
                    }
                ],
                "top_p": 1,
                "n": 1,
                "max_tokens": 15,
                "stream": true,
                "frequency_penalty": 1.0,
                "stop": ["hello"]
            }
  restartPolicy: Never
