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

Prompt Render Response #53

Merged
merged 6 commits into from
May 3, 2024
Merged

Prompt Render Response #53

merged 6 commits into from
May 3, 2024

Conversation

csgulati09
Copy link
Collaborator

@csgulati09 csgulati09 commented Apr 1, 2024

Title: Response type of Prompt Render

Description:

  • The response type for the prompt render is fixed
  • From generic to specific response type for this route

Motivation:
Reported as bug by user (https://discord.com/channels/1143393887742861333/1145181039648583811/1224288432411639869)

Related Issues:
#52

@csgulati09 csgulati09 self-assigned this Apr 1, 2024
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Apr 1, 2024
@csgulati09 csgulati09 requested a review from VisargD April 1, 2024 15:01
type PromptRenderResponse = {
success: boolean;
data: {
messages?: Optional<Messages[]>;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is Optional required here? All the params are already using ?:.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Same for other newly added types as well

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, because it could be either matching completion or chat completion
Hence keeping them all optional

export type PromptsCreateParams = PromptsCreateNonStreaming | PromptsCreateStreaming

type PromptsResponse = Record<string, any> & APIResponseType;

type PromptRenderResponse = {
Copy link
Collaborator

Choose a reason for hiding this comment

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

stream seems to be missing from this type

Copy link
Collaborator

Choose a reason for hiding this comment

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

response_format is also missing

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label May 3, 2024
@VisargD VisargD linked an issue May 3, 2024 that may be closed by this pull request
@VisargD VisargD merged commit 38ab035 into main May 3, 2024
1 check passed
@VisargD VisargD deleted the fix/promptResponse branch May 3, 2024 09:04
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:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NodeSDK: prompt render response
2 participants