Skip to content

Commit

Permalink
ADD character limit for SQL generate table description.
Browse files Browse the repository at this point in the history
  • Loading branch information
karminski committed Jul 19, 2023
1 parent e7aa1fe commit bcaa248
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/repository/generate_sql_peripheral_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
// - user description, like "A query to list the names of the departments which employed more than 10 employees in the last 3 months"
// - action: like "INSERT, UPDATE ... "
const GENERATE_SQL_DESCRIPTION_TEMPALTE = "### %s tables, with their properties: #%s #### %s %s"
const TABLE_DESC_CHARACTER_LIMIT = 1000

type GenerateSQLPeripheralRequest struct {
Description string `json:"description" validate:"required"`
Expand Down Expand Up @@ -105,6 +106,9 @@ func NewGenerateSQLPeripheralRequest(resourceType string, metaInfo map[string]in
}
tableDesc := generateTableDescription(tableName, tableFields)
allTableDesc += tableDesc
if len(allTableDesc) > TABLE_DESC_CHARACTER_LIMIT {
break
}
}
}
}
Expand Down

0 comments on commit bcaa248

Please sign in to comment.