refactor: remove mineru_api_base_url from ParserEngineConfig and related components
- Eliminated the `mineru_api_base_url` field from the `ParserEngineConfig` interface and its usage across the application, simplifying the configuration structure. - Updated the `ParserEngineSettings` view to remove the corresponding input field, enhancing the user interface. - Adjusted the `PingMinerUCloud` function to no longer require the base URL parameter, defaulting to a predefined value instead. - Modified database migration comments to reflect the removal of the base URL from the configuration. These changes streamline the configuration process for the MinerU Cloud integration, improving clarity and reducing potential misconfigurations.
This commit is contained in:
@@ -202,10 +202,9 @@ func (c *ConversationConfig) Scan(value interface{}) error {
|
||||
// ParserEngineConfig holds tenant-level overrides for document parser engines (e.g. MinerU endpoint, API key).
|
||||
// These values take precedence over environment variables when parsing documents.
|
||||
type ParserEngineConfig struct {
|
||||
DocReaderAddr string `json:"docreader_addr"` // 文档解析服务地址
|
||||
MinerUEndpoint string `json:"mineru_endpoint"` // MinerU 自建服务端点
|
||||
MinerUAPIKey string `json:"mineru_api_key"` // MinerU 云 API Key
|
||||
MinerUAPIBaseURL string `json:"mineru_api_base_url"` // MinerU 云 API Base URL(可选)
|
||||
DocReaderAddr string `json:"docreader_addr"` // 文档解析服务地址
|
||||
MinerUEndpoint string `json:"mineru_endpoint"` // MinerU 自建服务端点
|
||||
MinerUAPIKey string `json:"mineru_api_key"` // MinerU 云 API Key
|
||||
|
||||
// MinerU 自建解析参数
|
||||
MinerUModel string `json:"mineru_model,omitempty"` // backend: pipeline, vlm-*, hybrid-*
|
||||
@@ -223,7 +222,7 @@ type ParserEngineConfig struct {
|
||||
}
|
||||
|
||||
// ToOverridesMap returns a map suitable for ParserEngineOverrides in parse requests.
|
||||
// Keys are snake_case (mineru_endpoint, mineru_api_key, mineru_api_base_url).
|
||||
// Keys are snake_case (mineru_endpoint, mineru_api_key, etc.).
|
||||
func (c *ParserEngineConfig) ToOverridesMap() map[string]string {
|
||||
if c == nil {
|
||||
return nil
|
||||
@@ -235,9 +234,6 @@ func (c *ParserEngineConfig) ToOverridesMap() map[string]string {
|
||||
if c.MinerUAPIKey != "" {
|
||||
m["mineru_api_key"] = c.MinerUAPIKey
|
||||
}
|
||||
if c.MinerUAPIBaseURL != "" {
|
||||
m["mineru_api_base_url"] = c.MinerUAPIBaseURL
|
||||
}
|
||||
if c.MinerUModel != "" {
|
||||
m["mineru_model"] = c.MinerUModel
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user