Skip to content

Commit

Permalink
feat(chat): add quick app editor (Issue #2160) (#2277)
Browse files Browse the repository at this point in the history
Co-authored-by: Magomed-Elbi Dzhukalaev <[email protected]>
Co-authored-by: Ilya Bondar <[email protected]>
  • Loading branch information
3 people authored Oct 3, 2024
1 parent e077478 commit 5c89053
Show file tree
Hide file tree
Showing 15 changed files with 925 additions and 178 deletions.
2 changes: 1 addition & 1 deletion apps/chat/.env.development
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ DIAL_API_VERSION="2024-02-01"


# Application UI settings
ENABLED_FEATURES="conversations-section,prompts-section,top-settings,top-clear-conversation,top-chat-info,top-chat-model-settings,empty-chat-settings,header,footer,request-api-key,report-an-issue,likes,conversations-sharing,prompts-sharing,input-files,attachments-manager,conversations-publishing,prompts-publishing,custom-logo,input-links,custom-applications,message-templates,marketplace"
ENABLED_FEATURES="conversations-section,prompts-section,top-settings,top-clear-conversation,top-chat-info,top-chat-model-settings,empty-chat-settings,header,footer,request-api-key,report-an-issue,likes,conversations-sharing,prompts-sharing,input-files,attachments-manager,conversations-publishing,prompts-publishing,custom-logo,input-links,custom-applications,message-templates,marketplace,quick-apps"
NEXT_PUBLIC_APP_NAME="Local Development APP Name"
NEXT_PUBLIC_DEFAULT_SYSTEM_PROMPT=""
NEXT_PUBLIC_DEFAULT_TEMPERATURE="1"
Expand Down
5 changes: 3 additions & 2 deletions apps/chat/src/components/Chat/ModelDescription.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { useTranslation } from 'next-i18next';

import classNames from 'classnames';

import { getModelDescription } from '@/src/utils/app/application';
import { getOpenAIEntityFullName } from '@/src/utils/app/conversation';

import { DialAIEntityModel } from '@/src/types/models';
Expand Down Expand Up @@ -35,13 +36,13 @@ export const ModelDescription = ({
<ModelIcon entity={model} entityId={model.id} size={24} />
<span>{getOpenAIEntityFullName(model)}</span>
</div>
{model.description && (
{!!getModelDescription(model) && (
<span
className="whitespace-pre-wrap text-xs text-secondary"
data-qa="entity-descr"
>
<EntityMarkdownDescription isShortDescription={isShortDescription}>
{model.description}
{getModelDescription(model)}
</EntityMarkdownDescription>
</span>
)}
Expand Down
3 changes: 2 additions & 1 deletion apps/chat/src/components/Chat/ModelList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { useTranslation } from 'next-i18next';

import classNames from 'classnames';

import { getModelDescription } from '@/src/utils/app/application';
import {
getOpenAIEntityFullName,
groupModelsAndSaveOrder,
Expand Down Expand Up @@ -107,7 +108,7 @@ const ModelGroup = ({
return entities[minIndex === Number.MAX_SAFE_INTEGER ? 0 : minIndex];
}, [entities, recentModelsIds, searchTerm, selectedModelId]);

const description = currentEntity.description;
const description = getModelDescription(currentEntity);
const currentEntityId = currentEntity.id;
const isPublicEntity = isEntityPublic(currentEntity);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Fragment } from 'react';

import { useTranslation } from 'next-i18next';

import { getModelDescription } from '@/src/utils/app/application';
import { getFolderIdFromEntityId } from '@/src/utils/app/folders';
import { ApiUtils } from '@/src/utils/server/api';

Expand Down Expand Up @@ -56,13 +57,13 @@ export function ReviewApplicationDialogView() {
/>
)}
</div>
{application?.description && (
{!!(application && getModelDescription(application)) && (
<div className="flex gap-4">
<span className="w-[122px] text-secondary">
{t('Description: ')}
</span>
<span className="max-w-[414px] text-primary">
{application?.description}
{getModelDescription(application)}
</span>
</div>
)}
Expand Down
Loading

0 comments on commit 5c89053

Please sign in to comment.