Skip to content

Commit

Permalink
Function calling (huggingface#996)
Browse files Browse the repository at this point in the history
* Initial work on function calling

* wip

* Add websearch as a tool

* lint

* smol

* Move tools to their own files

* directly answer check

* Add text2img tool

* group tool calls together

* show retry even if no message

* fix trailing urls

* Add image popup

* format

* wip

* clean-up

* better loading indicator

* text colors

* extra example to summarize

* switch default model

* Add fetchUrl tool

* wip

* Add latest gradio

* fix types

* version bump sharp

* Basic tools menu

* working menu

* fix menu positioning

* deps fix

* add deps

* cleanup

* more cleanup

* cleanup

* package cleanups

* moar cleanup

* ui update

* Update ChatMessage.svelte

* upgrade gradio dep

* lint

* refactor and pass results to cohere

* feat: code interpreter tool

* fix: add e2b dependency

* feat: working TGI endpoint with tool results

* feat: allow image model to expand to 90dvw

* fix: dont block on title gen

* bump sharp

* misc cleanup

* fix url fetcher, adjust tool typing

* migrate to new MessageUpdate schema

* fix lint errors

* image editing, pdf upload + parsing

* feat: file preview for non-images

* feat: image prompting, file ui, file migration, many fixes

* feat: multiple files and tool file indices

* feat: add back remote keylogging prevention

* minor nit

* minor

* resolve nits

* feat: use node vm for calculator and improve prompt

* more nits

* feat: add index to tools settings

* chore: update invalid package lock

* feat: bump gradio client to 0.19.4

* feat: move pdf to markdown to huggingchat

* fix: uploaded file width

* feat: prompt the model when no files available

* Feat functions: UI update (huggingface#1157)

* details: close on click outside

* drag for tools

* tools ordering

* add link to community discussion

* misc

* calculator listed as last

* file style

* images with different ratios

* page scraper: longer timeout

@Saghen @mishig25 seems to work better with this

* vertical gap

* Revert "drag for tools"

This reverts commit 8eeed3b.

* chat padding on desktop

* file colors

* larger gap for all messages on xl screens

* feat: update pdf to markdown schema

* fix: uploaded file container width

* fix: tool name check

* fix: cohere endpoint

* fix: use most recent message for files

* feat: allow tools to access previous files

* feat: support all file types on document parser

* fix: use document parser in default tools

* feat: rename url fetcher internal name

* feat: resolve type error

* feat: enable tools on prod command r+

* feat: truncate document markdown

* feat: bump @huggingface/inference

* feat: resolve type errors

* nit

* Feat functions misc update 2 (huggingface#1158)

* update examples

a

* add tool indicator

* llama 3 description update

* image quick fix

* mobile

* icon purple

---------

Co-authored-by: Victor Mustar <victor.mustar@gmail.com>
Co-authored-by: Liam Dyer <liamcdyer@gmail.com>
Co-authored-by: Mishig <mishig.davaadorj@coloradocollege.edu>
  • Loading branch information
4 people authored May 23, 2024
1 parent 29d7af1 commit 5d666ab
Show file tree
Hide file tree
Showing 63 changed files with 2,812 additions and 529 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ WEBHOOK_URL_REPORT_ASSISTANT=#provide webhook url to get notified when an assist
ALLOWED_USER_EMAILS=`[]` # if it's defined, only these emails will be allowed to use the app

USAGE_LIMITS=`{}`

ALLOW_INSECURE_COOKIES=false # recommended to keep this to false but set to true if you need to run over http without tls
METRICS_PORT=
LOG_LEVEL=info
2 changes: 1 addition & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ module.exports = {
extraFileExtensions: [".svelte"],
},
rules: {
"no-shadow": ["error"],
"require-yield": "off",
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-non-null-assertion": "error",
"@typescript-eslint/no-unused-vars": [
Expand Down
13 changes: 7 additions & 6 deletions chart/env/prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ envVars:
"modelUrl": "https://huggingface.co/CohereForAI/c4ai-command-r-plus",
"websiteUrl": "https://docs.cohere.com/docs/command-r-plus",
"logoUrl": "https://huggingface.co/datasets/huggingchat/models-logo/resolve/main/cohere-logo.png",
"tools": true,
"parameters": {
"stop": ["<|END_OF_TURN_TOKEN|>"],
"truncate" : 28672,
Expand All @@ -47,20 +48,20 @@ envVars:
},
"promptExamples" : [
{
"title": "Write an email from bullet list",
"prompt": "As a restaurant owner, write a professional email to the supplier to get these products every week: \n\n- Wine (x10)\n- Eggs (x24)\n- Bread (x12)"
"title": "Generate a mouse portrait",
"prompt": "Generate the portrait of a scientific mouse in its laboratory."
}, {
"title": "Review a pull request",
"prompt": "Review this pull request: https://github.com/huggingface/chat-ui/pull/1131/files"
}, {
"title": "Code a snake game",
"prompt": "Code a basic snake game in python, give explanations for each step."
}, {
"title": "Assist in a task",
"prompt": "How do I make a delicious lemon cheesecake?"
}
]
},
{
"name" : "meta-llama/Meta-Llama-3-70B-Instruct",
"description": "Generation over generation, Meta Llama 3 demonstrates state-of-the-art performance on a wide range of industry benchmarks and offers new capabilities, including improved reasoning.",
"description": "Meta Llama 3 delivers top performance on various benchmarks and introduces new features like better reasoning.",
"logoUrl": "https://huggingface.co/datasets/huggingchat/models-logo/resolve/main/meta-logo.png",
"modelUrl": "https://huggingface.co/meta-llama/Meta-Llama-3-70B-Instruct",
"websiteUrl": "https://llama.meta.com/llama3/",
Expand Down
Loading

0 comments on commit 5d666ab

Please sign in to comment.