-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add types for related prompts (#1640)
- Loading branch information
1 parent
7b90230
commit 9822c28
Showing
13 changed files
with
53 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
export * from './next-queries.model'; | ||
export * from './next-query.model'; | ||
export * from './related-prompt.model'; | ||
export * from './related-tag.model'; | ||
export * from './semantic-query.model'; |
13 changes: 13 additions & 0 deletions
13
packages/x-types/src/query-signals/related-prompt.model.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { NamedModel } from '../named-model.model'; | ||
|
||
/** | ||
* Represents a related prompt. | ||
*/ | ||
export interface RelatedPrompt extends NamedModel<'RelatedPrompt'> { | ||
/** The next queries related to the prompt. */ | ||
nextQueries: string[]; | ||
/** The prompt. */ | ||
suggestionText: string; | ||
/** The type of the prompt. */ | ||
type: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
packages/x-types/src/request/related-prompts-request.model.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { ExtraParamsRequest, QueryableRequest } from './request.model'; | ||
|
||
/** | ||
* Request for Related Prompts endpoint. | ||
*/ | ||
export interface RelatedPromptsRequest extends QueryableRequest, ExtraParamsRequest {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
packages/x-types/src/response/related-prompts-response.model.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { RelatedPrompt } from '../query-signals/related-prompt.model'; | ||
|
||
/** | ||
* Response for the related prompts endpoint. | ||
*/ | ||
export interface RelatedPromptsResponse { | ||
relatedPrompts: RelatedPrompt[]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { RelatedPrompt } from '../query-signals'; | ||
|
||
/** | ||
* Jest schema for validating Related Prompt entities. | ||
*/ | ||
export const RelatedPromptSchema: RelatedPrompt = { | ||
modelName: expect.any(String), | ||
nextQueries: expect.any(Array), | ||
suggestionText: expect.any(String), | ||
type: expect.any(String) | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters