Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

feat(server): Add tool call support to WebUI (LLama Server) #13501

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 26 commits into
base: master
Choose a base branch
Loading
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
acd4767
feat(server): add basic js tool call support
samolego May 7, 2025
6236918
code abstraction for tool calling
samolego May 8, 2025
e84e819
minor changes, renames
samolego May 8, 2025
f6b1386
add tool call fields
samolego May 12, 2025
f2175cb
fix: Use structured `tool_calls` for tool handling
samolego May 13, 2025
4698b66
fix: forward tool call info back to api
samolego May 13, 2025
69e7119
provide tool call response in a dropdown
samolego May 13, 2025
75fd25e
Fix UI updates after tool call chains
samolego May 13, 2025
ae32a9a
move js evaluation to sandboxed iframe, remove debug logs
samolego May 13, 2025
00d911d
merge assistant messages on tool use
samolego May 18, 2025
d99808f
feat: populate settings tool calling section
samolego May 18, 2025
0b34d53
feat: add stream response setting
samolego May 18, 2025
0480054
fix: revert base url
samolego May 18, 2025
7fa0043
Merge remote-tracking branch 'upstream/master' into feat/tool-calling
samolego May 18, 2025
b128ca5
fix: readd missing comments
samolego May 19, 2025
c203815
fix: more cleanup
samolego May 19, 2025
cf110f9
minor changes
samolego May 19, 2025
4e7da1b
Delete deno.lock
samolego May 19, 2025
031e673
Update tools/server/webui/package.json
samolego May 20, 2025
c9ec6fa
fix: remove unused type, do not add tool calls in user messages
samolego May 20, 2025
3f76cac
feat: support streaming tool calls
samolego May 26, 2025
c98baef
bugfixes for streaming calls
samolego May 27, 2025
22a951b
fix demo conversation import
samolego May 27, 2025
798946e
fix: make chained message regeneratable
samolego May 29, 2025
92f8bb0
updates to config and available tools map
samolego May 29, 2025
5c898ec
better handling of logged variables in js repl
samolego May 29, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: remove unused type, do not add tool calls in user messages
  • Loading branch information
samolego committed May 20, 2025
commit c9ec6fabcf3fcff254584bd270f25eabdbd4ee09
2 changes: 1 addition & 1 deletion 2 tools/server/webui/src/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const CONFIG_DEFAULT = {
...Object.fromEntries(
Array.from(AVAILABLE_TOOLS.values()).map((tool: AgentTool) => [
`tool_${tool.id}_enabled`,
false, // Default value for tool enabled state (e.g., false for opt-in)
false,
])
),
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { ToolCallType } from '../../utils/types';
import { ToolCallRequest } from '../../utils/types';

export const ToolCallArgsDisplay = ({
toolCall,
baseClassName = 'collapse bg-base-200 collapse-arrow mb-4',
}: {
toolCall: ToolCallType;
toolCall: ToolCallRequest;
baseClassName?: string;
}) => {
return (
Expand Down
8 changes: 6 additions & 2 deletions 8 tools/server/webui/src/utils/misc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,15 @@ export const copyStr = (textToCopy: string) => {
export function normalizeMsgsForAPI(messages: Readonly<Message[]>) {
return messages.map((msg) => {
if (msg.role !== 'user' || !msg.extra) {
return {
const apiMessage = {
role: msg.role,
content: msg.content,
tool_calls: msg.tool_calls,
} as APIMessage;

if (msg.tool_calls && msg.tool_calls.length > 0) {
apiMessage.tool_calls = msg.tool_calls;
}
return apiMessage;
}

// extra content first, then user text message in the end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import StorageUtils from '../storage';
import { ToolCallRequest, ToolCallOutput, ToolCallParameters } from '../types';
import { AgentTool } from './agent_tool';

Expand Down
3 changes: 0 additions & 3 deletions 3 tools/server/webui/src/utils/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,6 @@ export interface ToolCallSpec {
parameters: ToolCallParameters;
};
}
export type ToolCallType = NonNullable<
(Message | PendingMessage)['tool_calls']
>[number];

export interface ToolCallParameters {
type: 'object';
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.