You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Often, you are going to want to determine agent message style and agent message strategy separately.
For instance, you may want to simulate an email exchange, a text exchange or a Slack or Discord conversation between agents and want the agent conversation to reflect the way humans normally write in these contexts. This could reflect where the agents will be deployed or for another reason, such as to make the text more readable for a human reviewer.
One possible solution for this would be to add a style module:
import json
from langchain.schema import SystemMessage, HumanMessage
from agent_sim.util import extract_json
from agent_sim.prompts_library import (
STYLIST_USER_PROMPT,
STYLIST_SYSTEM_PROMPT,
)
class Stylist:
def __init__(self, model, style):
self.model = model
self.style = style
def stylize(self, current_message):
llm_messages = [
SystemMessage(content=STYLIST_SYSTEM_PROMPT.format(style=self.style)),
HumanMessage(content=STYLIST_USER_PROMPT.format(message=current_message))
]
stylized_message = self.model.predict_messages(llm_messages).content
return stylized_message
The text was updated successfully, but these errors were encountered:
chutcheson
changed the title
Make Agent Writing Style Modular
Modular Writing Style
Jun 30, 2023
Often, you are going to want to determine agent message style and agent message strategy separately.
For instance, you may want to simulate an email exchange, a text exchange or a Slack or Discord conversation between agents and want the agent conversation to reflect the way humans normally write in these contexts. This could reflect where the agents will be deployed or for another reason, such as to make the text more readable for a human reviewer.
One possible solution for this would be to add a style module:
The text was updated successfully, but these errors were encountered: