Add api_key mapping in VectorStoreConfig conversion
- Introduced mapping for the api_key field in the toVectorStoreConfig method to enhance configuration handling. - This addition allows for the inclusion of the api_key in the extraParams, improving the flexibility of the configuration process.
This commit is contained in:
parent
3b26873d56
commit
72fe081a28
1 changed files with 5 additions and 0 deletions
|
|
@ -139,6 +139,11 @@ func (c *Config) toVectorStoreConfig() (types.VectorStoreConfig, error) {
|
|||
extraParams["port"] = port
|
||||
}
|
||||
|
||||
// Map api_key field
|
||||
if apiKey, exists := configCopy["api_key"]; exists {
|
||||
extraParams["api_key"] = apiKey
|
||||
}
|
||||
|
||||
// Convert config to types.VectorStoreConfig via JSON
|
||||
jsonData, err := json.Marshal(configCopy)
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue