Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
188 changes: 188 additions & 0 deletions aimux-providers/layout.toml
Original file line number Diff line number Diff line change
Expand Up @@ -498,3 +498,191 @@ rust = "vertex/partner_provider.rs"
status = "mapped"

[vertex.files.tests]

[openai_compatible]
package = "@ai-sdk/openai-compatible"
# chat/openai-compatible-chat-content-array.test.ts has no source file of its own name;
# every case in it is ported, so it needs no exclusions.

[[openai_compatible.files]]
upstream = "src/chat/convert-openai-compatible-chat-usage.ts"
rust = "openai_compatible/chat.rs"
status = "mapped"

[openai_compatible.files.tests]

[[openai_compatible.files]]
upstream = "src/chat/convert-to-openai-compatible-chat-messages.ts"
rust = "openai_compatible/convert.rs"
status = "mapped"

[openai_compatible.files.tests]

[[openai_compatible.files]]
upstream = "src/chat/get-response-metadata.ts"
rust = "openai_compatible/chat.rs"
status = "mapped"

[openai_compatible.files.tests]

[[openai_compatible.files]]
upstream = "src/chat/map-openai-compatible-finish-reason.ts"
rust = "openai_compatible/convert.rs"
status = "mapped"

[openai_compatible.files.tests]

[[openai_compatible.files]]
upstream = "src/chat/openai-compatible-api-types.ts"
rust = "openai_compatible/types.rs"
status = "mapped"

[openai_compatible.files.tests]

[[openai_compatible.files]]
upstream = "src/chat/openai-compatible-chat-language-model-options.ts"
rust = "openai_compatible/config.rs"
status = "mapped"

[openai_compatible.files.tests]

[[openai_compatible.files]]
upstream = "src/chat/openai-compatible-chat-language-model.ts"
rust = "openai_compatible/chat.rs"
status = "mapped"

[openai_compatible.files.tests]

[[openai_compatible.files]]
upstream = "src/chat/openai-compatible-metadata-extractor.ts"
rust = "openai_compatible/config.rs"
status = "mapped"

[openai_compatible.files.tests]

[[openai_compatible.files]]
upstream = "src/chat/openai-compatible-prepare-tools.ts"
rust = "openai_compatible/convert.rs"
status = "mapped"

[openai_compatible.files.tests]

[[openai_compatible.files]]
upstream = "src/completion/convert-openai-compatible-completion-usage.ts"
rust = "openai_compatible/completion.rs"
status = "mapped"

[openai_compatible.files.tests]

[[openai_compatible.files]]
upstream = "src/completion/convert-to-openai-compatible-completion-prompt.ts"
rust = "openai_compatible/completion.rs"
status = "mapped"

[openai_compatible.files.tests]

[[openai_compatible.files]]
upstream = "src/completion/get-response-metadata.ts"
rust = "openai_compatible/completion.rs"
status = "mapped"

[openai_compatible.files.tests]

[[openai_compatible.files]]
upstream = "src/completion/map-openai-compatible-finish-reason.ts"
rust = "openai_compatible/convert.rs"
status = "mapped"

[openai_compatible.files.tests]

[[openai_compatible.files]]
upstream = "src/completion/openai-compatible-completion-language-model-options.ts"
rust = "openai_compatible/completion.rs"
status = "mapped"

[openai_compatible.files.tests]

[[openai_compatible.files]]
upstream = "src/completion/openai-compatible-completion-language-model.ts"
rust = "openai_compatible/completion.rs"
status = "mapped"

[openai_compatible.files.tests]

[[openai_compatible.files]]
upstream = "src/embedding/openai-compatible-embedding-model-options.ts"
rust = "openai_compatible/embedding.rs"
status = "mapped"

[openai_compatible.files.tests]

[[openai_compatible.files]]
upstream = "src/embedding/openai-compatible-embedding-model.ts"
rust = "openai_compatible/embedding.rs"
status = "mapped"

[openai_compatible.files.tests]

[[openai_compatible.files]]
upstream = "src/image/openai-compatible-image-model-options.ts"
rust = "openai_compatible/image.rs"
status = "mapped"

[openai_compatible.files.tests]

[[openai_compatible.files]]
upstream = "src/image/openai-compatible-image-model.ts"
rust = "openai_compatible/image.rs"
status = "mapped"

[openai_compatible.files.tests]

[[openai_compatible.files]]
upstream = "src/image/openai-compatible-image-settings.ts"
rust = "openai_compatible/image.rs"
status = "mapped"

[openai_compatible.files.tests]

[[openai_compatible.files]]
upstream = "src/index.ts"
rust = "openai_compatible/mod.rs"
status = "mapped"

[openai_compatible.files.tests]

[[openai_compatible.files]]
upstream = "src/internal/index.ts"
rust = "openai_compatible/mod.rs"
status = "mapped"

[openai_compatible.files.tests]

[[openai_compatible.files]]
upstream = "src/openai-compatible-error.ts"
rust = "openai_compatible/config.rs"
status = "mapped"

[openai_compatible.files.tests]

[[openai_compatible.files]]
upstream = "src/openai-compatible-provider.ts"
rust = "openai_compatible/mod.rs"
status = "mapped"

[openai_compatible.files.tests]
ts-only = [
{ case = "OpenAICompatibleProvider › supportsStructuredOutputs setting › should pass supportsStructuredOutputs to .chatModel() and .languageModel() only", reason = "checks the settings handed to the mocked model constructors; aimux's completion, embedding and image models share the provider's chat settings and never read supportsStructuredOutputs, so nothing observable differs" },
{ case = "OpenAICompatibleProvider › supportsMultiPartToolContent setting › should pass supportsMultiPartToolContent to chat models only", reason = "checks the settings handed to the mocked model constructors; aimux's completion, embedding and image models share the provider's chat settings and never read supportsMultiPartToolContent, so nothing observable differs" },
]

[[openai_compatible.files]]
upstream = "src/utils/to-camel-case.ts"
rust = "openai_compatible/convert.rs"
status = "mapped"

[openai_compatible.files.tests]

[[openai_compatible.files]]
upstream = "src/version.ts"
status = "not-applicable"
2 changes: 1 addition & 1 deletion aimux-providers/src/openai_compatible/chat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ use crate::stream::{
/// of `aimux-provider-utils` use the injected or process-default transport.
pub struct OpenAICompatibleChatModel {
model_id: String,
config: CompatModelConfig,
pub(super) config: CompatModelConfig,
}

impl OpenAICompatibleChatModel {
Expand Down
4 changes: 2 additions & 2 deletions aimux-providers/src/openai_compatible/completion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use super::convert::{parse_finish_reason, to_camel_case};
use crate::openai::config::OpenAIModelConfig;

#[derive(Clone)]
enum CompletionConfig {
pub(super) enum CompletionConfig {
Compatible(CompatModelConfig),
Native(OpenAIModelConfig),
}
Expand All @@ -34,7 +34,7 @@ enum CompletionConfig {
#[derive(Clone)]
pub struct OpenAICompatibleCompletionModel {
model_id: String,
config: CompletionConfig,
pub(super) config: CompletionConfig,
}

impl OpenAICompatibleCompletionModel {
Expand Down
2 changes: 1 addition & 1 deletion aimux-providers/src/openai_compatible/embedding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use super::convert::to_camel_case;
/// An OpenAI-compatible embedding model.
pub struct OpenAICompatibleEmbeddingModel {
model_id: String,
config: CompatModelConfig,
pub(super) config: CompatModelConfig,
}

impl OpenAICompatibleEmbeddingModel {
Expand Down
2 changes: 1 addition & 1 deletion aimux-providers/src/openai_compatible/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use super::convert::to_camel_case;
/// An OpenAI-compatible image generation / editing model.
pub struct OpenAICompatibleImageModel {
model_id: String,
config: CompatModelConfig,
pub(super) config: CompatModelConfig,
}

impl OpenAICompatibleImageModel {
Expand Down
3 changes: 3 additions & 0 deletions aimux-providers/src/openai_compatible/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -363,3 +363,6 @@ impl ProviderDiscovery for OpenAICompatibleProvider {
Box::pin(async move { chat::list_models_once(&config).await })
}
}

#[cfg(test)]
mod tests;
Loading
Loading