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

genai comments #605

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from
Draft
54 changes: 54 additions & 0 deletions docs/genaisrc/genaiscript.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

54 changes: 54 additions & 0 deletions genaisrc/genaiscript.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/core/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ export const AI_REQUESTS_CACHE = "airequests"
export const CHAT_CACHE = "chat"
export const GITHUB_PULL_REQUEST_REVIEWS_CACHE = "prr"
export const GITHUB_PULLREQUEST_REVIEW_COMMENT_LINE_DISTANCE = 5
export const COMMENTS_CACHE = "comments"

export const PLACEHOLDER_API_BASE = "<custom api base>"
export const PLACEHOLDER_API_KEY = "<your token>"
Expand Down
54 changes: 54 additions & 0 deletions packages/core/src/genaisrc/genaiscript.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

54 changes: 54 additions & 0 deletions packages/core/src/types/prompt_template.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,55 @@ interface ChatParticipant {
options: ChatParticipantOptions
}

/**
* A comment
*/
interface Comment {
/**
* The human-readable comment body
*/
body: string

/**
* The author of the comment
*/
author: { name: string }

/**
* Optional reactions of the comment
*/
reactions?: CommentReaction[]

/**
* Optional label describing the comment
* Label will be rendered next to authorName if exists.
*/
label?: string

/**
* Optional timestamp that will be displayed in comments.
* The date will be formatted according to the user's locale and settings.
*/
timestamp?: string
}

interface CommentReaction {
/**
* The human-readable label for the reaction
*/
label: string

/**
* The number of users who have reacted to this reaction
*/
count: number

/**
* Whether the author of the comment has reacted to this reaction
*/
authorHasReacted: boolean
}

/**
* A set of text extracted from the context of the prompt execution
*/
Expand Down Expand Up @@ -647,6 +696,11 @@ interface ExpansionVariables {
* Root prompt generation context
*/
generator: ChatGenerationContext

/**
* Comments generated in the context of this prompt
*/
comments: Comment[]
}

type MakeOptional<T, P extends keyof T> = Partial<Pick<T, P>> & Omit<T, P>
Expand Down
54 changes: 54 additions & 0 deletions packages/sample/genaisrc/genaiscript.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading