Files
OpenHands/openhands/security/invariant/nodes.py
Robert Brennan 01ae22ef57 Rename OpenDevin to OpenHands (#3472)
* Replace OpenDevin with OpenHands

* Update CONTRIBUTING.md

* Update README.md

* Update README.md

* update poetry lock; move opendevin folder to openhands

* fix env var

* revert image references in docs

* revert permissions

* revert permissions

---------

Co-authored-by: Xingyao Wang <xingyao6@illinois.edu>
2024-08-20 00:44:54 +08:00

46 lines
837 B
Python

from pydantic import BaseModel, Field
from pydantic.dataclasses import dataclass
@dataclass
class LLM:
vendor: str
model: str
class Event(BaseModel):
metadata: dict | None = Field(
default_factory=dict, description='Metadata associated with the event'
)
class Function(BaseModel):
name: str
arguments: dict
class ToolCall(Event):
id: str
type: str
function: Function
class Message(Event):
role: str
content: str | None
tool_calls: list[ToolCall] | None = None
def __rich_repr__(self):
# Print on separate line
yield 'role', self.role
yield 'content', self.content
yield 'tool_calls', self.tool_calls
class ToolOutput(Event):
role: str
content: str
tool_call_id: str | None = None
_tool_call: ToolCall | None = None