-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RFC Cleanup Configuration and naming
The initialization code is really verbose - configuration can just be an object & be initialized directly with LastMile Currently: ```javascript import { Configuration, LastMileAIApi} from "lastmileai"; const configuration = new Configuration({ apiKey: process.env.LASTMILEAI_API_KEY ?? "", }); const lastmile = new LastMileAIApi(configuration); const completion = await lastmile.createOpenAICompletion({ completionParams: { model: "text-davinci-003", prompt: "Your prompt here", }, embeddingCollectionId: "clfpqyvpp004npmzgp1d4j4fw", }); ``` Can become: ```javascript import { LastMile } from "lastmileai"; const lastmile = new LastMile({apiKey: process.env.LASTMILEAI_API_KEY ?? ""}); const completion = await lastmile.createOpenAICompletion({ completionParams: { model: "text-davinci-003", prompt: "Your prompt here", }, embeddingCollectionId: "clfpqyvpp004npmzgp1d4j4fw", }); ```
- Loading branch information
Showing
3 changed files
with
19 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters