Skip to content

Commit

Permalink
Merge tag 'v3.0.0' into develop
Browse files Browse the repository at this point in the history
new major release
  • Loading branch information
bsorrentino committed Aug 4, 2024
2 parents 0858b51 + 5ec09d3 commit 480b8fb
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,18 @@ In the [LangChainDemo](LangChainDemo) project, you can find the porting of [Agen
```Swift

struct AgentExecutorState : AgentState {

// describes the properties that have particular Reducer related function
// AppenderChannel<T> is a built-in channel that manage array of values
static var schema: Channels = {
[
"intermediate_steps": AppenderChannel<(AgentAction, String)>(),
"chat_history": AppenderChannel<BaseMessage>(),
]
}()

var data: [String : Any]

init() {
self.init([
"intermediate_steps": AppendableValue(),
"chat_history": AppendableValue()
])
}

init(_ initState: [String : Any]) {
data = initState
}
Expand All @@ -80,19 +83,19 @@ In the [LangChainDemo](LangChainDemo) project, you can find the porting of [Agen
value("input")
}
var chatHistory:[BaseMessage]? {
appendableValue("chat_history" )
value("chat_history" )
}
var agentOutcome:AgentOutcome? {
return value("agent_outcome")
value("agent_outcome")
}
var intermediate_steps: [(AgentAction, String)]? {
appendableValue("intermediate_steps" )
value("intermediate_steps" )
}
}


let workflow = StateGraph {
AgentExecutorState()
AgentExecutorState($0) // $0 is the initial state provided by the graph
}

try workflow.addNode("call_agent" ) { state in
Expand Down

0 comments on commit 480b8fb

Please sign in to comment.