Skip to content

Commit 40f2069

Browse files
committed
feat: integrate dynamic rows and columns layout in Ollama tools with Monaco Editor support
1 parent 30e75c1 commit 40f2069

File tree

3 files changed

+59
-19
lines changed

3 files changed

+59
-19
lines changed

app/ollama-tools/ollama-tools.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,12 @@
55
height: 100%;
66
overflow: hidden;
77
}
8+
9+
section {
10+
height: 100%;
11+
}
12+
13+
section h2 {
14+
margin: 0;
15+
padding: 0;
16+
}

app/ollama-tools/ollama-tools.html

Lines changed: 48 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,55 @@
11
<h2>Ollama Tool Calling</h2>
22

3-
<monaco-editor id="tooling" language="json">
4-
[
5-
{
6-
"type": "function",
7-
"function": {
8-
"name": "age",
9-
"description": "Return the age of a person",
10-
"parameters": {
11-
"type": "object",
12-
"properties": {
13-
"personAge": {
14-
"type": "integer",
15-
"description": "The age of the person"
3+
<dynamic-rows>
4+
<div data-height="1fr">
5+
<dynamic-columns>
6+
<div data-width="1fr">
7+
<section>
8+
<h2>Tools Definitions</h2>
9+
<monaco-editor data-language="json">
10+
[
11+
{
12+
"type": "function",
13+
"function": {
14+
"name": "age",
15+
"description": "Return the age of a person",
16+
"parameters": {
17+
"type": "object",
18+
"properties": {
19+
"personAge": {
20+
"type": "integer",
21+
"description": "The age of the person"
22+
}
23+
},
24+
"required": ["personAge"]
1625
}
17-
},
18-
"required": ["personAge"]
26+
}
1927
}
20-
}
21-
}
22-
]
23-
</monaco-editor>
28+
];
29+
</monaco-editor>
30+
</section>
31+
</div>
32+
<div class="resize-handle"></div>
33+
<div data-width="1fr">
34+
<dynamic-rows>
35+
<section data-height="300px">
36+
<h2>System Prompt</h2>
37+
<monaco-editor data-language="text"></monaco-editor>
38+
</section>
39+
<div class="resize-handle"></div>
40+
<section data-height="1fr">
41+
<h2>User Prompt</h2>
42+
<monaco-editor data-language="text"></monaco-editor>
43+
</section>
44+
</dynamic-rows>
45+
</div>
46+
</dynamic-columns>
47+
</div>
48+
<div class="resize-handle"></div>
49+
<div data-height="100px">
50+
<text-area></text-area>
51+
</div>
52+
</dynamic-rows>
2453

2554

2655
<button data-action="callFunction">Call Function</button>

app/ollama-tools/ollama-tools.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import {OllamaModule, ChatRoles} from "./../../src/modules/ollama.js";
22
import "./../../components/monaco-editor/monaco-editor.js";
3+
import "./../../components/dynamic-columns/dynamic-columns.js";
4+
import "./../../components/dynamic-rows/dynamic-rows.js";
35

46
const tools = [
57
{

0 commit comments

Comments
 (0)