CompletionBatchingRequestSupport (#220)

* completionBatchingRequestSupport

* lint fix

* fix Run test fail

* fix TestClientReturnsRequestBuilderErrors fail

* fix Codecov  check

* ignore TestClientReturnsRequestBuilderErrors lint

* fix lint again

* lint again*2

* replace checkPromptType  implementation

* remove nil check

---------

Co-authored-by: W <825708370@qq.com>
This commit is contained in:
NullpointerW
2023-04-03 15:05:33 +08:00
committed by GitHub
parent b542086cbb
commit bee0656174
4 changed files with 47 additions and 6 deletions

View File

@@ -28,6 +28,11 @@ func (c *Client) CreateCompletionStream(
return
}
if !checkPromptType(request.Prompt) {
err = ErrCompletionRequestPromptTypeNotSupported
return
}
request.Stream = true
req, err := c.newStreamRequest(ctx, "POST", urlSuffix, request)
if err != nil {