(host, path string)
| 213 | ) |
| 214 | |
| 215 | func classifyRequestShape(host, path string) requestShape { |
| 216 | host = strings.ToLower(host) |
| 217 | switch { |
| 218 | case host == "api.openai.com" && strings.HasSuffix(path, "/v1/chat/completions"): |
| 219 | return shapeOpenAIChat |
| 220 | case host == "api.anthropic.com" && strings.HasSuffix(path, "/v1/messages"): |
| 221 | return shapeAnthropicMessages |
| 222 | } |
| 223 | return shapeUnknown |
| 224 | } |
| 225 | |
| 226 | func (d *piiDispatcher) redactRequest(ctx context.Context, body []byte, shape requestShape, cfgs []pii.NERConfig, correlationID string) ([]byte, bool, error) { |
| 227 | var parsed any |
no outgoing calls
no test coverage detected