Skip to content

Commit

Permalink
chore: prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
mikbry committed Mar 6, 2024
1 parent 88972f7 commit 0021e19
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
14 changes: 11 additions & 3 deletions webapp/components/views/Threads/Thread.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,8 @@ function Thread({
return;
}

const selectedModelNameOrId = getConversationModelId(selectedConversation, assistant) || activeModel;
const selectedModelNameOrId =
getConversationModelId(selectedConversation, assistant) || activeModel;
const result = await preProcessingCommands(
conversationId,
currentPrompt,
Expand Down Expand Up @@ -358,7 +359,13 @@ function Thread({

updatedConversations = clearPrompt(updatedConversation, updatedConversations);

logger.info('onSendMessage', modelName, selectedModelNameOrId, updatedMessages, updatedConversation);
logger.info(
'onSendMessage',
modelName,
selectedModelNameOrId,
updatedMessages,
updatedConversation,
);
message = await sendMessage(
message,
updatedMessages,
Expand All @@ -384,7 +391,8 @@ function Thread({
setErrorMessage({ ...errorMessage, [conversationId]: '' });
setIsProcessing({ ...isProcessing, [conversationId]: true });

const selectedModelNameOrId = getConversationModelId(selectedConversation, assistant) || activeModel;
const selectedModelNameOrId =
getConversationModelId(selectedConversation, assistant) || activeModel;

let message: Message = changeMessageContent(
previousMessage,
Expand Down
1 change: 0 additions & 1 deletion webapp/components/views/Threads/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import Thread from './Thread';
import Archive from './Archive';
import ToolbarTogglePanels from './ToolbarTogglePanels';


const getSelectedPage = (selectedThreadId: string | undefined, view: ViewName) =>
`${view === ViewName.Recent ? Page.Threads : Page.Archives}${selectedThreadId ? `/${selectedThreadId}` : ''}`;

Expand Down
7 changes: 5 additions & 2 deletions webapp/utils/data/conversations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,10 @@ export const getServiceProvider = (modelService: AIService | undefined) => {
return undefined;
};

export const getConversationModelId = (conversation: Conversation | undefined, assistant?: Assistant) => {
export const getConversationModelId = (
conversation: Conversation | undefined,
assistant?: Assistant,
) => {
if (!conversation) {
return undefined;
}
Expand All @@ -194,7 +197,7 @@ export const getConversationModelId = (conversation: Conversation | undefined, a
if (!modelId) {
const assistantService = getConversationService(conversation, AIServiceType.Assistant);
if (assistantService?.type === AIServiceType.Assistant) {
const { assistantId, targetId} = assistantService;
const { assistantId, targetId } = assistantService;
if (assistantId && assistantId === assistant?.id) {
const target = assistant.targets?.find((t) => t.id === targetId);
modelId = target?.models?.[0];
Expand Down
5 changes: 2 additions & 3 deletions webapp/utils/services/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export const getActiveService = (
providerName = provider.name;
}
} else if (activeService && activeService.type === AIServiceType.Assistant) {
const { assistantId, targetId } = activeService;
const { assistantId, targetId } = activeService;
if (assistantId && targetId) {
const target = assistant?.targets?.find((t) => t.id === targetId);
if (target?.models && target.models.length > 0) {
Expand All @@ -80,7 +80,6 @@ export const getActiveService = (
}
}


return { ...activeService, model, provider } as AIImplService;
};

Expand All @@ -91,4 +90,4 @@ export const getAssistantId = (conversation: Conversation | undefined): string |
if (service?.type === AIServiceType.Assistant) assistantId = service?.assistantId;
}
return assistantId;
}
};

0 comments on commit 0021e19

Please sign in to comment.