Skip to content

Commit 30e75c1

Browse files
committed
feat: add Monaco Editor component for JSON function definition and update layout
1 parent b789eb0 commit 30e75c1

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

app/ollama-tools/ollama-tools.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
:host {
22
display: grid;
3+
grid-template-rows: auto 1fr auto;
34
width: 100%;
45
height: 100%;
56
overflow: hidden;

app/ollama-tools/ollama-tools.html

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,26 @@
11
<h2>Ollama Tool Calling</h2>
2-
<div class="container"></div>
2+
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"
16+
}
17+
},
18+
"required": ["personAge"]
19+
}
20+
}
21+
}
22+
]
23+
</monaco-editor>
24+
25+
326
<button data-action="callFunction">Call Function</button>

app/ollama-tools/ollama-tools.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import {OllamaModule, ChatRoles} from "./../../src/modules/ollama.js";
2+
import "./../../components/monaco-editor/monaco-editor.js";
23

34
const tools = [
45
{

0 commit comments

Comments
 (0)