Skip to content

Commit

Permalink
docs: update documentation for new release
Browse files Browse the repository at this point in the history
  • Loading branch information
bsorrentino committed Jan 22, 2025
1 parent aa44595 commit 6022e83
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ LangGraph for Java. A library for building stateful, multi-agents applications w
| Date | Release | info
|--------------|----------------| ---
| Jan 13, 2025 | `1.2.3` | official release
| Jan 22, 2025 | `1.2.4` | official release


## Samples
Expand Down Expand Up @@ -73,7 +73,7 @@ LangGraph for Java. A library for building stateful, multi-agents applications w
<dependency>
<groupId>org.bsc.langgraph4j</groupId>
<artifactId>langgraph4j-core</artifactId>
<version>1.2.3</version>
<version>1.2.4</version>
</dependency>
```

Expand Down
15 changes: 6 additions & 9 deletions core/src/site/markdown/concepts/low_level.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ If no [`Channel`] is specified for an item then it is assumed that all updates t
```java
static class MessagesState extends AgentState {

static Map<String, Channel<?>> SCHEMA = mapOf(
static Map<String, Channel<?>> SCHEMA = Map.of(
"messages", AppenderChannel.<String>of(ArrayList::new)
);
}
Expand All @@ -80,7 +80,7 @@ You can also specify a custom reducer for a particular state property
```java
static class MyState extends AgentState {

static Map<String, Channel<?>> SCHEMA = mapOf(
static Map<String, Channel<?>> SCHEMA = Map.of(
"property", Channel.<String>of( ( oldValue, newValue ) -> newValue.toUpperCase() )
);
}
Expand Down Expand Up @@ -134,7 +134,6 @@ In LangGraph4j, nodes are typically a **Functional Interface** ([`AsyncNodeActio
```java
import static org.bsc.langgraph4j.action.AsyncEdgeAction.edge_async;
import static org.bsc.langgraph4j.action.AsyncNodeAction.node_async;
import static org.bsc.langgraph4j.utils.CollectionsUtils.mapOf;

public class State extends AgentState {

Expand All @@ -149,7 +148,7 @@ public class State extends AgentState {

AsyncNodeAction<State> myNode = node_async(state -> {
System.out.println( "In myNode: " );
return mapOf( results: "Hello " + state.input().orElse( "" ) );
return Map.of( results: "Hello " + state.input().orElse( "" ) );
});

AsyncNodeAction<State> myOtherNode = node_async(state -> state);
Expand Down Expand Up @@ -215,9 +214,7 @@ graph.addEdge("nodeA", "nodeB");
If you want to **optionally** route to 1 or more edges (or optionally terminate), you can use the [`addConditionalEdges`] method. This method accepts the name of a node and a **Functional Interface** ([`AsyncEdgeAction`]) that will be used as " routing function" to call after that node is executed:

```java
import static org.bsc.langgraph4j.utils.CollectionsUtils.mapOf;

graph.addConditionalEdges("nodeA", routingFunction, mapOf( "first": "nodeB", "second": "nodeC" ) );
graph.addConditionalEdges("nodeA", routingFunction, Map.of( "first": "nodeB", "second": "nodeC" ) );
```

Similar to nodes, the `routingFunction` accept the current `state` of the graph and return a string value.
Expand Down Expand Up @@ -245,7 +242,7 @@ A conditional entry point lets you start at different nodes depending on custom
import static org.bsc.langgraph4j.StateGraph.START;
import static org.bsc.langgraph4j.utils.CollectionsUtils.mapOf;
graph.addConditionalEdges(START, routingFunction, mapOf( "first": "nodeB", "second": "nodeC" ) );
graph.addConditionalEdges(START, routingFunction, Map.of( "first": "nodeB", "second": "nodeC" ) );
```
You must provide an object that maps the `routingFunction`'s output to the name of the next node.
Expand Down Expand Up @@ -285,7 +282,7 @@ You must pass these when invoking the graph as part of the configurable part of
```java
RunnableConfig config = RunnableConfig.builder()
var config = RunnableConfig.builder()
.threadId("a")
.build();
graph.invoke(inputs, config);
Expand Down
2 changes: 1 addition & 1 deletion src/site/markdown/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ LangGraph for Java. A library for building stateful, multi-agents applications w
| Date | Release | info
|--------------|----------------| ---
| Jan 13, 2025 | `1.2.3` | official release
| Jan 22, 2025 | `1.2.4` | official release


## Quick Start
Expand Down

0 comments on commit 6022e83

Please sign in to comment.