mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-22 16:36:47 +08:00
Go: add new provider minimax (#14296)
### What problem does this PR solve? 1. Add new provider minimax 2. Add new command: CHECK INSTANCE 'instance_name' FROM 'provider_name'; ``` RAGFlow(user)> check instance 'test' from 'minimax'; SUCCESS ``` ### Type of change - [x] New Feature (non-breaking change which adds functionality) Signed-off-by: Jin Hai <haijin.chn@gmail.com>
This commit is contained in:
@@ -2325,6 +2325,42 @@ func (p *Parser) parseStreamCommand() (*Command, error) {
|
||||
return command, nil
|
||||
}
|
||||
|
||||
func (p *Parser) parseCheckCommand() (*Command, error) {
|
||||
p.nextToken() // consume CHECK
|
||||
|
||||
if p.curToken.Type != TokenInstance {
|
||||
return nil, fmt.Errorf("expected INSTANCE after CHECK")
|
||||
}
|
||||
p.nextToken()
|
||||
|
||||
if p.curToken.Type != TokenQuotedString {
|
||||
return nil, fmt.Errorf("expected instance name after INSTANCE")
|
||||
}
|
||||
instanceName := p.curToken.Value
|
||||
p.nextToken()
|
||||
|
||||
if p.curToken.Type != TokenFrom {
|
||||
return nil, fmt.Errorf("expected FROM after instance name")
|
||||
}
|
||||
p.nextToken()
|
||||
|
||||
if p.curToken.Type != TokenQuotedString {
|
||||
return nil, fmt.Errorf("expected provider name after FROM")
|
||||
}
|
||||
providerName := p.curToken.Value
|
||||
p.nextToken()
|
||||
|
||||
// Semicolon is optional
|
||||
if p.curToken.Type == TokenSemicolon {
|
||||
p.nextToken()
|
||||
}
|
||||
|
||||
cmd := NewCommand("check_provider_connection")
|
||||
cmd.Params["provider_name"] = providerName
|
||||
cmd.Params["instance_name"] = instanceName
|
||||
return cmd, nil
|
||||
}
|
||||
|
||||
func (p *Parser) parseUseCommand() (*Command, error) {
|
||||
p.nextToken() // consume USE
|
||||
|
||||
|
||||
Reference in New Issue
Block a user