Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
chatbot canifa
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
1
Merge Requests
1
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
Vũ Hoàng Anh
chatbot canifa
Commits
9a233f6c
Commit
9a233f6c
authored
May 11, 2026
by
Vũ Hoàng Anh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(search): replace non-existent outfit_recommendations with similar_items in SearchEngine query
parent
075c9528
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
search_engine.py
backend/agent/tools/tool_module/search_engine.py
+8
-8
No files found.
backend/agent/tools/tool_module/search_engine.py
View file @
9a233f6c
...
...
@@ -45,7 +45,7 @@ SELECT_COLUMNS = """
size_scale,
description_text,
tags,
outfit_recommendation
s,
similar_item
s,
description_text_full
"""
...
...
@@ -333,17 +333,17 @@ class SearchEngine:
return
[],
0
,
"No results found"
@
staticmethod
def
_parse_
outfit_recommendation
s
(
products
:
list
)
->
list
:
"""Parse
outfit_recommendation
s JSON string from One Big Table into list[dict]."""
def
_parse_
similar_item
s
(
products
:
list
)
->
list
:
"""Parse
similar_item
s JSON string from One Big Table into list[dict]."""
for
p
in
products
:
raw
=
p
.
get
(
"
outfit_recommendation
s"
)
raw
=
p
.
get
(
"
similar_item
s"
)
if
raw
and
isinstance
(
raw
,
str
):
try
:
p
[
"
outfit_recommendation
s"
]
=
json
.
loads
(
raw
)
p
[
"
similar_item
s"
]
=
json
.
loads
(
raw
)
except
(
json
.
JSONDecodeError
,
TypeError
):
p
[
"
outfit_recommendation
s"
]
=
[]
p
[
"
similar_item
s"
]
=
[]
elif
not
raw
:
p
[
"
outfit_recommendation
s"
]
=
[]
p
[
"
similar_item
s"
]
=
[]
return
products
async
def
search
(
self
,
literal
:
str
,
inferred
:
Dict
[
str
,
Any
],
check_stock
:
bool
=
True
)
->
Dict
[
str
,
Any
]:
...
...
@@ -363,7 +363,7 @@ class SearchEngine:
if
products
:
if
check_stock
:
products
=
await
enrich_with_stock
(
products
)
products
=
self
.
_parse_
outfit_recommendation
s
(
products
)
products
=
self
.
_parse_
similar_item
s
(
products
)
for
p
in
products
:
raw_size
=
p
.
get
(
"size_scale"
,
""
)
parsed
=
[
s
.
strip
()
for
s
in
str
(
raw_size
)
.
replace
(
"["
,
""
)
.
replace
(
"]"
,
""
)
.
replace
(
'"'
,
''
)
.
split
(
","
)
if
s
.
strip
()]
...
...
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