MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / parseOpenAIRequest

Function parseOpenAIRequest

cmd/inject-cli/main.go:988–1003  ·  view source on GitHub ↗
(raw string)

Source from the content-addressed store, hash-verified

986}
987
988func 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
1005func parseOpenAIResponse(raw string) {
1006 // Non-streaming: single JSON with choices

Callers 1

printObserveEventFunction · 0.70

Calls 4

printTruncatedFunction · 0.85
printMessageSummaryFunction · 0.85
GetMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected