Skip to content

Commit

Permalink
build based on bfdcbfb
Browse files Browse the repository at this point in the history
  • Loading branch information
Documenter.jl committed Mar 1, 2024
1 parent 5547fc4 commit 191407d
Show file tree
Hide file tree
Showing 16 changed files with 89 additions and 89 deletions.
2 changes: 1 addition & 1 deletion dev/.documenter-siteinfo.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"documenter":{"julia_version":"1.10.1","generation_timestamp":"2024-03-01T19:41:26","documenter_version":"1.2.1"}}
{"documenter":{"julia_version":"1.10.1","generation_timestamp":"2024-03-01T19:44:38","documenter_version":"1.2.1"}}
2 changes: 1 addition & 1 deletion dev/examples/building_RAG/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dev/examples/readme_examples/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,4 @@
msg = aigenerate(PT.MistralOpenAISchema(), &quot;Say Hi!&quot;; model=&quot;mistral-tiny&quot;, api_key=ENV[&quot;MISTRALAI_API_KEY&quot;])</code></pre><p>As you can see, we can load your API key either from the ENV or via the Preferences.jl mechanism (see <code>?PREFERENCES</code> for more information).</p><p>But MistralAI are not the only ones! There are many other exciting providers, eg, <a href="https://docs.perplexity.ai/">Perplexity.ai</a>, <a href="https://app.fireworks.ai/">Fireworks.ai</a>. As long as they are compatible with the OpenAI API (eg, sending <code>messages</code> with <code>role</code> and <code>content</code> keys), you can use them with PromptingTools.jl by using <code>schema = CustomOpenAISchema()</code>:</p><pre><code class="language-julia hljs"># Set your API key and the necessary base URL for the API
api_key = &quot;...&quot;
prompt = &quot;Say hi!&quot;
msg = aigenerate(PT.CustomOpenAISchema(), prompt; model=&quot;my_model&quot;, api_key, api_kwargs=(; url=&quot;http://localhost:8081&quot;))</code></pre><p>As you can see, it also works for any local models that you might have running on your computer!</p><p>Note: At the moment, we only support <code>aigenerate</code> and <code>aiembed</code> functions for MistralAI and other OpenAI-compatible APIs. We plan to extend the support in the future.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../../how_it_works/">« How It Works</a><a class="docs-footer-nextpage" href="../working_with_aitemplates/">Using AITemplates »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.2.1 on <span class="colophon-date" title="Friday 1 March 2024 19:41">Friday 1 March 2024</span>. Using Julia version 1.10.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
msg = aigenerate(PT.CustomOpenAISchema(), prompt; model=&quot;my_model&quot;, api_key, api_kwargs=(; url=&quot;http://localhost:8081&quot;))</code></pre><p>As you can see, it also works for any local models that you might have running on your computer!</p><p>Note: At the moment, we only support <code>aigenerate</code> and <code>aiembed</code> functions for MistralAI and other OpenAI-compatible APIs. We plan to extend the support in the future.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../../how_it_works/">« How It Works</a><a class="docs-footer-nextpage" href="../working_with_aitemplates/">Using AITemplates »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.2.1 on <span class="colophon-date" title="Friday 1 March 2024 19:44">Friday 1 March 2024</span>. Using Julia version 1.10.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
2 changes: 1 addition & 1 deletion dev/examples/working_with_aitemplates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@
PT.save_template(filename,
tpl;
description = &quot;For asking data analysis questions in Julia language. Placeholders: `ask`&quot;)
rm(filename) # cleanup if we don&#39;t like it</code></pre><p>When you create a new template, remember to re-load the templates with <code>load_templates!()</code> so that it&#39;s available for use.</p><pre><code class="language-julia hljs">PT.load_templates!();</code></pre><p>!!! If you have some good templates (or suggestions for the existing ones), please consider sharing them with the community by opening a PR to the <code>templates</code> directory!</p><hr/><p><em>This page was generated using <a href="https://github.com/fredrikekre/Literate.jl">Literate.jl</a>.</em></p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../readme_examples/">« Various examples</a><a class="docs-footer-nextpage" href="../working_with_ollama/">Local models with Ollama.ai »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.2.1 on <span class="colophon-date" title="Friday 1 March 2024 19:41">Friday 1 March 2024</span>. Using Julia version 1.10.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
rm(filename) # cleanup if we don&#39;t like it</code></pre><p>When you create a new template, remember to re-load the templates with <code>load_templates!()</code> so that it&#39;s available for use.</p><pre><code class="language-julia hljs">PT.load_templates!();</code></pre><p>!!! If you have some good templates (or suggestions for the existing ones), please consider sharing them with the community by opening a PR to the <code>templates</code> directory!</p><hr/><p><em>This page was generated using <a href="https://github.com/fredrikekre/Literate.jl">Literate.jl</a>.</em></p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../readme_examples/">« Various examples</a><a class="docs-footer-nextpage" href="../working_with_ollama/">Local models with Ollama.ai »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.2.1 on <span class="colophon-date" title="Friday 1 March 2024 19:44">Friday 1 March 2024</span>. Using Julia version 1.10.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
2 changes: 1 addition & 1 deletion dev/examples/working_with_custom_apis/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@
prompt = &quot;I just ate a delicious and juicy apple.&quot;
msg = aiextract(prompt; return_type=Food, model=&quot;firefunction&quot;)
msg.content
# Output: Food(&quot;apple&quot;, [&quot;delicious&quot;, &quot;juicy&quot;])</code></pre><p>For embedding a text, use <code>aiembed</code>:</p><pre><code class="language-julia hljs">aiembed(PT.FireworksOpenAISchema(), &quot;embed me&quot;; model=&quot;nomic-ai/nomic-embed-text-v1.5&quot;)</code></pre><p>Note: You can register the model with <code>PT.register_model!</code> and use it as usual.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../working_with_google_ai_studio/">« Google AIStudio</a><a class="docs-footer-nextpage" href="../building_RAG/">Building RAG Application »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.2.1 on <span class="colophon-date" title="Friday 1 March 2024 19:41">Friday 1 March 2024</span>. Using Julia version 1.10.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
# Output: Food(&quot;apple&quot;, [&quot;delicious&quot;, &quot;juicy&quot;])</code></pre><p>For embedding a text, use <code>aiembed</code>:</p><pre><code class="language-julia hljs">aiembed(PT.FireworksOpenAISchema(), &quot;embed me&quot;; model=&quot;nomic-ai/nomic-embed-text-v1.5&quot;)</code></pre><p>Note: You can register the model with <code>PT.register_model!</code> and use it as usual.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../working_with_google_ai_studio/">« Google AIStudio</a><a class="docs-footer-nextpage" href="../building_RAG/">Building RAG Application »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.2.1 on <span class="colophon-date" title="Friday 1 March 2024 19:44">Friday 1 March 2024</span>. Using Julia version 1.10.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
2 changes: 1 addition & 1 deletion dev/examples/working_with_google_ai_studio/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@

The Force flows through all living things, not machines. Seek balance in the Force, and your heart will find true connection.

Remember, the path of the Jedi is to serve others, not to be attached to possessions.&quot;)</code></pre><h3 id="Gotchas"><a class="docs-heading-anchor" href="#Gotchas">Gotchas</a><a id="Gotchas-1"></a><a class="docs-heading-anchor-permalink" href="#Gotchas" title="Permalink"></a></h3><ul><li>Gemini models actually do NOT have a system prompt (for instructions), so we simply concatenate the system and user messages together for consistency with other APIs.</li><li>The reported <code>tokens</code> in the <code>AIMessage</code> are actually <em>characters</em> (that&#39;s how Google AI Studio intends to charge for them) and are a conservative estimate that we produce. It does not matter, because at the time of writing (Feb-24), the usage is free-of-charge.</li></ul></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../working_with_ollama/">« Local models with Ollama.ai</a><a class="docs-footer-nextpage" href="../working_with_custom_apis/">Custom APIs (Mistral, Llama.cpp) »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.2.1 on <span class="colophon-date" title="Friday 1 March 2024 19:41">Friday 1 March 2024</span>. Using Julia version 1.10.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
Remember, the path of the Jedi is to serve others, not to be attached to possessions.&quot;)</code></pre><h3 id="Gotchas"><a class="docs-heading-anchor" href="#Gotchas">Gotchas</a><a id="Gotchas-1"></a><a class="docs-heading-anchor-permalink" href="#Gotchas" title="Permalink"></a></h3><ul><li>Gemini models actually do NOT have a system prompt (for instructions), so we simply concatenate the system and user messages together for consistency with other APIs.</li><li>The reported <code>tokens</code> in the <code>AIMessage</code> are actually <em>characters</em> (that&#39;s how Google AI Studio intends to charge for them) and are a conservative estimate that we produce. It does not matter, because at the time of writing (Feb-24), the usage is free-of-charge.</li></ul></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../working_with_ollama/">« Local models with Ollama.ai</a><a class="docs-footer-nextpage" href="../working_with_custom_apis/">Custom APIs (Mistral, Llama.cpp) »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.2.1 on <span class="colophon-date" title="Friday 1 March 2024 19:44">Friday 1 March 2024</span>. Using Julia version 1.10.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
2 changes: 1 addition & 1 deletion dev/examples/working_with_ollama/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@
LinearAlgebra.normalize;
model = &quot;openhermes2.5-mistral&quot;)</code></pre><pre><code class="nohighlight hljs">PromptingTools.DataMessage(Matrix{Float64} of size (4096, 2))</code></pre><p>Cosine similarity is then a simple multiplication</p><pre><code class="language-julia hljs">msg.content&#39; * msg.content[:, 1]</code></pre><pre><code class="nohighlight hljs">2-element Vector{Float64}:
0.9999999999999982
0.40796033843072876</code></pre><hr/><p><em>This page was generated using <a href="https://github.com/fredrikekre/Literate.jl">Literate.jl</a>.</em></p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../working_with_aitemplates/">« Using AITemplates</a><a class="docs-footer-nextpage" href="../working_with_google_ai_studio/">Google AIStudio »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.2.1 on <span class="colophon-date" title="Friday 1 March 2024 19:41">Friday 1 March 2024</span>. Using Julia version 1.10.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
0.40796033843072876</code></pre><hr/><p><em>This page was generated using <a href="https://github.com/fredrikekre/Literate.jl">Literate.jl</a>.</em></p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../working_with_aitemplates/">« Using AITemplates</a><a class="docs-footer-nextpage" href="../working_with_google_ai_studio/">Google AIStudio »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.2.1 on <span class="colophon-date" title="Friday 1 March 2024 19:44">Friday 1 March 2024</span>. Using Julia version 1.10.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
Loading

0 comments on commit 191407d

Please sign in to comment.