Skip to content

Commit

Permalink
swap system role for o1 models
Browse files Browse the repository at this point in the history
  • Loading branch information
SmartManoj committed Sep 16, 2024
1 parent 2e3e46d commit 71571f3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion agenthub/codeact_agent/codeact_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from agenthub.codeact_agent.action_parser import CodeActResponseParser
from openhands.controller.agent import Agent
from openhands.controller.state.state import State
from openhands.core import config2
from openhands.core.config import AgentConfig, load_app_config
from openhands.core.logger import openhands_logger as logger
from openhands.core.message import ImageContent, Message, TextContent
Expand Down Expand Up @@ -250,9 +251,10 @@ def step(self, state: State) -> Action:
return self.action_parser.parse(response)

def _get_messages(self, state: State) -> list[Message]:
system_role = 'user' if 'o1-' in config2.model else 'system'
messages: list[Message] = [
Message(
role='system',
role=system_role,
content=[
TextContent(
text=self.prompt_manager.system_message,
Expand Down

0 comments on commit 71571f3

Please sign in to comment.