Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dify
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ai-tech
dify
Commits
185c2f86
Unverified
Commit
185c2f86
authored
Dec 19, 2023
by
Jyong
Committed by
GitHub
Dec 19, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Compatible with the situation where there is no user information. (#1792)
Co-authored-by:
jyong
<
jyong@dify.ai
>
parent
10fc44e2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
3 deletions
+13
-3
conversation_fields.py
api/fields/conversation_fields.py
+3
-2
model.py
api/models/model.py
+10
-1
No files found.
api/fields/conversation_fields.py
View file @
185c2f86
...
@@ -31,8 +31,9 @@ annotation_fields = {
...
@@ -31,8 +31,9 @@ annotation_fields = {
}
}
annotation_hit_history_fields
=
{
annotation_hit_history_fields
=
{
'annotation_id'
:
fields
.
String
,
'annotation_id'
:
fields
.
String
(
attribute
=
'id'
),
'annotation_create_account'
:
fields
.
Nested
(
account_fields
,
allow_null
=
True
)
'annotation_create_account'
:
fields
.
Nested
(
account_fields
,
allow_null
=
True
),
'created_at'
:
TimestampField
}
}
message_file_fields
=
{
message_file_fields
=
{
...
...
api/models/model.py
View file @
185c2f86
...
@@ -531,7 +531,11 @@ class Message(db.Model):
...
@@ -531,7 +531,11 @@ class Message(db.Model):
def
annotation_hit_history
(
self
):
def
annotation_hit_history
(
self
):
annotation_history
=
(
db
.
session
.
query
(
AppAnnotationHitHistory
)
annotation_history
=
(
db
.
session
.
query
(
AppAnnotationHitHistory
)
.
filter
(
AppAnnotationHitHistory
.
message_id
==
self
.
id
)
.
first
())
.
filter
(
AppAnnotationHitHistory
.
message_id
==
self
.
id
)
.
first
())
return
annotation_history
if
annotation_history
:
annotation
=
(
db
.
session
.
query
(
MessageAnnotation
)
.
filter
(
MessageAnnotation
.
id
==
annotation_history
.
annotation_id
)
.
first
())
return
annotation
return
None
@
property
@
property
def
app_model_config
(
self
):
def
app_model_config
(
self
):
...
@@ -659,6 +663,11 @@ class MessageAnnotation(db.Model):
...
@@ -659,6 +663,11 @@ class MessageAnnotation(db.Model):
account
=
db
.
session
.
query
(
Account
)
.
filter
(
Account
.
id
==
self
.
account_id
)
.
first
()
account
=
db
.
session
.
query
(
Account
)
.
filter
(
Account
.
id
==
self
.
account_id
)
.
first
()
return
account
return
account
@
property
def
annotation_create_account
(
self
):
account
=
db
.
session
.
query
(
Account
)
.
filter
(
Account
.
id
==
self
.
account_id
)
.
first
()
return
account
class
AppAnnotationHitHistory
(
db
.
Model
):
class
AppAnnotationHitHistory
(
db
.
Model
):
__tablename__
=
'app_annotation_hit_histories'
__tablename__
=
'app_annotation_hit_histories'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment