mirror of
				https://github.com/kardolus/chatgpt-cli.git
				synced 2024-09-08 23:15:00 +03:00 
			
		
		
		
	Add ListModels
This commit is contained in:
		
							
								
								
									
										43
									
								
								types/completions.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										43
									
								
								types/completions.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,43 @@ | ||||
| package types | ||||
|  | ||||
| type CompletionsRequest struct { | ||||
| 	Model    string    `json:"model"` | ||||
| 	Messages []Message `json:"messages"` | ||||
| 	Stream   bool      `json:"stream"` | ||||
| } | ||||
|  | ||||
| type Message struct { | ||||
| 	Role    string `json:"role"` | ||||
| 	Content string `json:"content"` | ||||
| } | ||||
|  | ||||
| type CompletionsResponse struct { | ||||
| 	ID      string `json:"id"` | ||||
| 	Object  string `json:"object"` | ||||
| 	Created int    `json:"created"` | ||||
| 	Model   string `json:"model"` | ||||
| 	Usage   struct { | ||||
| 		PromptTokens     int `json:"prompt_tokens"` | ||||
| 		CompletionTokens int `json:"completion_tokens"` | ||||
| 		TotalTokens      int `json:"total_tokens"` | ||||
| 	} `json:"usage"` | ||||
| 	Choices []Choice `json:"choices"` | ||||
| } | ||||
|  | ||||
| type Choice struct { | ||||
| 	Message      Message `json:"message"` | ||||
| 	FinishReason string  `json:"finish_reason"` | ||||
| 	Index        int     `json:"index"` | ||||
| } | ||||
|  | ||||
| type Data struct { | ||||
| 	ID      string `json:"id"` | ||||
| 	Object  string `json:"object"` | ||||
| 	Created int    `json:"created"` | ||||
| 	Model   string `json:"model"` | ||||
| 	Choices []struct { | ||||
| 		Delta        map[string]string `json:"delta"` | ||||
| 		Index        int               `json:"index"` | ||||
| 		FinishReason string            `json:"finish_reason"` | ||||
| 	} `json:"choices"` | ||||
| } | ||||
		Reference in New Issue
	
	Block a user
	 kardolus
					kardolus