CreateKnowledgeBase creates a knowledge base
(ctx context.Context, knowledgeBase *KnowledgeBase)
| 248 | |
| 249 | // CreateKnowledgeBase creates a knowledge base |
| 250 | func (c *Client) CreateKnowledgeBase(ctx context.Context, knowledgeBase *KnowledgeBase) (*KnowledgeBase, error) { |
| 251 | resp, err := c.doRequest(ctx, http.MethodPost, "/api/v1/knowledge-bases", knowledgeBase, nil) |
| 252 | if err != nil { |
| 253 | return nil, err |
| 254 | } |
| 255 | |
| 256 | var response KnowledgeBaseResponse |
| 257 | if err := parseResponse(resp, &response); err != nil { |
| 258 | return nil, err |
| 259 | } |
| 260 | |
| 261 | return &response.Data, nil |
| 262 | } |
| 263 | |
| 264 | // GetKnowledgeBase gets a knowledge base |
| 265 | func (c *Client) GetKnowledgeBase(ctx context.Context, knowledgeBaseID string) (*KnowledgeBase, error) { |
no test coverage detected