tender summary response fix
This commit is contained in:
@@ -53,8 +53,9 @@ func (c *Client) FetchSummaryOnDemand(ctx context.Context, reqBody SummarizeRequ
|
||||
for attempt := 0; attempt <= c.config.APIRetryCount; attempt++ {
|
||||
if attempt > 0 {
|
||||
c.logger.Warn("Retrying AI summarize request", map[string]interface{}{
|
||||
"notice_id": reqBody.NoticeID,
|
||||
"attempt": attempt,
|
||||
"contract_folder_id": reqBody.ContractFolderID,
|
||||
"notice_publication_id": reqBody.NoticePublicationID,
|
||||
"attempt": attempt,
|
||||
})
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
@@ -67,9 +68,10 @@ func (c *Client) FetchSummaryOnDemand(ctx context.Context, reqBody SummarizeRequ
|
||||
if err != nil {
|
||||
lastErr = err
|
||||
c.logger.Error("AI summarize request failed", map[string]interface{}{
|
||||
"notice_id": reqBody.NoticeID,
|
||||
"attempt": attempt,
|
||||
"error": err.Error(),
|
||||
"contract_folder_id": reqBody.ContractFolderID,
|
||||
"notice_publication_id": reqBody.NoticePublicationID,
|
||||
"attempt": attempt,
|
||||
"error": err.Error(),
|
||||
})
|
||||
continue
|
||||
}
|
||||
@@ -205,8 +207,9 @@ func (c *Client) doPost(ctx context.Context, url string, jsonBody []byte) (*Summ
|
||||
}
|
||||
|
||||
c.logger.Info("AI summarize request succeeded", map[string]interface{}{
|
||||
"notice_id": result.NoticeID,
|
||||
"summaries_count": len(result.Summaries),
|
||||
"contract_folder_id": result.ContractFolderID,
|
||||
"notice_publication_id": result.ResolvedNoticePublicationID(),
|
||||
"summaries_count": len(result.Summaries),
|
||||
})
|
||||
|
||||
return &result, nil
|
||||
|
||||
Reference in New Issue
Block a user