PluginProbe
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot / 4.9.4
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot v4.9.4
4.9.4 4.9.3 4.9.2 4.9.1 4.9.0 4.8.2 4.8.1 4.8.0 4.7.0 4.6.2 4.6.1 4.6.0 4.5.6 4.5.5 4.5.4 4.5.3 4.5.2 4.5.1 4.5.0 4.4.1 4.4.0 3.3.4 3.4.0 3.4.1 3.4.2 All 202 releases
← All changes | includes/AI/ModelRegistry.php +38 -0 4.9.0 → 4.9.4 View file →
@@ -120,8 +120,46 @@
120 120 ) );
121 121 }
122 122
123 123 /**
124 + * Speech-to-text model per platform, for audio and video attachments.
125 + *
126 + * Kept apart from the chat catalogue above because it is not a user choice:
127 + * the Settings model picker selects the model that *writes the doc*, while
128 + * transcription is a fixed preprocessing step. A platform absent from this
129 + * map cannot transcribe, which is what Core\WriteWithAI::platform_supports()
130 + * reads — so adding a key here is all it takes to light up a new provider.
131 + *
132 + * @since 4.9.4
133 + *
134 + * @return array<string,string>
135 + */
136 + public static function transcription_models() {
137 + return apply_filters( 'betterdocs_ai_transcription_models', array(
138 + // Cheaper and faster than whisper-1 at comparable accuracy, and it
139 + // accepts the same container list — including video, whose audio
140 + // track the endpoint extracts server-side.
141 + 'openai' => 'gpt-4o-mini-transcribe',
142 + // Gemini has no speech endpoint; the media rides inline in an
143 + // ordinary generateContent call, so this is a normal chat model.
144 + 'gemini' => 'gemini-flash-latest',
145 + ) );
146 + }
147 +
148 + /**
149 + * The transcription model for a platform, or '' when it cannot transcribe.
150 + *
151 + * @since 4.9.4
152 + *
153 + * @param string $platform
154 + * @return string
155 + */
156 + public static function transcription_model( $platform ) {
157 + $models = self::transcription_models();
158 + return isset( $models[ $platform ] ) ? (string) $models[ $platform ] : '';
159 + }
160 +
161 + /**
124 162 * Models for one platform (model_id => label). Empty array if unknown.
125 163 *
126 164 * @param string $platform
127 165 * @return array<string,string>