From 5097f7317c7443290c3ea03099491d594a4aace9 Mon Sep 17 00:00:00 2001 From: Andrey Nering Date: Thu, 11 Sep 2025 15:07:07 -0300 Subject: [PATCH] refactor: separate interface into its own type --- ai/content.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ai/content.go b/ai/content.go index df1f60e73733a68f2e71772050230eee15709468..cc431bbdea55ba9df8775ac471c621b127515ce3 100644 --- a/ai/content.go +++ b/ai/content.go @@ -1,5 +1,10 @@ package ai +// ProviderOptionsData is an interface for provider-specific options data. +type ProviderOptionsData interface { + Options() +} + // ProviderMetadata represents additional provider-specific metadata. // They are passed through from the provider to the AI SDK and enable // provider-specific results that can be fully encapsulated in the provider. @@ -14,7 +19,7 @@ package ai // "signature": "sig....." // } // } -type ProviderMetadata map[string]interface{ Options() } +type ProviderMetadata map[string]ProviderOptionsData // ProviderOptions represents additional provider-specific options. // Options are additional input to the provider. They are passed through @@ -34,7 +39,7 @@ type ProviderMetadata map[string]interface{ Options() } // "cacheControl": { "type": "ephemeral" } // } // } -type ProviderOptions map[string]interface{ Options() } +type ProviderOptions map[string]ProviderOptionsData // FinishReason represents why a language model finished generating a response. //