dylanshine / openai-kit

A community Swift package used to interact with the OpenAI API
https://platform.openai.com/docs/api-reference
MIT License
703 stars 109 forks source link

Send Array as embeddings input #20

Closed fjcaetano closed 1 year ago

fjcaetano commented 1 year ago

The API states that embeddings can either be a string or an array of strings: https://platform.openai.com/docs/api-reference/embeddings/create

This PR modifies the default behavior to send an array of strings and adds an overload to send a single String, for backwards compatibility and ease of use.