-
Notifications
You must be signed in to change notification settings - Fork 219
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: AiAssistantModel #9494
base: feat/growi-ai-next
Are you sure you want to change the base?
feat: AiAssistantModel #9494
Conversation
|
type: String, | ||
enum: Object.values(AiAssistantSharingScope), | ||
required: true, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
共有範囲
type: String, | ||
enum: Object.values(AiAssistantLearningScope), | ||
required: true, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 学習範囲
- VectorStore に保存する権限の範囲を指定
- アシスタント作成者が閲覧可能な範囲が指定できる
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
名前変えたほうがいいかも。e-learning のためのフィールドと勘違いする。
かといって「実行ユーザー」というのが適当とも思わないんだけどね
あとこれは enum だけではなく UserGroup への参照が必要なのではないか?
required: true, | ||
index: true, | ||
}, | ||
}], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Page mode を踏襲
growi/apps/app/src/server/models/page.ts
Lines 137 to 158 in df996cb
type: [{ | |
type: { | |
type: String, | |
enum: Object.values(GroupType), | |
required: true, | |
default: 'UserGroup', | |
}, | |
item: { | |
type: Schema.Types.ObjectId, | |
refPath: 'grantedGroups.type', | |
required: true, | |
index: true, | |
}, | |
}], | |
validate: [function(arr) { | |
if (arr == null) return true; | |
const uniqueItemValues = new Set(arr.map(e => e.item)); | |
return arr.length === uniqueItemValues.size; | |
}, 'grantedGroups contains non unique item'], | |
default: [], | |
required: true, | |
}, |
default: false, | ||
required: true, | ||
}, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
VectorStore model を踏襲
growi/apps/app/src/features/openai/server/models/vector-store.ts
Lines 35 to 39 in df996cb
isDeleted: { | |
type: Boolean, | |
default: false, | |
required: true, | |
}, |
vectorStoreId: { | ||
type: String, | ||
required: true, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
VectorStore model を踏襲
growi/apps/app/src/features/openai/server/models/vector-store.ts
Lines 25 to 29 in df996cb
vectorStoreId: { | |
type: String, | |
required: true, | |
unique: true, | |
}, |
schema.methods.markAsDeleted = async function(): Promise<void> { | ||
this.isDeleted = true; | ||
await this.save(); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
VectorStore model 踏襲
growi/apps/app/src/features/openai/server/models/vector-store.ts
Lines 42 to 45 in df996cb
schema.methods.markAsDeleted = async function(): Promise<void> { | |
this.isDeleted = true; | |
await this.save(); | |
}; |
interface AiAssistant { | ||
name: string; | ||
description?: string | ||
instruction?: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
特化型アシスタントになったことで、実際使う時の instruction はシステム側で入れると思うんだよね
ナレッジアシスタントとかエディタアシスタントのそれぞれの役割になるように
ユーザーが指定できるのはサブの instruction になるので、additionalInstruction にしておいた方がいいかも
あと description も instruction も not optional でいいと思う。初期値は空文字列にすればいいので。
instruction?: string | ||
vectorStoreId: string // VectorStoreId of OpenAI Specify (https://platform.openai.com/docs/api-reference/vector-stores/object) | ||
types: AiAssistantType[] | ||
creator: Ref<IUser> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
owner にしよう
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
修正済み
types: AiAssistantType[] | ||
creator: Ref<IUser> | ||
grantedGroups?: IGrantedGroup[]; | ||
pages: Ref<IPage>[] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pages って何用途だろ?
個別にページへの参照を追加できるというのも thread 作ったときに便利そうではあるが、vector store 利用との一貫性はないので今使い分けをするのかきちんと設計しておきたい
type: String, | ||
enum: Object.values(AiAssistantLearningScope), | ||
required: true, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
名前変えたほうがいいかも。e-learning のためのフィールドと勘違いする。
かといって「実行ユーザー」というのが適当とも思わないんだけどね
あとこれは enum だけではなく UserGroup への参照が必要なのではないか?
Task