mirror of
				https://github.com/songquanpeng/one-api.git
				synced 2025-10-31 22:03:41 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			19 lines
		
	
	
		
			490 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			19 lines
		
	
	
		
			490 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package doubao
 | |
| 
 | |
| import (
 | |
| 	"fmt"
 | |
| 	"github.com/songquanpeng/one-api/relay/meta"
 | |
| 	"github.com/songquanpeng/one-api/relay/relaymode"
 | |
| )
 | |
| 
 | |
| func GetRequestURL(meta *meta.Meta) (string, error) {
 | |
| 	switch meta.Mode {
 | |
| 	case relaymode.ChatCompletions:
 | |
| 		return fmt.Sprintf("%s/api/v3/chat/completions", meta.BaseURL), nil
 | |
| 	case relaymode.Embeddings:
 | |
| 		return fmt.Sprintf("%s/api/v3/embeddings", meta.BaseURL), nil
 | |
| 	default:
 | |
| 	}
 | |
| 	return "", fmt.Errorf("unsupported relay mode %d for doubao", meta.Mode)
 | |
| }
 |