Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC Cleanup Configuration and naming #2

Merged
merged 1 commit into from
May 5, 2023
Merged

RFC Cleanup Configuration and naming #2

merged 1 commit into from
May 5, 2023

Commits on May 5, 2023

  1. 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",
    });
    ```
    Flux159 committed May 5, 2023
    Configuration menu
    Copy the full SHA
    bf58f63 View commit details
    Browse the repository at this point in the history