Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Edadil
MS
model
Commits
ad74df56
Commit
ad74df56
authored
2 weeks ago
by
Шаронов Егор Алексеевич
Browse files
Options
Download
Patches
Plain Diff
update OTLPConfig default to insecure=true and improve parsedProducts handling
parent
efcdec34
master
No related merge requests found
Pipeline
#172748
passed with stages
in 1 minute and 5 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
config/config.go
+1
-1
config/config.go
internal/productassistant/server.go
+9
-2
internal/productassistant/server.go
with
10 additions
and
3 deletions
+10
-3
config/config.go
+
1
−
1
View file @
ad74df56
...
...
@@ -77,7 +77,7 @@ type OTelConfig struct {
// OTLPConfig задаёт параметры приёма трейсов.
type
OTLPConfig
struct
{
Insecure
bool
`env:"INSECURE,default=
fals
e"`
Insecure
bool
`env:"INSECURE,default=
tru
e"`
Endpoint
string
`env:"ENDPOINT,default=localhost:4317" validate:"required,url"`
Timeout
time
.
Duration
`env:"TIMEOUT,default=10s"`
HTTP
bool
`env:"HTTP,default=false"`
...
...
This diff is collapsed.
Click to expand it.
internal/productassistant/server.go
+
9
−
2
View file @
ad74df56
...
...
@@ -334,8 +334,15 @@ func (s *Server) PostLlmRequest(ctx context.Context, req PostLlmRequestRequestOb
cnt
=
make
(
map
[
string
]
interface
{})
}
parsedProducts
,
_
:=
s
.
ProductService
.
GetParsedProductsByAbstractID
(
ctx
,
p
.
ID
)
minPrice
:=
parsedProducts
[
0
]
.
Price
firstPhoto
:=
parsedProducts
[
0
]
.
PhotoUrls
[
0
]
var
minPrice
=
0.0
var
firstPhoto
=
""
if
(
len
(
parsedProducts
))
>
0
{
minPrice
=
parsedProducts
[
0
]
.
Price
if
len
(
parsedProducts
[
0
]
.
PhotoUrls
)
>
0
{
firstPhoto
=
parsedProducts
[
0
]
.
PhotoUrls
[
0
]
}
}
for
_
,
pp
:=
range
parsedProducts
{
minPrice
=
min
(
minPrice
,
pp
.
Price
)
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets