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

Feat/wrapper #40

Merged
merged 19 commits into from
Mar 21, 2024
Merged

Feat/wrapper #40

merged 19 commits into from
Mar 21, 2024

Conversation

csgulati09
Copy link
Contributor

Title: Revamp: wrapper around OpenAI SDK (Hybrid)

Description:

  • Hybrid approach for this wrapper
  • Original working of the existing routes is untouched
  • Introduced new routes: images, files, assistant + sub routes, threads + sub routes
  • New test cases added as well

Motivation:
This will make it easier for us to integrate newly introduced routes from OpenAI

Related Issues:
#38

@csgulati09 csgulati09 self-assigned this Feb 24, 2024
@dosubot dosubot bot added the size:XXL This PR changes 1000+ lines, ignoring generated files. label Feb 24, 2024
}, 120000);


// test('model: gpt-4-1106-preview', async () => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove comments if they are not required. From other files as well.


config({ override: true })
const client = new Portkey({
apiKey: process.env["PORTKEY_API_KEY"] ?? "",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the DEV base url. We can use the default PROD url for testing SDKs.


export interface ImagesBody {
prompt: string;
model?: (string & {}) | "dall-e-2" | "dall-e-3";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we change this to just a normal string type?

n?: number | null;
quality?: "standard" | "hd";
response_format?: "url" | "b64_json" | null;
size?: "256x256" | "512x512" | "1024x1024" | "1792x1024" | "1024x1792" | null;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these required or can we just make it a string?

quality?: "standard" | "hd";
response_format?: "url" | "b64_json" | null;
size?: "256x256" | "512x512" | "1024x1024" | "1792x1024" | "1024x1792" | null;
style?: "vivid" | "natural" | null;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can also just be a string as other providers might have different styles

@VisargD
Copy link
Collaborator

VisargD commented Mar 18, 2024

@csgulati09 - We should try to make our interfaces as flexible as possible because Portkey SDK will be used for providers other than openai as well. Have added a few comments related to this. But the broader idea is to keep things open-ended for input params so that if the values are different for other providers, it does not break for them

metadata?: unknown | null;
}

export namespace ThreadCreateParams {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this required?

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Mar 21, 2024
@VisargD
Copy link
Collaborator

VisargD commented Mar 21, 2024

Closes #38

@VisargD VisargD linked an issue Mar 21, 2024 that may be closed by this pull request
@VisargD VisargD merged commit b00bf4d into main Mar 21, 2024
1 check failed
@VisargD VisargD deleted the feat/wrapper branch March 21, 2024 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm This PR has been approved by a maintainer size:XXL This PR changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Revamp Node SDK: Wrapper
2 participants