Usage Represents the total token usage per request to OpenAI.
| 13 | |
| 14 | // Usage Represents the total token usage per request to OpenAI. |
| 15 | type Usage struct { |
| 16 | PromptTokens int `json:"prompt_tokens"` |
| 17 | CompletionTokens int `json:"completion_tokens"` |
| 18 | TotalTokens int `json:"total_tokens"` |
| 19 | } |
| 20 | |
| 21 | func Send(suffix string, reqBytes []byte) (body []byte, err error) { |
| 22 | req, err := http.NewRequest(http.MethodPost, Api+suffix, bytes.NewBuffer(reqBytes)) |
nothing calls this directly
no outgoing calls
no test coverage detected