mirror of
https://github.com/run-llama/create-llama.git
synced 2026-07-18 21:14:37 -04:00
6edea6af5c
* enhance workflow shared code * fix streaming * refactor code * add missing helper * update * update form filling * add filters * simplify the code * simplify the code * simplify the code * update form filling * update e2e * update function calling agent * fix unneeded condition * Create light-parrots-work.md * revert change on using functioncallingagent * update readme * clean code * extract call one tool function * update for blog use case * fix streaming * fix e2e * fix missing await * improve tools code * improve assertion code * skip form filling test for TS framework * update for tools helper --------- Co-authored-by: Marcus Schiesser <mail@marcusschiesser.de>
28 lines
601 B
Python
28 lines
601 B
Python
from enum import Enum
|
|
from typing import Optional
|
|
|
|
from llama_index.core.workflow import Event
|
|
|
|
|
|
class AgentRunEventType(Enum):
|
|
TEXT = "text"
|
|
PROGRESS = "progress"
|
|
|
|
|
|
class AgentRunEvent(Event):
|
|
name: str
|
|
msg: str
|
|
event_type: AgentRunEventType = AgentRunEventType.TEXT
|
|
data: Optional[dict] = None
|
|
|
|
def to_response(self) -> dict:
|
|
return {
|
|
"type": "agent",
|
|
"data": {
|
|
"agent": self.name,
|
|
"type": self.event_type.value,
|
|
"text": self.msg,
|
|
"data": self.data,
|
|
},
|
|
}
|