Commit graph

67 commits

Author SHA1 Message Date
Timothy Carambat
ad01df8790
Reranker option for RAG ()
* Reranker WIP

* add cacheing and singleton loading

* Add field to workspaces for vectorSearchMode
Add UI for lancedb to change mode
update all search endpoints to pass in reranker prop if provider can use it

* update hint text

* When reranking, swap score to rerank score

* update optchain
2025-01-02 14:27:52 -08:00
timothycarambat
f417ffd5e0 resolves
floor ms value
2025-01-01 15:54:44 -08:00
Timothy Carambat
ef71b95cf9
Return timestamps in OpenAI compat endpoints in proper format () 2024-12-31 09:35:52 -08:00
Timothy Carambat
dd7c4675d3
LLM performance metric tracking ()
* WIP performance metric tracking

* fix: patch UI trying to .toFixed() null metric
Anthropic tracking migraiton
cleanup logs

* Apipie implmentation, not tested

* Cleanup Anthropic notes, Add support for AzureOpenAI tracking

* bedrock token metric tracking

* Cohere support

* feat: improve default stream handler to track for provider who are actually OpenAI compliant in usage reporting
add deepseek support

* feat: Add FireworksAI tracking reporting
fix: improve handler when usage:null is reported (why?)

* Add token reporting for GenericOpenAI

* token reporting for koboldcpp + lmstudio

* lint

* support Groq token tracking

* HF token tracking

* token tracking for togetherai

* LiteLLM token tracking

* linting + Mitral token tracking support

* XAI token metric reporting

* native provider runner

* LocalAI token tracking

* Novita token tracking

* OpenRouter token tracking

* Apipie stream metrics

* textwebgenui token tracking

* perplexity token reporting

* ollama token reporting

* lint

* put back comment

* Rip out LC ollama wrapper and use official library

* patch images with new ollama lib

* improve ollama offline message

* fix image handling in ollama llm provider

* lint

* NVIDIA NIM token tracking

* update openai compatbility responses

* UI/UX show/hide metrics on click for user preference

* update bedrock client

---------

Co-authored-by: shatfield4 <seanhatfield5@gmail.com>
2024-12-16 14:31:17 -08:00
Timothy Carambat
c3723ce2ff
Add backfilling on query for chat widget to improve UX () 2024-10-15 14:37:44 -07:00
Sean Hatfield
e6c4eb3f1c
Support attachments in developer API ()
* support attachments in developer api

* lint

---------

Co-authored-by: Timothy Carambat <rambat1010@gmail.com>
2024-09-25 13:44:26 -07:00
Mr Simon C
cf6928fd5d
match user prompts exactly not partially () 2024-09-09 14:40:06 -07:00
Timothy Carambat
2de9e492ec
Enabled use of @agent (and skills) via dev API calls ()
* Use `@agent` via dev API

* Move EphemeralEventListener to same file as agent
2024-08-22 13:12:09 -07:00
Timothy Carambat
fdc3add53c
Api session id support ()
* Refactor api endpoint chat handler to its own function
remove legacy `chatWithWorkspace` and cleanup `index.js`

* Add `sessionId` in dev API to partition chats logically statelessly
2024-08-21 15:25:47 -07:00
timothycarambat
2d2e49bc00 fix missing export 2024-08-21 14:58:56 -07:00
Timothy Carambat
1f96b837b3
Refactor api endpoint chat handler to its own function ()
remove legacy `chatWithWorkspace` and cleanup `index.js`
2024-08-21 14:47:06 -07:00
Timothy Carambat
a8d25c7dd3
Allow readable username passed in script widget () 2024-08-16 16:55:42 -07:00
Sean Hatfield
6666fff0c2
Support multiple preset prompts in single message ()
support multiple preset prompts in single message
2024-08-06 10:27:36 -07:00
Timothy Carambat
38fc181238
Add multimodality support ()
* Add multimodality support

* Add Bedrock, KoboldCpp,LocalAI,and TextWebGenUI multi-modal

* temp dev build

* patch bad import

* noscrolls for windows dnd

* noscrolls for windows dnd

* update README

* update README

* add multimodal check
2024-07-31 10:47:49 -07:00
Timothy Carambat
0b845fbb1c
Deprecate .isSafe moderation ()
Add type defs to helpers
2024-06-28 15:32:30 -07:00
Sean Hatfield
910eb36cfe
[FIX] OpenAI compatible endpoints query mode developer API bug fix ()
fix query mode always responding with refusal message on develop api openai compatible endpoints
2024-06-28 14:23:16 -07:00
Timothy Carambat
88a0335fd2
Add OpenAI compatible API support () 2024-06-24 18:28:21 -07:00
Sean Hatfield
c2523a9593
[FEAT] Persist query mode refusal responses as chat history ()
* log query refusals to workspace chats but hide in ui

* linting

---------

Co-authored-by: timothycarambat <rambat1010@gmail.com>
2024-06-20 15:44:19 -07:00
Timothy Carambat
13fb63930b
Improve RAG responses via source backfilling ()
* Improve RAG responses via source backfilling

* Hide irrelevant citations from UI
2024-05-23 09:56:57 -07:00
timothycarambat
3794ef8dfd patch: use workspace LLM for embed chats and fallback to system
resolves 
2024-05-17 17:33:19 -07:00
Sean Hatfield
d36c3ff8b2
[FEAT] Slash templates ()
* WIP slash presets

* WIP slash command customization CRUD + validations complete

* backend slash command support

* fix permission setting on new slash commands
rework form submit and pattern on frontend

* Add field updates for hooks,
required=true to field
add user<>command constraint to keep them unique
enforce uniquness via teritary uid field on table for multi and non-multi user

* reset migration

---------

Co-authored-by: timothycarambat <rambat1010@gmail.com>
2024-05-10 12:35:33 -07:00
Sean Hatfield
d02013fd71
[FIX] Document pinning does not count in query mode ()
* if document is pinned, do not give queryRefusalResponse message

* forgot embed.js patch

---------

Co-authored-by: timothycarambat <rambat1010@gmail.com>
2024-05-02 10:27:09 -07:00
Timothy Carambat
47b7df4fc3
Clear chat window on /reset ()
clear chat window on /reset
2024-05-01 20:39:58 -07:00
Timothy Carambat
894f727903
Remove restrictions on pinned documents to use more context ()
* Remove restrictions on pinned documents to use more contet

* update comment
2024-05-01 13:32:52 -07:00
Timothy Carambat
42e1d8e8ce
Customize refusal response for query mode ()
* Customize refusal response for `query` mode

* remove border for desktop
2024-04-30 16:14:30 -07:00
Timothy Carambat
9655880cf0
Update all vector dbs to filter duplicate source documents that may be pinned ()
* Update all vector dbs to filter duplicate parents

* cleanup
2024-04-17 18:04:39 -07:00
Timothy Carambat
f9ac27e9a4
Handle Anthropic streamable errors () 2024-04-16 16:25:32 -07:00
Timothy Carambat
a5bb77f97a
Agent support for @agent default agent inside workspace chat ()
V1 of agent support via built-in `@agent` that can be invoked alongside normal workspace RAG chat.
2024-04-16 10:50:10 -07:00
Timothy Carambat
94b58249a3
Enable per-workspace provider/model combination ()
* Enable per-workspace provider/model combination

* cleanup

* remove resetWorkspaceChatModels and wipeWorkspaceModelPreference to prevent workspace from resetting model

* add space

---------

Co-authored-by: shatfield4 <seanhatfield5@gmail.com>
2024-04-05 10:58:36 -07:00
Timothy Carambat
791c0ee9dc
Enable ability to do full-text query on documents ()
* Enable ability to do full-text query on documents
Show alert modal on first pin for client
Add ability to use pins in stream/chat/embed

* typo and copy update

* simplify spread of context and sources
2024-02-21 13:15:45 -08:00
Timothy Carambat
c59ab9da0a
Refactor LLM chat backend ()
* refactor stream/chat/embed-stram to be a single execution logic path so that it is easier to maintain and build upon

* no thread in sync chat since only api uses it
adjust import locations
2024-02-14 12:32:07 -08:00
Sean Hatfield
f4b09a8c79
[FEAT] RLHF on response messages ()
* WIP RLHF works on historical messages

* refactor Actions component

* completed RLHF up and down votes for chats

* add defaults for HistoricalMessage params

* refactor RLHF implmenation
remove forwardRef on history items to prevent rerenders

* remove dup id

* Add rating to CSV output

---------

Co-authored-by: timothycarambat <rambat1010@gmail.com>
2024-02-13 11:33:05 -08:00
Timothy Carambat
406732830f
Implement workspace threading that is backwards compatible ()
* Implement workspace thread that is compatible with legacy versions

* last touches

* comment on chat qty enforcement
2024-02-08 18:37:22 -08:00
Timothy Carambat
aca5940650
Refactor handleStream to LLM Classes () 2024-02-07 08:15:14 -08:00
Timothy Carambat
2bc11d3f1a
Implement support for HuggingFace Inference Endpoints () 2024-02-06 09:17:51 -08:00
Sean Hatfield
1846a99b93
[FEAT] Embedded AnythingLLM ()
* WIP embedded app

* WIP got response from backend in embedded app

* WIP streaming prints to embedded app

* implemented streaming and tailwind min for styling into embedded app

* WIP embedded app history functional

* load params from script tag into embedded app

* rough in modularization of embed chat
cleanup dev process for easier dev support
move all chat to components
todo: build process
todo: backend support

* remove eslint config

* Implement models and cleanup embed chat endpoints
Improve build process for embed
prod minification and bundle size awareness
WIP

* forgot files

* rename to embed folder

* introduce chat modal styles

* add middleware validations on embed chat

* auto open param and default greeting

* reset chat history

* Admin embed config page

* Admin Embed Chats mgmt page

* update embed

* nonpriv

* more style support
reopen if chat was last opened

* update comments

* remove unused imports

* allow change of workspace for embedconfig

* update failure to lookup message

* update reset script

* update instructions

* Add more styling options
Add sponsor text at bottom
Support dynamic container height
Loading animations

* publish new embed script

* Add back syntax highlighting and keep bundle small via dynamic script build

* add hint

* update readme

* update copy model for snippet with link to styles

---------

Co-authored-by: timothycarambat <rambat1010@gmail.com>
2024-02-05 14:21:34 -08:00
Timothy Carambat
8377600211
Patch Azure text completion persistence () 2024-01-24 13:08:22 -08:00
Sean Hatfield
56fa17caf2
create configurable topN per workspace ()
* create configurable topN per workspace

* Update TopN UI text
Fix fallbacks for all providers
Add SQLite CHECK to TOPN value

* merge with master
Update zilliz provider for variable TopN

---------

Co-authored-by: timothycarambat <rambat1010@gmail.com>
2024-01-18 12:34:20 -08:00
Sean Hatfield
c2c8fe9756
add support for mistral api ()
* add support for mistral api

* update docs to show support for Mistral

* add default temp to all providers, suggest different results per provider

---------

Co-authored-by: timothycarambat <rambat1010@gmail.com>
2024-01-17 14:42:05 -08:00
Sean Hatfield
90df37582b
Per workspace model selection ()
* WIP model selection per workspace (migrations and openai saves properly

* revert OpenAiOption

* add support for models per workspace for anthropic, localAi, ollama, openAi, and togetherAi

* remove unneeded comments

* update logic for when LLMProvider is reset, reset Ai provider files with master

* remove frontend/api reset of workspace chat and move logic to updateENV
add postUpdate callbacks to envs

* set preferred model for chat on class instantiation

* remove extra param

* linting

* remove unused var

* refactor chat model selection on workspace

* linting

* add fallback for base path to localai models

---------

Co-authored-by: timothycarambat <rambat1010@gmail.com>
2024-01-17 12:59:25 -08:00
Timothy Carambat
f5bb064dee
Implement streaming for workspace chats via API () 2024-01-16 10:37:46 -08:00
Timothy Carambat
bd158ce7b1
[Feat] Query mode to return no-result when no context found ()
* Query mode to return no-result when no context found

* update default error for sync chat

* remove unnecessary type conversion
2024-01-16 09:32:51 -08:00
timothycarambat
dfd03e332c patch stream response 2024-01-10 15:32:07 -08:00
Sean Hatfield
1d39b8a2ce
add Together AI LLM support ()
* add Together AI LLM support

* update readme to support together ai

* Patch togetherAI implementation

* add model sorting/option labels by organization for model selection

* linting + add data handling for TogetherAI

* change truthy statement
patch validLLMSelection method

---------

Co-authored-by: timothycarambat <rambat1010@gmail.com>
2024-01-10 12:35:30 -08:00
Timothy Carambat
e9f7b9b79e
Handle undefined stream chunk for native LLM () 2024-01-04 18:05:06 -08:00
Timothy Carambat
75dd86967c
Implement AzureOpenAI model chat streaming ()
resolves 
2024-01-03 16:25:39 -08:00
Timothy Carambat
2a1202de54
Patch Ollama Streaming chunk issues ()
Replace stream/sync chats with Langchain interface for now
connect 
ref: https://github.com/Mintplex-Labs/anything-llm/issues/495#issuecomment-1871476091
2023-12-28 13:59:47 -08:00
Timothy Carambat
e0a0a8976d
Add Ollama as LLM provider option ()
* Add support for Ollama as LLM provider
resolves 
2023-12-27 17:21:47 -08:00
Timothy Carambat
24227e48a7
Add LLM support for Google Gemini-Pro ()
resolves 
2023-12-27 17:08:03 -08:00
Timothy Carambat
37cdb845a4
patch: implement @lunamidori hotfix for LocalAI streaming chunk overflows ()
* patch: implement @lunamidori hotfix for LocalAI streaming chunk overflows
resolves 

* change log to error log

* log trace

* lint
2023-12-12 16:20:06 -08:00