File size: 378 Bytes
cad2de1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
export function buildProviderScopedModel(model: string, provider?: string | null): string {
	if (!provider) {
		return model;
	}

	const trimmedProvider = provider.trim();
	if (!trimmedProvider) {
		return model;
	}

	const colonIndex = model.indexOf(":");
	const baseModel = colonIndex === -1 ? model : model.slice(0, colonIndex);

	return `${baseModel}:${trimmedProvider}`;
}