-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed issues, renamed mixtral to mistral. Introduced new messages for…
…matter. etc.
- Loading branch information
1 parent
b8eacd0
commit 54836e2
Showing
37 changed files
with
659 additions
and
643 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
title: Chat History Reference | ||
--- | ||
|
||
## Basic Chat History and Message store | ||
|
||
::: llama_cpp_agent.chat_history.basic_chat_history | ||
|
||
## Chat History and Message store | ||
|
||
::: llama_cpp_agent.chat_history.chat_history_base |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from llama_cpp_agent import LlamaCppAgent | ||
from llama_cpp_agent import MessagesFormatterType | ||
from llama_cpp_agent.providers import LlamaCppServerProvider | ||
|
||
provider = LlamaCppServerProvider("http://127.0.0.1:8080") | ||
|
||
agent = LlamaCppAgent( | ||
provider, | ||
system_prompt="You are a helpful assistant.", | ||
predefined_messages_formatter_type=MessagesFormatterType.CHATML, | ||
) | ||
|
||
settings = provider.get_provider_default_settings() | ||
settings.n_predict = 512 | ||
settings.temperature = 0.65 | ||
agent.chat_history.get_message_store().load_from_json("test.json") | ||
while True: | ||
user_input = input(">") | ||
if user_input == "exit": | ||
break | ||
agent_output = agent.get_chat_response(user_input, llm_sampling_settings=settings) | ||
agent.chat_history.get_message_store().save_to_json("test.json") | ||
print(f"Agent: {agent_output.strip()}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
[ | ||
{ | ||
"role": "system", | ||
"content": "You are a helpful assistant." | ||
}, | ||
{ | ||
"role": "user", | ||
"content": "Hi!" | ||
}, | ||
{ | ||
"role": "assistant", | ||
"content": "Hello! How can I help you today?" | ||
}, | ||
{ | ||
"role": "user", | ||
"content": "Tell me about the Iran Contra Affair" | ||
}, | ||
{ | ||
"role": "assistant", | ||
"content": "The Iran-Contra Affair, also known as the Iran-Contra Scandal or the Iran-Contra Crisis, refers to a political scandal in the United States that came to light in November 1986. It involved the sale of arms to Iran, which was under an arms embargo at the time, and the diversion of proceeds from those sales to fund the Contras in Nicaragua, contrary to Congressional restrictions.\n\nThe scandal began when it was revealed that President Ronald Reagan had authorized the sale of weapons to Iran in exchange for the release of American hostages held by Hezbollah militants in Lebanon. The proceeds from these sales were then secretly used to fund the Contras, who were fighting against the Marxist Sandinista government in Nicaragua. This was a violation of both the Arms Export Control Act and the Boland Amendment, which prohibited U.S. funding for the Contras.\n\nThe scandal came to light when Lebanese journalist Al Faqih published an article in the Beirut daily Al-Shiraa detailing the arms sales on November 3, 1986. The story was then picked up by the American media, leading to a public outcry and investigations by Congress and the press.\n\nThe Iran-Contra Affair led to numerous resignations, including that of National Security Advisor Robert McFarlane and Secretary of Defense Caspar Weinberger. Several high-ranking officials were indicted and tried for their roles in the scandal, including former CIA Director John Poindexter and Lieutenant Colonel Oliver North.\n\nThe affair damaged the Reagan Administration's reputation and led to increased scrutiny of executive power and the role of Congress in foreign policy. It also highlighted the complexities of U.S. foreign policy and the challenges of balancing national security interests with democratic values.\n" | ||
}, | ||
{ | ||
"role": "user", | ||
"content": "What was my last question?" | ||
}, | ||
{ | ||
"role": "assistant", | ||
"content": "Your last question was about the Iran-Contra Affair." | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.