[model-gateway] bug fix on module name (#16332)

This commit is contained in:
Chang Su
2026-01-02 21:56:18 -08:00
committed by GitHub
parent bdde949619
commit d8ac5eecf7
66 changed files with 189 additions and 222 deletions
@@ -1,5 +1,5 @@
use serde_json::json;
use sgl_model_gateway::protocols::{
use smg::protocols::{
chat::{ChatCompletionRequest, ChatMessage, MessageContent},
common::{
Function, FunctionCall, FunctionChoice, StreamOptions, Tool, ToolChoice, ToolChoiceValue,
+1 -1
View File
@@ -1,5 +1,5 @@
use serde_json::json;
use sgl_model_gateway::protocols::chat::{ChatMessage, MessageContent};
use smg::protocols::chat::{ChatMessage, MessageContent};
#[test]
fn test_chat_message_tagged_by_role_system() {
+1 -1
View File
@@ -1,5 +1,5 @@
use serde_json::{from_str, json, to_string};
use sgl_model_gateway::protocols::{common::GenerationRequest, embedding::EmbeddingRequest};
use smg::protocols::{common::GenerationRequest, embedding::EmbeddingRequest};
#[test]
fn test_embedding_request_serialization_string_input() {
+1 -1
View File
@@ -1,7 +1,7 @@
use std::collections::HashMap;
use serde_json::{from_str, to_string, Number, Value};
use sgl_model_gateway::protocols::{
use smg::protocols::{
common::{GenerationRequest, StringOrArray, UsageInfo},
rerank::{RerankRequest, RerankResponse, RerankResult, V1RerankReqInput},
};
+9 -9
View File
@@ -1,5 +1,5 @@
use serde_json::json;
use sgl_model_gateway::protocols::{
use smg::protocols::{
common::{Function, StringOrArray, ToolChoice, ToolChoiceValue},
responses::{
IncludeField, ResponseInput, ResponseInputOutputItem, ResponseTool, ResponseToolType,
@@ -963,7 +963,7 @@ fn test_validate_input_items_structure() {
/// Test tool_choice defaults to auto when tools are present
#[test]
fn test_normalize_tool_choice_auto() {
use sgl_model_gateway::protocols::validated::Normalizable;
use smg::protocols::validated::Normalizable;
let mut request = ResponsesRequest {
input: ResponseInput::Text("test".to_string()),
@@ -1004,7 +1004,7 @@ fn test_normalize_tool_choice_auto() {
/// Test tool_choice defaults to none when tools array is empty
#[test]
fn test_normalize_tool_choice_none() {
use sgl_model_gateway::protocols::validated::Normalizable;
use smg::protocols::validated::Normalizable;
let mut request = ResponsesRequest {
input: ResponseInput::Text("test".to_string()),
@@ -1031,7 +1031,7 @@ fn test_normalize_tool_choice_none() {
/// Test tool_choice is not overridden if already set
#[test]
fn test_normalize_tool_choice_no_override() {
use sgl_model_gateway::protocols::validated::Normalizable;
use smg::protocols::validated::Normalizable;
let mut request = ResponsesRequest {
input: ResponseInput::Text("test".to_string()),
@@ -1068,7 +1068,7 @@ fn test_normalize_tool_choice_no_override() {
/// Test parallel_tool_calls defaults to true when tools are present
#[test]
fn test_normalize_parallel_tool_calls() {
use sgl_model_gateway::protocols::validated::Normalizable;
use smg::protocols::validated::Normalizable;
let mut request = ResponsesRequest {
input: ResponseInput::Text("test".to_string()),
@@ -1107,7 +1107,7 @@ fn test_normalize_parallel_tool_calls() {
/// Test parallel_tool_calls is not set when tools are absent
#[test]
fn test_normalize_parallel_tool_calls_no_tools() {
use sgl_model_gateway::protocols::validated::Normalizable;
use smg::protocols::validated::Normalizable;
let mut request = ResponsesRequest {
input: ResponseInput::Text("test".to_string()),
@@ -1127,7 +1127,7 @@ fn test_normalize_parallel_tool_calls_no_tools() {
/// Test parallel_tool_calls is not overridden if already set
#[test]
fn test_normalize_parallel_tool_calls_no_override() {
use sgl_model_gateway::protocols::validated::Normalizable;
use smg::protocols::validated::Normalizable;
let mut request = ResponsesRequest {
input: ResponseInput::Text("test".to_string()),
@@ -1162,7 +1162,7 @@ fn test_normalize_parallel_tool_calls_no_override() {
/// Test store defaults to true
#[test]
fn test_normalize_store_default() {
use sgl_model_gateway::protocols::validated::Normalizable;
use smg::protocols::validated::Normalizable;
let mut request = ResponsesRequest {
input: ResponseInput::Text("test".to_string()),
@@ -1182,7 +1182,7 @@ fn test_normalize_store_default() {
/// Test store is not overridden if already set
#[test]
fn test_normalize_store_no_override() {
use sgl_model_gateway::protocols::validated::Normalizable;
use smg::protocols::validated::Normalizable;
let mut request = ResponsesRequest {
input: ResponseInput::Text("test".to_string()),