mirror of
https://github.com/open-webui/open-webui
synced 2024-11-25 21:38:43 +00:00
Merge pull request #6424 from Peter-De-Ath/add-user-name-slash-prompt
Some checks are pending
Deploy to HuggingFace Spaces / check-secret (push) Waiting to run
Deploy to HuggingFace Spaces / deploy (push) Blocked by required conditions
Create and publish Docker images with specific build args / build-main-image (linux/amd64) (push) Waiting to run
Create and publish Docker images with specific build args / build-main-image (linux/arm64) (push) Waiting to run
Create and publish Docker images with specific build args / build-cuda-image (linux/amd64) (push) Waiting to run
Create and publish Docker images with specific build args / build-cuda-image (linux/arm64) (push) Waiting to run
Create and publish Docker images with specific build args / build-ollama-image (linux/amd64) (push) Waiting to run
Create and publish Docker images with specific build args / build-ollama-image (linux/arm64) (push) Waiting to run
Create and publish Docker images with specific build args / merge-main-images (push) Blocked by required conditions
Create and publish Docker images with specific build args / merge-cuda-images (push) Blocked by required conditions
Create and publish Docker images with specific build args / merge-ollama-images (push) Blocked by required conditions
Python CI / Format Backend (3.11) (push) Waiting to run
Frontend Build / Format & Build Frontend (push) Waiting to run
Frontend Build / Frontend Unit Tests (push) Waiting to run
Integration Test / Run Cypress Integration Tests (push) Waiting to run
Integration Test / Run Migration Tests (push) Waiting to run
Some checks are pending
Deploy to HuggingFace Spaces / check-secret (push) Waiting to run
Deploy to HuggingFace Spaces / deploy (push) Blocked by required conditions
Create and publish Docker images with specific build args / build-main-image (linux/amd64) (push) Waiting to run
Create and publish Docker images with specific build args / build-main-image (linux/arm64) (push) Waiting to run
Create and publish Docker images with specific build args / build-cuda-image (linux/amd64) (push) Waiting to run
Create and publish Docker images with specific build args / build-cuda-image (linux/arm64) (push) Waiting to run
Create and publish Docker images with specific build args / build-ollama-image (linux/amd64) (push) Waiting to run
Create and publish Docker images with specific build args / build-ollama-image (linux/arm64) (push) Waiting to run
Create and publish Docker images with specific build args / merge-main-images (push) Blocked by required conditions
Create and publish Docker images with specific build args / merge-cuda-images (push) Blocked by required conditions
Create and publish Docker images with specific build args / merge-ollama-images (push) Blocked by required conditions
Python CI / Format Backend (3.11) (push) Waiting to run
Frontend Build / Format & Build Frontend (push) Waiting to run
Frontend Build / Frontend Unit Tests (push) Waiting to run
Integration Test / Run Cypress Integration Tests (push) Waiting to run
Integration Test / Run Migration Tests (push) Waiting to run
feat: add user_name to slash prompt template
This commit is contained in:
commit
04babeb45a
@ -1,5 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { prompts } from '$lib/stores';
|
import { prompts, user } from '$lib/stores';
|
||||||
import {
|
import {
|
||||||
findWordIndices,
|
findWordIndices,
|
||||||
getUserPosition,
|
getUserPosition,
|
||||||
@ -78,6 +78,12 @@
|
|||||||
text = text.replaceAll('{{USER_LOCATION}}', String(location));
|
text = text.replaceAll('{{USER_LOCATION}}', String(location));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (command.content.includes('{{USER_NAME}}')) {
|
||||||
|
console.log($user);
|
||||||
|
const name = $user.name || 'User';
|
||||||
|
text = text.replaceAll('{{USER_NAME}}', name);
|
||||||
|
}
|
||||||
|
|
||||||
if (command.content.includes('{{USER_LANGUAGE}}')) {
|
if (command.content.includes('{{USER_LANGUAGE}}')) {
|
||||||
const language = localStorage.getItem('locale') || 'en-US';
|
const language = localStorage.getItem('locale') || 'en-US';
|
||||||
text = text.replaceAll('{{USER_LANGUAGE}}', language);
|
text = text.replaceAll('{{USER_LANGUAGE}}', language);
|
||||||
|
Loading…
Reference in New Issue
Block a user