2323logger .addHandler (status .trace_logging )
2424
2525AICORE_MODELS = {
26- 'aicore-ibm' :
27- [
28- 'ibm--granite-13b-chat'
29- ],
3026 'aicore-mistralai' :
3127 [
3228 'mistralai--mistral-large-instruct' ,
3329 'mistralai--mistral-medium-instruct' ,
3430 'mistralai--mistral-small-instruct' ,
3531 ],
36- 'aicore-opensource' :
37- [
38- 'meta--llama3.1-70b-instruct' ,
39- ],
4032 'aws-bedrock' :
4133 [
4234 'amazon--nova-lite' ,
4335 'amazon--nova-micro' ,
4436 'amazon--nova-pro' ,
4537 'amazon--nova-premier' ,
4638 'anthropic--claude-3-haiku' ,
47- 'anthropic--claude-3-opus' ,
48- 'anthropic--claude-3.5-sonnet' ,
4939 'anthropic--claude-3.7-sonnet' ,
50- 'anthropic--claude-4-sonnet' ,
5140 'anthropic--claude-4-opus' ,
52- 'anthropic--claude-4.5 -sonnet' ,
41+ 'anthropic--claude-4-sonnet' ,
5342 'anthropic--claude-4.5-haiku' ,
43+ 'anthropic--claude-4.5-opus' ,
44+ 'anthropic--claude-4.5-sonnet' ,
45+ 'anthropic--claude-4.6-opus' ,
46+ 'anthropic--claude-4.6-sonnet' ,
5447 ],
5548 'azure-openai' :
5649 [
6255 'gpt-5' ,
6356 'gpt-5-mini' ,
6457 'gpt-5-nano' ,
58+ 'gpt-5.2' ,
6559 'o1' ,
6660 'o3' ,
6761 'o3-mini' ,
7973 [
8074 'sonar' ,
8175 'sonar-pro' ,
76+ 'sonar-deep-research' ,
8277 ],
8378}
8479
@@ -97,28 +92,28 @@ def from_model_name(cls, model_name: str) -> 'LLM':
9792 Useful because the user can specify only the name in the agent.
9893 """
9994 # Foundation-models scenarios in AI Core
100- if model_name in AICORE_MODELS [ 'azure-openai' ] :
95+ if model_name in AICORE_MODELS . get ( 'azure-openai' , []) :
10196 return AICoreOpenAILLM (model_name )
10297 # IBM models are compatible with OpenAI completion API
103- if model_name in AICORE_MODELS [ 'aicore-ibm' ] :
98+ if model_name in AICORE_MODELS . get ( 'aicore-ibm' , []) :
10499 return AICoreOpenAILLM (model_name )
105- if model_name in AICORE_MODELS [ 'aicore-opensource' ] :
100+ if model_name in AICORE_MODELS . get ( 'aicore-opensource' , []) :
106101 return AICoreOpenAILLM (model_name , False )
107102 # Mistral models are compatible with OpenAI completion API
108- if model_name in AICORE_MODELS [ 'aicore-mistralai' ] :
103+ if model_name in AICORE_MODELS . get ( 'aicore-mistralai' , []) :
109104 return AICoreOpenAILLM (model_name , False )
110105 # Perplexity models are compatible with OpenAI completion API
111- if model_name in AICORE_MODELS [ 'perplexity-ai' ] :
106+ if model_name in AICORE_MODELS . get ( 'perplexity-ai' , []) :
112107 return AICoreOpenAILLM (model_name )
113108
114109 # Non OpenAI-compatible models in AI Core
115- if model_name in AICORE_MODELS [ 'aws-bedrock' ] :
110+ if model_name in AICORE_MODELS . get ( 'aws-bedrock' , []) :
116111 if 'titan' in model_name :
117112 # Titan models don't support system prompts
118113 return AICoreAmazonBedrockLLM (model_name , False )
119114 else :
120115 return AICoreAmazonBedrockLLM (model_name )
121- if model_name in AICORE_MODELS [ 'gcp-vertexai' ] :
116+ if model_name in AICORE_MODELS . get ( 'gcp-vertexai' , []) :
122117 return AICoreGoogleVertexLLM (model_name )
123118
124119 # Custom models
0 commit comments