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

refactor code for minimal changes required for new open-ai compatible… #565

Merged
merged 7 commits into from
Aug 31, 2024

Conversation

b4s36t4
Copy link
Contributor

@b4s36t4 b4s36t4 commented Aug 30, 2024

Simplifying the creation of new openai compatible providers.

API

  • chatCompletetionParams - Extendable function to support exclusion, default-values and extra config based on the requirement for chat functionality of provider.
  • completionParams - Extendable function to support exclusion, default-values and extra config based on the requirement for chat functionality of provider.
  • embedParams - Extendable function to support exclusion, default-values and extra config based on the requirement for embed functionality of provider.

Response Handling
responseTransformers function accepts two parameter

  • provider as string
  • options an object - {chatComplete: Function | boolean, complete: Function | boolean, embed: Function | boolean}

We can enable openai existing response transformers directly by passing true for each function or we can write a function that accepts response and boolean indicating weather the response is error response or not.

Extended function should return the response which is inclusive of openai response types (embed, complete and chatComplete).

src/globals.ts Outdated Show resolved Hide resolved
@VisargD
Copy link
Collaborator

VisargD commented Aug 31, 2024

@b4s36t4 - Is this ready to review?

@b4s36t4 b4s36t4 marked this pull request as ready for review August 31, 2024 13:07
@VisargD VisargD merged commit 549ec55 into Portkey-AI:main Aug 31, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants