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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is fine. We can revisit the class later if additional configuration setup is needed instead of pushing more into the api class.
After removing the unused interface can you run the doc generation (npx typedoc index.ts
) to keep it in sync?
configuration.ts
Outdated
export interface ConfigurationParameters { | ||
apiKey: string; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can remove ConfigurationParameters as unused
Updated docs & tests, but I'm having trouble running the tests successfully, don't know if it's because of jest or something else:
Did you see that before? |
I haven't seen that before, no. I don't have jest globally, just do |
In any case, I pulled this and ran the tests successfully on my end |
I'm running via |
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", }); ```
Okay, got it working weirdly:
Essentially forcing npm test to also have the api key passed in... also using Edit: Feel like I should've done the docs changes on a diff on top lol - sorry |
RFC Cleanup Configuration and naming
The initialization code is really verbose - configuration can just be an object & be initialized directly with LastMile
Currently:
Can become:
Stack created with Sapling. Best reviewed with ReviewStack.