(raw string)
| 986 | } |
| 987 | |
| 988 | func parseOpenAIRequest(raw string) { |
| 989 | messages := gjson.Get(raw,"messages") |
| 990 | if !messages.Exists() || !messages.IsArray() { |
| 991 | printTruncated(raw, 500) |
| 992 | return |
| 993 | } |
| 994 | arr := messages.Array() |
| 995 | start := len(arr) - 3 |
| 996 | if start < 0 { |
| 997 | start = 0 |
| 998 | } |
| 999 | for _, msg := range arr[start:] { |
| 1000 | role := msg.Get("role").String() |
| 1001 | printMessageSummary(role, msg) |
| 1002 | } |
| 1003 | } |
| 1004 | |
| 1005 | func parseOpenAIResponse(raw string) { |
| 1006 | // Non-streaming: single JSON with choices |
no test coverage detected