Skip to content

Commit

Permalink
feat(thread): add code_source_id field to Message struct and upda… (
Browse files Browse the repository at this point in the history
#3584)

* feat(thread): add `code_source_id` field to `Message` struct and update `ThreadServiceImpl`

* fix test

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
  • Loading branch information
wsxiaoys and autofix-ci[bot] authored Dec 19, 2024
1 parent 48bdc2f commit 2efdab9
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions ee/tabby-schema/graphql/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,7 @@ type LicenseInfo {
type Message {
id: ID!
threadId: ID!
codeSourceId: String
role: Role!
content: String!
attachment: MessageAttachment!
Expand Down
1 change: 1 addition & 0 deletions ee/tabby-schema/src/schema/thread/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ pub enum Role {
pub struct Message {
pub id: ID,
pub thread_id: ID,
pub code_source_id: Option<String>,
pub role: Role,
pub content: String,

Expand Down
1 change: 1 addition & 0 deletions ee/tabby-webserver/src/service/answer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,7 @@ mod tests {
tabby_schema::thread::Message {
id: id.as_id(),
thread_id: ID::new("0"),
code_source_id: None,
content: content.to_owned(),
role,
attachment: attachment.unwrap_or_default(),
Expand Down
1 change: 1 addition & 0 deletions ee/tabby-webserver/src/service/thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ impl ThreadServiceImpl {
id: message.id.as_id(),
thread_id: message.thread_id.as_id(),
role: thread::Role::from_enum_str(&message.role)?,
code_source_id: message.code_source_id,
content: message.content,
attachment,
created_at: message.created_at,
Expand Down

0 comments on commit 2efdab9

Please sign in to comment.