Public discoverability on pkg.go.dev. Also fixes stream tool call test fixture to match real Mistral API responses (finish_reason, usage).
17 lines
367 B
Go
17 lines
367 B
Go
package mistral
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/VikingOwl91/mistral-go-sdk/ocr"
|
|
)
|
|
|
|
// OCR performs optical character recognition on a document.
|
|
func (c *Client) OCR(ctx context.Context, req *ocr.Request) (*ocr.Response, error) {
|
|
var resp ocr.Response
|
|
if err := c.doJSON(ctx, "POST", "/v1/ocr", req, &resp); err != nil {
|
|
return nil, err
|
|
}
|
|
return &resp, nil
|
|
}
|