Skip to content

Commit 8f29a41

Browse files
authored
Merge pull request #4675 from vespa-engine/bjorncs/openai-embedder-prepend-docs
docs: document <prepend> config for OpenAI embedder
2 parents 6ca7f39 + ab36064 commit 8f29a41

2 files changed

Lines changed: 23 additions & 0 deletions

File tree

en/rag/embedding.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -732,6 +732,11 @@ <h3 id="adding-a-fixed-string-to-a-query-text">Adding a fixed string to a query
732732
Find a complete example in the <a href="https://github.com/vespa-engine/sample-apps/tree/master/colbert">ColBERT</a>
733733
sample application.
734734
</p>
735+
<p>
736+
The <code>&lt;prepend&gt;</code> element is also supported by the
737+
<a href="../reference/rag/embedding.html#openai-embedder-reference-config">OpenAI embedder</a>,
738+
which is useful for OpenAI-compatible instruction-tuned models that expect a task-specific prefix.
739+
</p>
735740
<p>
736741
An alternative approach is using query profiles to prepend query data.
737742
If you need to add a standard wrapper or a prefix instruction around the input text you want to embed

en/reference/rag/embedding.html

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -661,6 +661,24 @@ <h3 id="openai-embedder-reference-config">OpenAI embedder reference config</h3>
661661
<td>element</td>
662662
<td>disabled</td>
663663
</tr>
664+
<tr>
665+
<td>prepend</td>
666+
<td>Optional</td>
667+
<td>Strings prepended to the text input before sending the embedding request. Useful for
668+
OpenAI-compatible instruction-tuned models that expect a task-specific prefix.
669+
<ul>
670+
<li>Element &lt;query&gt; - Optional query prepend instruction.</li>
671+
<li>Element &lt;document&gt; - Optional document prepend instruction.</li>
672+
</ul>
673+
<pre>{% highlight xml %}
674+
<prepend>
675+
<query>query: </query>
676+
<document>passage: </document>
677+
</prepend>{% endhighlight %}</pre>
678+
</td>
679+
<td>Optional &lt;query&gt; &lt;document&gt; elements.</td>
680+
<td></td>
681+
</tr>
664682
</tbody>
665683
</table>
666684

0 commit comments

Comments
 (0)