mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-05-19 16:31:30 +00:00
extensions update
This commit is contained in:
parent
60b4258532
commit
370b190c0e
3 changed files with 5 additions and 2 deletions
3
agent.py
3
agent.py
|
|
@ -282,6 +282,9 @@ class Agent:
|
|||
self.context.streaming_agent = self # mark self as current streamer
|
||||
self.loop_data.iteration += 1
|
||||
|
||||
# call message_loop_start extensions
|
||||
await self.call_extensions("message_loop_start", loop_data=self.loop_data)
|
||||
|
||||
try:
|
||||
# prepare LLM chain (model, system, history)
|
||||
prompt = await self.prepare_prompt(loop_data=self.loop_data)
|
||||
|
|
|
|||
|
|
@ -343,7 +343,7 @@ def get_openrouter_chat(
|
|||
base_url=base_url,
|
||||
stream_usage=True,
|
||||
model_kwargs={
|
||||
"headers": {
|
||||
"extra_headers": {
|
||||
"HTTP-Referer": "https://agent-zero.ai",
|
||||
"X-Title": "Agent Zero",
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ class RenameChat(Extension):
|
|||
try:
|
||||
# prepare history
|
||||
history_text = self.agent.history.output_text()
|
||||
ctx_length = int(self.agent.config.utility_model.ctx_length * 0.7)
|
||||
ctx_length = int(self.agent.config.utility_model.ctx_length * 0.3)
|
||||
history_text = tokens.trim_to_tokens(history_text, ctx_length, "start")
|
||||
# prepare system and user prompt
|
||||
system = self.agent.read_prompt("fw.rename_chat.sys.md")
|
||||
Loading…
Add table
Add a link
Reference in a new issue