Skip to content

Commit e919ce3

Browse files
authored
feat: Azure OpenAI gpt 5.1 support (#2176)
* feat: add gpt-5.1 model series * chore: bump version to 0.0.31
1 parent 3f47dc3 commit e919ce3

File tree

3 files changed

+407
-2
lines changed

3 files changed

+407
-2
lines changed

models/azure_openai/manifest.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ resource:
2424
model:
2525
enabled: false
2626
type: plugin
27-
version: 0.0.30
27+
version: 0.0.31

models/azure_openai/models/constants.py

Lines changed: 382 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2447,7 +2447,388 @@ class AzureBaseModel(BaseModel):
24472447
currency="USD",
24482448
),
24492449
),
2450-
)
2450+
),
2451+
# GPT-5.1 Series
2452+
AzureBaseModel(
2453+
base_model_name="gpt-5.1",
2454+
entity=AIModelEntity(
2455+
model="fake-deployment-name",
2456+
label=I18nObject(
2457+
en_US="fake-deployment-name-label",
2458+
),
2459+
model_type=ModelType.LLM,
2460+
features=[
2461+
ModelFeature.AGENT_THOUGHT,
2462+
ModelFeature.MULTI_TOOL_CALL,
2463+
ModelFeature.STREAM_TOOL_CALL,
2464+
ModelFeature.VISION,
2465+
ModelFeature.STRUCTURED_OUTPUT,
2466+
],
2467+
fetch_from=FetchFrom.CUSTOMIZABLE_MODEL,
2468+
model_properties={
2469+
ModelPropertyKey.MODE: LLMMode.CHAT.value,
2470+
ModelPropertyKey.CONTEXT_SIZE: 272000,
2471+
},
2472+
parameter_rules=[
2473+
ParameterRule(
2474+
name="response_format",
2475+
label=I18nObject(zh_Hans="回复格式", en_US="response_format"),
2476+
type="string",
2477+
help=I18nObject(
2478+
zh_Hans="指定模型必须输出的格式",
2479+
en_US="specifying the format that the model must output",
2480+
),
2481+
required=False,
2482+
options=["text", "json_object", "json_schema"],
2483+
),
2484+
ParameterRule(
2485+
name="json_schema",
2486+
label=I18nObject(en_US="JSON Schema"),
2487+
type="text",
2488+
help=I18nObject(
2489+
zh_Hans="设置返回的json schema,llm将按照它返回",
2490+
en_US="Set a response json schema will ensure LLM to adhere it.",
2491+
),
2492+
required=False,
2493+
),
2494+
ParameterRule(
2495+
name="reasoning_effort",
2496+
label=I18nObject(zh_Hans="推理工作", en_US="reasoning_effort"),
2497+
type="string",
2498+
help=I18nObject(
2499+
zh_Hans="限制推理模型的推理工作",
2500+
en_US="constrains effort on reasoning for reasoning models",
2501+
),
2502+
required=False,
2503+
options=["none", "minimal", "low", "medium", "high"],
2504+
default="none",
2505+
),
2506+
ParameterRule(
2507+
name="verbosity",
2508+
label=I18nObject(zh_Hans="详细程度", en_US="verbosity"),
2509+
type="string",
2510+
help=I18nObject(
2511+
zh_Hans="约束模型响应的详细程度。较低的值将产生更简洁的响应,而较高的值将产生更详细的响应。"
2512+
"支持的值包括low、medium和high",
2513+
en_US="Constrains the verbosity of the model's response. "
2514+
"Lower values will result in more concise responses, "
2515+
"while higher values will result in more verbose responses. "
2516+
"Currently supported values are low, medium, and high",
2517+
),
2518+
required=False,
2519+
options=["low", "medium", "high"],
2520+
default="medium",
2521+
),
2522+
_get_o1_max_tokens(default=4096, min_val=1, max_val=128000),
2523+
],
2524+
pricing=PriceConfig(
2525+
input=1.25,
2526+
output=10,
2527+
unit=0.000001,
2528+
currency="USD",
2529+
),
2530+
),
2531+
),
2532+
AzureBaseModel(
2533+
base_model_name="gpt-5.1-chat",
2534+
entity=AIModelEntity(
2535+
model="fake-deployment-name",
2536+
label=I18nObject(
2537+
en_US="fake-deployment-name-label",
2538+
),
2539+
model_type=ModelType.LLM,
2540+
features=[
2541+
ModelFeature.AGENT_THOUGHT,
2542+
ModelFeature.MULTI_TOOL_CALL,
2543+
ModelFeature.STREAM_TOOL_CALL,
2544+
ModelFeature.VISION,
2545+
ModelFeature.STRUCTURED_OUTPUT,
2546+
],
2547+
fetch_from=FetchFrom.CUSTOMIZABLE_MODEL,
2548+
model_properties={
2549+
ModelPropertyKey.MODE: LLMMode.CHAT.value,
2550+
ModelPropertyKey.CONTEXT_SIZE: 111616,
2551+
},
2552+
parameter_rules=[
2553+
ParameterRule(
2554+
name="response_format",
2555+
label=I18nObject(zh_Hans="回复格式", en_US="response_format"),
2556+
type="string",
2557+
help=I18nObject(
2558+
zh_Hans="指定模型必须输出的格式",
2559+
en_US="specifying the format that the model must output",
2560+
),
2561+
required=False,
2562+
options=["text", "json_object", "json_schema"],
2563+
),
2564+
ParameterRule(
2565+
name="json_schema",
2566+
label=I18nObject(en_US="JSON Schema"),
2567+
type="text",
2568+
help=I18nObject(
2569+
zh_Hans="设置返回的json schema,llm将按照它返回",
2570+
en_US="Set a response json schema will ensure LLM to adhere it.",
2571+
),
2572+
required=False,
2573+
),
2574+
ParameterRule(
2575+
name="reasoning_effort",
2576+
label=I18nObject(zh_Hans="推理工作", en_US="reasoning_effort"),
2577+
type="string",
2578+
help=I18nObject(
2579+
zh_Hans="限制推理模型的推理工作",
2580+
en_US="constrains effort on reasoning for reasoning models",
2581+
),
2582+
required=False,
2583+
options=["none", "minimal", "low", "medium", "high"],
2584+
default="none",
2585+
),
2586+
ParameterRule(
2587+
name="verbosity",
2588+
label=I18nObject(zh_Hans="详细程度", en_US="verbosity"),
2589+
type="string",
2590+
help=I18nObject(
2591+
zh_Hans="约束模型响应的详细程度。较低的值将产生更简洁的响应,而较高的值将产生更详细的响应。"
2592+
"支持的值包括low、medium和high",
2593+
en_US="Constrains the verbosity of the model's response. "
2594+
"Lower values will result in more concise responses, "
2595+
"while higher values will result in more verbose responses. "
2596+
"Currently supported values are low, medium, and high",
2597+
),
2598+
required=False,
2599+
options=["low", "medium", "high"],
2600+
default="medium",
2601+
),
2602+
_get_o1_max_tokens(default=4096, min_val=1, max_val=16384),
2603+
],
2604+
pricing=PriceConfig(
2605+
input=0.5,
2606+
output=2,
2607+
unit=0.000001,
2608+
currency="USD",
2609+
),
2610+
),
2611+
),
2612+
AzureBaseModel(
2613+
base_model_name="gpt-5.1-codex",
2614+
entity=AIModelEntity(
2615+
model="fake-deployment-name",
2616+
label=I18nObject(
2617+
zh_Hans="gpt-5.1-codex",
2618+
en_US="gpt-5.1-codex",
2619+
),
2620+
model_type=ModelType.LLM,
2621+
features=[
2622+
ModelFeature.AGENT_THOUGHT,
2623+
ModelFeature.MULTI_TOOL_CALL,
2624+
ModelFeature.STREAM_TOOL_CALL,
2625+
ModelFeature.STRUCTURED_OUTPUT,
2626+
],
2627+
fetch_from=FetchFrom.CUSTOMIZABLE_MODEL,
2628+
model_properties={
2629+
ModelPropertyKey.MODE: LLMMode.CHAT.value,
2630+
ModelPropertyKey.CONTEXT_SIZE: 272000,
2631+
},
2632+
parameter_rules=[
2633+
ParameterRule(
2634+
name="top_p",
2635+
**PARAMETER_RULE_TEMPLATE[DefaultParameterName.TOP_P],
2636+
),
2637+
ParameterRule(
2638+
name="presence_penalty",
2639+
**PARAMETER_RULE_TEMPLATE[DefaultParameterName.PRESENCE_PENALTY],
2640+
),
2641+
ParameterRule(
2642+
name="frequency_penalty",
2643+
**PARAMETER_RULE_TEMPLATE[DefaultParameterName.FREQUENCY_PENALTY],
2644+
),
2645+
_get_max_tokens(default=4096, min_val=1, max_val=128000),
2646+
ParameterRule(
2647+
name="seed",
2648+
label=I18nObject(zh_Hans="种子", en_US="Seed"),
2649+
type="int",
2650+
help=AZURE_DEFAULT_PARAM_SEED_HELP,
2651+
required=False,
2652+
precision=0,
2653+
min=0,
2654+
max=2147483647,
2655+
),
2656+
ParameterRule(
2657+
name="response_format",
2658+
label=I18nObject(zh_Hans="回复格式", en_US="response_format"),
2659+
type="string",
2660+
help=I18nObject(
2661+
zh_Hans="指定模型按格式输出,如选择JSON格式,需在System Message或User Message中"
2662+
"指引模型输出JSON格式,如:“请按照json格式输出。”",
2663+
en_US="specifying the format that the model must output",
2664+
),
2665+
required=False,
2666+
options=["text", "json_object", "json_schema"],
2667+
),
2668+
ParameterRule(
2669+
name="json_schema",
2670+
label=I18nObject(en_US="JSON Schema"),
2671+
type="text",
2672+
help=I18nObject(
2673+
zh_Hans="设置返回的json schema,llm将按照它返回",
2674+
en_US="Set a response json schema will ensure LLM to adhere it.",
2675+
),
2676+
required=False,
2677+
),
2678+
ParameterRule(
2679+
name="reasoning_effort",
2680+
label=I18nObject(zh_Hans="推理工作", en_US="reasoning_effort"),
2681+
type="string",
2682+
help=I18nObject(
2683+
zh_Hans="限制推理模型的推理工作",
2684+
en_US="constrains effort on reasoning for reasoning models",
2685+
),
2686+
required=False,
2687+
options=["none", "low", "medium", "high"],
2688+
default="none",
2689+
),
2690+
ParameterRule(
2691+
name="reasoning_summary",
2692+
label=I18nObject(zh_Hans="推理摘要", en_US="reasoning_summary"),
2693+
type="string",
2694+
help=I18nObject(
2695+
zh_Hans="模型执行推理的摘要。",
2696+
en_US="A summary of the reasoning performed by the model. ",
2697+
),
2698+
required=False,
2699+
options=["auto", "detailed"],
2700+
),
2701+
ParameterRule(
2702+
name="verbosity",
2703+
label=I18nObject(zh_Hans="详细程度", en_US="verbosity"),
2704+
type="string",
2705+
help=I18nObject(
2706+
zh_Hans="限制模型响应的详细程度。",
2707+
en_US="Constrains the verbosity of the model's response. ",
2708+
),
2709+
required=False,
2710+
options=["low", "medium", "high"],
2711+
default="medium",
2712+
),
2713+
],
2714+
pricing=PriceConfig(
2715+
input=1.25,
2716+
output=10,
2717+
unit=0.000001,
2718+
currency="USD",
2719+
),
2720+
),
2721+
),
2722+
AzureBaseModel(
2723+
base_model_name="gpt-5.1-codex-mini",
2724+
entity=AIModelEntity(
2725+
model="fake-deployment-name",
2726+
label=I18nObject(
2727+
zh_Hans="gpt-5.1-codex-mini",
2728+
en_US="gpt-5.1-codex-mini",
2729+
),
2730+
model_type=ModelType.LLM,
2731+
features=[
2732+
ModelFeature.AGENT_THOUGHT,
2733+
ModelFeature.MULTI_TOOL_CALL,
2734+
ModelFeature.STREAM_TOOL_CALL,
2735+
ModelFeature.STRUCTURED_OUTPUT,
2736+
],
2737+
fetch_from=FetchFrom.CUSTOMIZABLE_MODEL,
2738+
model_properties={
2739+
ModelPropertyKey.MODE: LLMMode.CHAT.value,
2740+
ModelPropertyKey.CONTEXT_SIZE: 272000,
2741+
},
2742+
parameter_rules=[
2743+
ParameterRule(
2744+
name="top_p",
2745+
**PARAMETER_RULE_TEMPLATE[DefaultParameterName.TOP_P],
2746+
),
2747+
ParameterRule(
2748+
name="presence_penalty",
2749+
**PARAMETER_RULE_TEMPLATE[DefaultParameterName.PRESENCE_PENALTY],
2750+
),
2751+
ParameterRule(
2752+
name="frequency_penalty",
2753+
**PARAMETER_RULE_TEMPLATE[DefaultParameterName.FREQUENCY_PENALTY],
2754+
),
2755+
_get_max_tokens(default=4096, min_val=1, max_val=128000),
2756+
ParameterRule(
2757+
name="seed",
2758+
label=I18nObject(zh_Hans="种子", en_US="Seed"),
2759+
type="int",
2760+
help=AZURE_DEFAULT_PARAM_SEED_HELP,
2761+
required=False,
2762+
precision=0,
2763+
min=0,
2764+
max=2147483647,
2765+
),
2766+
ParameterRule(
2767+
name="response_format",
2768+
label=I18nObject(zh_Hans="回复格式", en_US="response_format"),
2769+
type="string",
2770+
help=I18nObject(
2771+
zh_Hans="指定模型按格式输出,如选择JSON格式,需在System Message或User Message中"
2772+
"指引模型输出JSON格式,如:“请按照json格式输出。”",
2773+
en_US="specifying the format that the model must output",
2774+
),
2775+
required=False,
2776+
options=["text", "json_object", "json_schema"],
2777+
),
2778+
ParameterRule(
2779+
name="json_schema",
2780+
label=I18nObject(en_US="JSON Schema"),
2781+
type="text",
2782+
help=I18nObject(
2783+
zh_Hans="设置返回的json schema,llm将按照它返回",
2784+
en_US="Set a response json schema will ensure LLM to adhere it.",
2785+
),
2786+
required=False,
2787+
),
2788+
ParameterRule(
2789+
name="reasoning_effort",
2790+
label=I18nObject(zh_Hans="推理工作", en_US="reasoning_effort"),
2791+
type="string",
2792+
help=I18nObject(
2793+
zh_Hans="限制推理模型的推理工作",
2794+
en_US="constrains effort on reasoning for reasoning models",
2795+
),
2796+
required=False,
2797+
options=["none", "low", "medium", "high"],
2798+
default="none",
2799+
),
2800+
ParameterRule(
2801+
name="reasoning_summary",
2802+
label=I18nObject(zh_Hans="推理摘要", en_US="reasoning_summary"),
2803+
type="string",
2804+
help=I18nObject(
2805+
zh_Hans="模型执行推理的摘要。",
2806+
en_US="A summary of the reasoning performed by the model. ",
2807+
),
2808+
required=False,
2809+
options=["auto", "detailed"],
2810+
),
2811+
ParameterRule(
2812+
name="verbosity",
2813+
label=I18nObject(zh_Hans="详细程度", en_US="verbosity"),
2814+
type="string",
2815+
help=I18nObject(
2816+
zh_Hans="限制模型响应的详细程度。",
2817+
en_US="Constrains the verbosity of the model's response. ",
2818+
),
2819+
required=False,
2820+
options=["low", "medium", "high"],
2821+
default="medium",
2822+
),
2823+
],
2824+
pricing=PriceConfig(
2825+
input=0.3,
2826+
output=1.2,
2827+
unit=0.000001,
2828+
currency="USD",
2829+
),
2830+
),
2831+
),
24512832
]
24522833
EMBEDDING_BASE_MODELS = [
24532834
AzureBaseModel(

0 commit comments

Comments
 (0)