alexanderatallah / window.ai

Use your own AI models on the web
https://windowai.io
MIT License
782 stars 68 forks source link

window.ai lib type improvements #44

Closed alexanderatallah closed 1 year ago

alexanderatallah commented 1 year ago
  1. We should have the right type of Output inferable so we can do e.g. const { text } = await windowAI.getCompletion({ prompt: "What is the last digit of " }) without an error on the destructuring of the output

  2. We should have it always return type Output[]. This will be a breaking change but makes it more consistent with other libs like OpenAI and easier to predict types for diff kinds input configs