Skip to content

Commit

Permalink
Merge branch 'release/1.0-20240915'
Browse files Browse the repository at this point in the history
  • Loading branch information
bsorrentino committed Sep 15, 2024
2 parents 9b5e6ee + 683a8ab commit bd4077f
Show file tree
Hide file tree
Showing 36 changed files with 185 additions and 163 deletions.
2 changes: 1 addition & 1 deletion adaptive-rag/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.bsc.langgraph4j</groupId>
<artifactId>langgraph4j-parent</artifactId>
<version>1.0-20240907</version>
<version>1.0-20240915</version>
</parent>

<artifactId>langgraph4j-adaptive-rag</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion agent-executor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.bsc.langgraph4j</groupId>
<artifactId>langgraph4j-parent</artifactId>
<version>1.0-20240907</version>
<version>1.0-20240915</version>
</parent>

<artifactId>langgraph4j-agent-executor</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion core-jdk8/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.bsc.langgraph4j</groupId>
<artifactId>langgraph4j-parent</artifactId>
<version>1.0-20240907</version>
<version>1.0-20240915</version>
</parent>

<artifactId>langgraph4j-core-jdk8</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ protected void appendHeader(StringBuilder sb, String title) {
sb
.append( format("---\ntitle: %s\n---\n", title))
.append( "flowchart TD\n")
.append( "\tstart((start))\n")
.append( "\t__START__((start))\n")
.append( "\t__END__((stop))\n")
;
}
Expand Down Expand Up @@ -48,17 +48,17 @@ protected StringBuilder commentLine(StringBuilder sb, boolean yesOrNo) {

@Override
protected void start(StringBuilder sb, String entryPoint) {
call( sb, "start", entryPoint );
call( sb, "__START__", entryPoint );
}

@Override
protected void finish(StringBuilder sb, String finishPoint) {
call( sb, finishPoint, "stop" );
call( sb, finishPoint, "__END__" );
}

@Override
protected void finish(StringBuilder sb, String finishPoint, String description) {
call( sb, finishPoint, "stop", description );
call( sb, finishPoint, "__END__", description );
}

@Override
Expand Down
4 changes: 2 additions & 2 deletions core-jdk8/src/test/java/org/bsc/langgraph4j/GraphTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -225,14 +225,14 @@ public void GenerateImageToDiagramGraph() throws Exception {
"title: Graph Diagram\n" +
"---\n" +
"flowchart TD\n" +
"\tstart((start))\n" +
"\t__START__((start))\n" +
"\t__END__((stop))\n" +
"\tagent_describer(\"agent_describer\")\n" +
"\tagent_sequence_plantuml(\"agent_sequence_plantuml\")\n" +
"\tagent_generic_plantuml(\"agent_generic_plantuml\")\n" +
"\tevaluate_result(\"evaluate_result\")\n" +
"\t%%\tcondition1{\"check state\"}\n" +
"\tstart:::start --> agent_describer:::agent_describer\n" +
"\t__START__:::__START__ --> agent_describer:::agent_describer\n" +
"\t%%\tagent_describer:::agent_describer --> condition1:::condition1\n" +
"\t%%\tcondition1:::condition1 -->|sequence| agent_sequence_plantuml:::agent_sequence_plantuml\n" +
"\tagent_describer:::agent_describer -->|sequence| agent_sequence_plantuml:::agent_sequence_plantuml\n" +
Expand Down
2 changes: 1 addition & 1 deletion image-to-diagram/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.bsc.langgraph4j</groupId>
<artifactId>langgraph4j-parent</artifactId>
<version>1.0-20240907</version>
<version>1.0-20240915</version>
</parent>

<artifactId>langgraph4j-image-to-diagram</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>org.bsc.langgraph4j</groupId>
<artifactId>langgraph4j-parent</artifactId>
<version>1.0-20240907</version>
<version>1.0-20240915</version>
<packaging>pom</packaging>

<name>langgraph4j::parent</name>
Expand Down
16 changes: 12 additions & 4 deletions server-jetty/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.bsc.langgraph4j</groupId>
<artifactId>langgraph4j-parent</artifactId>
<version>1.0-20240907</version>
<version>1.0-20240915</version>
</parent>

<artifactId>langgraph4j-server-jetty</artifactId>
Expand Down Expand Up @@ -139,15 +139,23 @@
<configuration>
<executable>java</executable>
<arguments>
<argument>-Djava.util.logging.config.file=${project.basedir}/
logging.properties</argument>
<argument>-Djava.util.logging.config.file=${project.basedir}/logging.properties</argument>
<argument>-classpath</argument>
<classpath/>
<argument>org.bsc.langgraph4j.AdaptiveRAGStreamingServer</argument>
</arguments>
<classpathScope>test</classpathScope>
</configuration>
</execution>
<execution>
<!-- exec:exec@adaptiverag1 -->
<id>adaptiverag1</id>
<goals><goal>java</goal></goals>
<configuration>
<classpathScope>test</classpathScope>
<mainClass>org.bsc.langgraph4j.AdaptiveRAGStreamingServer</mainClass>
</configuration>
</execution>
</executions>
<configuration>
<systemProperties>
Expand All @@ -160,7 +168,7 @@
<dependencies>
<dependency>
<groupId>org.bsc.langgraph4j</groupId>
<artifactId>langgraph4j-jdk8</artifactId>
<artifactId>langgraph4j-core-jdk8</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
Expand Down
4 changes: 4 additions & 0 deletions server-jetty/src/main/js/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
rm -r .parcel-cache
rm -r dist
bun run parcel:build

8 changes: 0 additions & 8 deletions server-jetty/src/main/js/build.ts

This file was deleted.

5 changes: 5 additions & 0 deletions server-jetty/src/main/js/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
bun build.sh
bun twgen.ts --no-watch
bun build.sh
rm ../resources/webapp/*
cp dist/* ../resources/webapp
9 changes: 0 additions & 9 deletions server-jetty/src/main/js/deploy.ts

This file was deleted.

12 changes: 6 additions & 6 deletions server-jetty/src/main/js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@
"dependencies": {
"@alenaksu/json-viewer": "^2.0.1",
"@lit/task": "^1.0.1",
"@types/bun": "^1.1.6",
"lit": "^3.1.4",
"@types/bun": "^1.1.8",
"lit": "^3.2.0",
"mermaid": "^10.9.1"
},
"devDependencies": {
"@types/node": "^20.14.10",
"autoprefixer": "^10.4.2",
"autoprefixer": "^10.4.20",
"crypto-browserify": "^3.12.0",
"daisyui": "^4.12.2",
"parcel": "^2.12.0",
"postcss": "^8.4.7",
"tailwindcss": "^3.4.5",
"typescript": "^5.4.5"
"postcss": "^8.4.45",
"tailwindcss": "^3.4.10",
"typescript": "^5.5.4"
}
}
26 changes: 16 additions & 10 deletions server-jetty/src/main/js/src/lg4j-graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,20 @@ export class LG4jMermaid extends HTMLElement {

const style = document.createElement("style");
style.textContent = `
:host {
display: block;
width: 100%;
height: 100%;
}
// :host {
// display: block;
// width: 100%;
// height: 100%;
// }
.h-full {
height: 100%;
}
.w-full {
width: 100%;
}
.flex {
display: flex;
}
// .flex {
// display: flex;
// }
.items-center {
align-items: center;
}
Expand Down Expand Up @@ -115,19 +115,25 @@ export class LG4jMermaid extends HTMLElement {

// console.debug( svgContainer );
return mermaid.render( 'graph', this.#textContent )

.then( res => {
console.debug( "RENDER COMPLETE", svgContainer );
// svgContainer.innerHTML = res.svg
const { right: width, bottom: height } = svgContainer.getBoundingClientRect();
const { width, height } = svgContainer.getBoundingClientRect();
// console.debug( res.svg )
console.debug( 'width:', width, 'height:', height);
const translated = res.svg
.replace( /height="[\d\.]+"/, `height="${height}"`)
.replace( /width="[\d\.]+"/, `width="${width}"`);
// console.debug( translated );
svgContainer.innerHTML = translated;
})
.then( () => this.#svgPanZoom() )
.then( () => {
console.debug( "boundingClientRect", svgContainer.getBoundingClientRect() );
for( const rc of svgContainer.getClientRects() ) {
console.debug( rc );
}
})
.catch( e => console.error( "RENDER ERROR", e ) )

}
Expand Down
72 changes: 38 additions & 34 deletions server-jetty/src/main/js/src/lg4j-result.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,36 +37,6 @@ export class LG4JResultElement extends LitElement {
this.removeEventListener( 'result', this.#onResult )
}


/**
* Renders a result.
* @param {ResultData} result - The result data to render.
* @returns {import('lit').TemplateResult} The template for the result.
*/
#renderResult(result, index) {
return html`
<div>
<div class="collapse collapse-arrow bg-base-200">
<input type="radio" name="item-1" checked="checked" />
<div class="collapse-title text-xl font-bold">${result.node}</div>
<div class="collapse-content">
${Object.entries(result.state).map(([key, value]) => html`
<div>
<h4 class="italic">${key}</h4>
<p class="my-3">
<json-viewer id="json${index}">
${JSON.stringify(value)}
</json-viewer>
</p>
</div>
`)}
</div>
</div>
</div>
`
}


/**
* Event handler for the 'result' event.
*
Expand Down Expand Up @@ -100,15 +70,49 @@ export class LG4JResultElement extends LitElement {
});
}


/**
* Renders a result.
* @param {ResultData} result - The result data to render.
* @returns {import('lit').TemplateResult} The template for the result.
*/
#renderResult(result, index) {
return html`
<div class="collapse collapse-arrow bg-base-200">
<input type="radio" name="item-1" checked="checked" />
<div class="collapse-title text-ml font-bold">${result.node}</div>
<div class="collapse-content">
${Object.entries(result.state).map(([key, value]) => html`
<div>
<h4 class="italic">${key}</h4>
<p class="my-3">
<json-viewer id="json${index}">
${JSON.stringify(value)}
</json-viewer>
</p>
</div>
`)}
</div>
</div>
`
}

render() {

return html`
<div class="h-screen flex flex-col">
<div class="flex flex-col gap-y-1.5 mx-2 mt-2 h-full overflow-auto">
${this.results.map( (result, index) => this.#renderResult(result, index))}
<div class="h-full">
<div role="tablist" class="tabs tabs-bordered">
<a role="tab" class="tab">No Thread</a>
</div>
<div class="max-h-[95%] overflow-x-auto bg-slate-500">
<table class="table table-pin-rows">
<tbody>
${this.results.map( (result, index) => html`<tr><td>${this.#renderResult(result, index)}</td></tr>`) }
</tbody>
</table>
</div>
</div>
`;
}

Expand Down
22 changes: 11 additions & 11 deletions server-jetty/src/main/js/src/lg4j-workbench.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ export class LG4JWorkbenchElement extends LitElement {

constructor() {
super();


}

#routeEvent( e, slot ) {
Expand Down Expand Up @@ -69,15 +67,17 @@ export class LG4JWorkbenchElement extends LitElement {

render() {
return html`
<div class="grid grid-cols-2 gap-y-2 grid-rows-[60px_auto_auto_auto_auto_auto] h-screen">
<div class="col-span-2">
<div class="navbar bg-base-100">
<a class="btn btn-ghost text-xl">${this.title}</a>
</div>
</div>
<div class="row-span-4 border border-gray-300 p-2"><slot name="graph">LEFT</slot></div>
<div class="row-span-5"><slot name="result">RIGHT</slot></div>
<div><slot name="executor">BOTTOM</slot></div>
<div class="h-screen">
<div class="navbar bg-base-100">
<a class="btn btn-ghost text-xl">${this.title}</a>
</div>
<div class="h-full grid gap-x-2 gap-y-9 grid-cols-2 grid-rows-5 ">
<div class="row-span-3 border border-gray-300"><slot name="graph">LEFT</slot></div>
<div class="row-span-5"><slot name="result">RIGHT</slot></div>
<div class=" border-slate-50"><slot name="executor">BOTTOM</slot></div>
</div>
</div>
`;
}
Expand Down
4 changes: 2 additions & 2 deletions server-jetty/src/main/js/src/twlit.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion server-jetty/src/main/js/twgen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,10 @@ async function start( watch = true ) {
const watcher = fs.watch('./dist', {})

for await (const event of watcher) {
console.log( event.filename, event.eventType )
// console.debug( event.filename, event.eventType )

if( event.filename === path.basename(input) ) {
console.debug( event.filename, event.eventType )
processCss(input)
}
}
Expand Down
2 changes: 2 additions & 0 deletions server-jetty/src/main/resources/webapp/index.292d1abb.css

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Loading

0 comments on commit bd4077f

Please sign in to comment.