INNER CODE UNIT · Go

getStreamBody

easegress-io/easegress · scripts/benchmark/aigateway/llm/main.go:84

func getStreamBody(req *ChatCompletionRequest) []any {
	id := fmt.Sprintf("chatcmpl-%d", time.Now().Unix())

	contexts := strings.Split("Hello! How can I assist you today?", " ")
	res := []any{
		map[string]any{
			"id":                 id,
			"object":             "chat.completion.chunk",
			"created":            time.Now().Unix(),
			"model":              req.Model,
			"system_fingerprint": "fp_abc123",
			"choices": []any{
				map[string]any{
					"index": 0,
					"delta": map[string]any{"role": "assistant", "content": ""},
				},
			},
		},

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…