Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
tharun571 committed Jul 29, 2024
1 parent a51c414 commit 6514175
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 6 additions & 0 deletions docs/source/magics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ Leverage the large language models to assist in your development process. Curren
%%xassist model
prompt
- Reset model and clear chat history

.. code::
%%xassist model --refresh
- Example

.. image:: gemini.png
Expand Down
7 changes: 4 additions & 3 deletions src/xmagics/xassist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,11 @@ namespace xcpp

if(model == "gemini")
{
out << "{ \"role\": \"" << user << "\", \"parts\": [ { \"text\": " << serializedCell << "}]}\n";
out << "{ \"role\": \"" << user << R"(", "parts": [ { "text": )" << serializedCell << "}]}\n";
}
else
{
out << "{ \"role\": \"" << user << "\", \"content\": " << serializedCell << "}\n";
out << "{ \"role\": \"" << user << R"(", "content": )" << serializedCell << "}\n";
}

out.close();
Expand Down Expand Up @@ -275,7 +275,8 @@ namespace xcpp
xcpp::APIKeyManager::saveApiKey(model, cell);
return;
}
else if (tokens[2] == "--refresh")

if (tokens[2] == "--refresh")
{
xcpp::ChatHistory::refresh(model);
return;
Expand Down

0 comments on commit 6514175

Please sign in to comment.