Target branch: Pull requests should target the dev branch.
Description: Briefly describe the changes in this pull request.
Changelog: Ensure a changelog entry following the format of Keep a Changelog is added at the bottom of the PR description.
Documentation: Have you updated relevant documentation Open WebUI Docs, or other documentation sources?
Dependencies: Are there any new dependencies? Have you updated the dependency versions in the documentation?
Testing: Have you written and run sufficient tests for the changes?
Code Review: Have you self-reviewed your code and addressed any coding standard issues?
Description
i've implemented function calling, since this is one of the last "big" features relating to LLMs that open-webui has yet to have implemented.
Changelog Entry
Added
function calling (incl. settings menu)
in-browser monaco editor for typescript function editing
Fixed
(n/a)
Changed
(n/a)
Removed
(n/a)
Security
(n/a)
Breaking Changes
(n/a)
Additional Information
this PR also adds monaco as a dependency, since functions are written in-the-browser with first-class typescript support. i looked into writing my own editor - this is not an option (for me, at least)
functions are written to localStorage, this is because i don't know python and i'd rather not write poor code for the backend .
there's still some work to be done (such as adding validation for parameter names - they can only include values which a javascript variable could include) but its functional.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
## 📋 Pull Request Information
**Original PR:** https://github.com/open-webui/open-webui/pull/2175
**Author:** [@not-nullptr](https://github.com/not-nullptr)
**Created:** 5/11/2024
**Status:** ❌ Closed
**Base:** `dev` ← **Head:** `function-calling`
---
### 📝 Commits (4)
- [`d4e2bbe`](https://github.com/open-webui/open-webui/commit/d4e2bbe38dbad56e331b60531ae5c6fec192d8ae) add local function calling
- [`b3a0430`](https://github.com/open-webui/open-webui/commit/b3a0430c935e927e22b1ba0c5968a102fe8b2eb9) use $i18n for localizations
- [`4d8b382`](https://github.com/open-webui/open-webui/commit/4d8b382cd53a3f6106d9cab8ba1362e737d88c29) fix files not saving
- [`8bdb48b`](https://github.com/open-webui/open-webui/commit/8bdb48b42c5c1857c38deca61c7a8c13ecbeb55f) add error handling
### 📊 Changes
**11 files changed** (+988 additions, -5 deletions)
<details>
<summary>View changed files</summary>
📝 `package-lock.json` (+6 -0)
📝 `package.json` (+1 -0)
➕ `src/lib/apis/functions/index.ts` (+191 -0)
➕ `src/lib/apis/monaco/index.ts` (+34 -0)
➕ `src/lib/components/chat/Settings/Functions.svelte` (+431 -0)
📝 `src/lib/components/chat/SettingsModal.svelte` (+55 -4)
📝 `src/lib/stores/index.ts` (+1 -1)
📝 `src/routes/(app)/+page.svelte` (+32 -0)
📝 `src/routes/(app)/c/[id]/+page.svelte` (+32 -0)
📝 `src/routes/+layout.svelte` (+33 -0)
➕ `src/routes/editor/[function]/+page.svelte` (+172 -0)
</details>
### 📄 Description
## Pull Request Checklist
- [x] **Target branch:** Pull requests should target the `dev` branch.
- [x] **Description:** Briefly describe the changes in this pull request.
- [x] **Changelog:** Ensure a changelog entry following the format of [Keep a Changelog](https://keepachangelog.com/) is added at the bottom of the PR description.
- [ ] **Documentation:** Have you updated relevant documentation [Open WebUI Docs](https://github.com/open-webui/docs), or other documentation sources?
- [ ] **Dependencies:** Are there any new dependencies? Have you updated the dependency versions in the documentation?
- [ ] **Testing:** Have you written and run sufficient tests for the changes?
- [x] **Code Review:** Have you self-reviewed your code and addressed any coding standard issues?
---
## Description
i've implemented function calling, since this is one of the last "big" features relating to LLMs that open-webui has yet to have implemented.
---
### Changelog Entry
### Added
- function calling (incl. settings menu)
- in-browser monaco editor for typescript function editing
### Fixed
(n/a)
### Changed
(n/a)
### Removed
(n/a)
### Security
(n/a)
### Breaking Changes
(n/a)
---
### Additional Information
this PR also adds `monaco` as a dependency, since functions are written in-the-browser with first-class typescript support. i looked into writing my own editor - this is not an option (for me, at least)
functions are written to `localStorage`, this is because i don't know python and i'd rather not write poor code for the backend .
there's still some work to be done (such as adding validation for parameter names - they can only include values which a javascript variable could include) but its functional.
**demo:**
https://github.com/open-webui/open-webui/assets/62841684/70bcdd8c-d887-43f7-8f7b-54b5ac1dab31
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/2175
Author: @not-nullptr
Created: 5/11/2024
Status: ❌ Closed
Base:
dev← Head:function-calling📝 Commits (4)
d4e2bbeadd local function callingb3a0430use $i18n for localizations4d8b382fix files not saving8bdb48badd error handling📊 Changes
11 files changed (+988 additions, -5 deletions)
View changed files
📝
package-lock.json(+6 -0)📝
package.json(+1 -0)➕
src/lib/apis/functions/index.ts(+191 -0)➕
src/lib/apis/monaco/index.ts(+34 -0)➕
src/lib/components/chat/Settings/Functions.svelte(+431 -0)📝
src/lib/components/chat/SettingsModal.svelte(+55 -4)📝
src/lib/stores/index.ts(+1 -1)📝
src/routes/(app)/+page.svelte(+32 -0)📝
src/routes/(app)/c/[id]/+page.svelte(+32 -0)📝
src/routes/+layout.svelte(+33 -0)➕
src/routes/editor/[function]/+page.svelte(+172 -0)📄 Description
Pull Request Checklist
devbranch.Description
i've implemented function calling, since this is one of the last "big" features relating to LLMs that open-webui has yet to have implemented.
Changelog Entry
Added
Fixed
(n/a)
Changed
(n/a)
Removed
(n/a)
Security
(n/a)
Breaking Changes
(n/a)
Additional Information
this PR also adds
monacoas a dependency, since functions are written in-the-browser with first-class typescript support. i looked into writing my own editor - this is not an option (for me, at least)functions are written to
localStorage, this is because i don't know python and i'd rather not write poor code for the backend .there's still some work to be done (such as adding validation for parameter names - they can only include values which a javascript variable could include) but its functional.
demo:
https://github.com/open-webui/open-webui/assets/62841684/70bcdd8c-d887-43f7-8f7b-54b5ac1dab31
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.