Skip to content

Commit

Permalink
deploy: 0334b8b
Browse files Browse the repository at this point in the history
  • Loading branch information
pan-x-c committed Nov 5, 2024
1 parent b247276 commit e37588e
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 6 deletions.
Binary file modified en/.doctrees/environment.pickle
Binary file not shown.
Binary file modified en/.doctrees/index.doctree
Binary file not shown.
7 changes: 4 additions & 3 deletions en/_modules/agentscope/models/dashscope_model.html
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,6 @@ <h1>Source code for agentscope.models.dashscope_model</h1><div class="highlight"
<span class="bp">self</span><span class="o">.</span><span class="n">generate_args</span> <span class="o">=</span> <span class="n">generate_args</span> <span class="ow">or</span> <span class="p">{}</span>

<span class="bp">self</span><span class="o">.</span><span class="n">api_key</span> <span class="o">=</span> <span class="n">api_key</span>
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">api_key</span><span class="p">:</span>
<span class="n">dashscope</span><span class="o">.</span><span class="n">api_key</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">api_key</span>
<span class="bp">self</span><span class="o">.</span><span class="n">max_length</span> <span class="o">=</span> <span class="kc">None</span></div>


Expand Down Expand Up @@ -380,7 +378,7 @@ <h1>Source code for agentscope.models.dashscope_model</h1><div class="highlight"
<span class="k">if</span> <span class="n">stream</span><span class="p">:</span>
<span class="n">kwargs</span><span class="p">[</span><span class="s2">&quot;incremental_output&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="kc">True</span>

<span class="n">response</span> <span class="o">=</span> <span class="n">dashscope</span><span class="o">.</span><span class="n">Generation</span><span class="o">.</span><span class="n">call</span><span class="p">(</span><span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
<span class="n">response</span> <span class="o">=</span> <span class="n">dashscope</span><span class="o">.</span><span class="n">Generation</span><span class="o">.</span><span class="n">call</span><span class="p">(</span><span class="n">api_key</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">api_key</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>

<span class="c1"># step3: invoke llm api, record the invocation and update the monitor</span>
<span class="k">if</span> <span class="n">stream</span><span class="p">:</span>
Expand Down Expand Up @@ -631,6 +629,7 @@ <h1>Source code for agentscope.models.dashscope_model</h1><div class="highlight"
<span class="n">response</span> <span class="o">=</span> <span class="n">dashscope</span><span class="o">.</span><span class="n">ImageSynthesis</span><span class="o">.</span><span class="n">call</span><span class="p">(</span>
<span class="n">model</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">model_name</span><span class="p">,</span>
<span class="n">prompt</span><span class="o">=</span><span class="n">prompt</span><span class="p">,</span>
<span class="n">api_key</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">api_key</span><span class="p">,</span>
<span class="o">**</span><span class="n">kwargs</span><span class="p">,</span>
<span class="p">)</span>
<span class="k">if</span> <span class="n">response</span><span class="o">.</span><span class="n">status_code</span> <span class="o">!=</span> <span class="n">HTTPStatus</span><span class="o">.</span><span class="n">OK</span><span class="p">:</span>
Expand Down Expand Up @@ -747,6 +746,7 @@ <h1>Source code for agentscope.models.dashscope_model</h1><div class="highlight"
<span class="n">response</span> <span class="o">=</span> <span class="n">dashscope</span><span class="o">.</span><span class="n">TextEmbedding</span><span class="o">.</span><span class="n">call</span><span class="p">(</span>
<span class="nb">input</span><span class="o">=</span><span class="n">texts</span><span class="p">,</span>
<span class="n">model</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">model_name</span><span class="p">,</span>
<span class="n">api_key</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">api_key</span><span class="p">,</span>
<span class="o">**</span><span class="n">kwargs</span><span class="p">,</span>
<span class="p">)</span>

Expand Down Expand Up @@ -882,6 +882,7 @@ <h1>Source code for agentscope.models.dashscope_model</h1><div class="highlight"
<span class="n">response</span> <span class="o">=</span> <span class="n">dashscope</span><span class="o">.</span><span class="n">MultiModalConversation</span><span class="o">.</span><span class="n">call</span><span class="p">(</span>
<span class="n">model</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">model_name</span><span class="p">,</span>
<span class="n">messages</span><span class="o">=</span><span class="n">messages</span><span class="p">,</span>
<span class="n">api_key</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">api_key</span><span class="p">,</span>
<span class="o">**</span><span class="n">kwargs</span><span class="p">,</span>
<span class="p">)</span>
<span class="c1"># Unhandled code path here</span>
Expand Down
Binary file modified zh_CN/.doctrees/environment.pickle
Binary file not shown.
Binary file modified zh_CN/.doctrees/index.doctree
Binary file not shown.
7 changes: 4 additions & 3 deletions zh_CN/_modules/agentscope/models/dashscope_model.html
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,6 @@ <h1>agentscope.models.dashscope_model 源代码</h1><div class="highlight"><pre>
<span class="bp">self</span><span class="o">.</span><span class="n">generate_args</span> <span class="o">=</span> <span class="n">generate_args</span> <span class="ow">or</span> <span class="p">{}</span>

<span class="bp">self</span><span class="o">.</span><span class="n">api_key</span> <span class="o">=</span> <span class="n">api_key</span>
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">api_key</span><span class="p">:</span>
<span class="n">dashscope</span><span class="o">.</span><span class="n">api_key</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">api_key</span>
<span class="bp">self</span><span class="o">.</span><span class="n">max_length</span> <span class="o">=</span> <span class="kc">None</span></div>


Expand Down Expand Up @@ -384,7 +382,7 @@ <h1>agentscope.models.dashscope_model 源代码</h1><div class="highlight"><pre>
<span class="k">if</span> <span class="n">stream</span><span class="p">:</span>
<span class="n">kwargs</span><span class="p">[</span><span class="s2">&quot;incremental_output&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="kc">True</span>

<span class="n">response</span> <span class="o">=</span> <span class="n">dashscope</span><span class="o">.</span><span class="n">Generation</span><span class="o">.</span><span class="n">call</span><span class="p">(</span><span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
<span class="n">response</span> <span class="o">=</span> <span class="n">dashscope</span><span class="o">.</span><span class="n">Generation</span><span class="o">.</span><span class="n">call</span><span class="p">(</span><span class="n">api_key</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">api_key</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>

<span class="c1"># step3: invoke llm api, record the invocation and update the monitor</span>
<span class="k">if</span> <span class="n">stream</span><span class="p">:</span>
Expand Down Expand Up @@ -635,6 +633,7 @@ <h1>agentscope.models.dashscope_model 源代码</h1><div class="highlight"><pre>
<span class="n">response</span> <span class="o">=</span> <span class="n">dashscope</span><span class="o">.</span><span class="n">ImageSynthesis</span><span class="o">.</span><span class="n">call</span><span class="p">(</span>
<span class="n">model</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">model_name</span><span class="p">,</span>
<span class="n">prompt</span><span class="o">=</span><span class="n">prompt</span><span class="p">,</span>
<span class="n">api_key</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">api_key</span><span class="p">,</span>
<span class="o">**</span><span class="n">kwargs</span><span class="p">,</span>
<span class="p">)</span>
<span class="k">if</span> <span class="n">response</span><span class="o">.</span><span class="n">status_code</span> <span class="o">!=</span> <span class="n">HTTPStatus</span><span class="o">.</span><span class="n">OK</span><span class="p">:</span>
Expand Down Expand Up @@ -751,6 +750,7 @@ <h1>agentscope.models.dashscope_model 源代码</h1><div class="highlight"><pre>
<span class="n">response</span> <span class="o">=</span> <span class="n">dashscope</span><span class="o">.</span><span class="n">TextEmbedding</span><span class="o">.</span><span class="n">call</span><span class="p">(</span>
<span class="nb">input</span><span class="o">=</span><span class="n">texts</span><span class="p">,</span>
<span class="n">model</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">model_name</span><span class="p">,</span>
<span class="n">api_key</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">api_key</span><span class="p">,</span>
<span class="o">**</span><span class="n">kwargs</span><span class="p">,</span>
<span class="p">)</span>

Expand Down Expand Up @@ -886,6 +886,7 @@ <h1>agentscope.models.dashscope_model 源代码</h1><div class="highlight"><pre>
<span class="n">response</span> <span class="o">=</span> <span class="n">dashscope</span><span class="o">.</span><span class="n">MultiModalConversation</span><span class="o">.</span><span class="n">call</span><span class="p">(</span>
<span class="n">model</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">model_name</span><span class="p">,</span>
<span class="n">messages</span><span class="o">=</span><span class="n">messages</span><span class="p">,</span>
<span class="n">api_key</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">api_key</span><span class="p">,</span>
<span class="o">**</span><span class="n">kwargs</span><span class="p">,</span>
<span class="p">)</span>
<span class="c1"># Unhandled code path here</span>
Expand Down

0 comments on commit e37588e

Please sign in to comment.