File tree Expand file tree Collapse file tree 14 files changed +113
-37
lines changed
Expand file tree Collapse file tree 14 files changed +113
-37
lines changed Original file line number Diff line number Diff line change 1- #! /bin/sh
2- . " $( dirname " $0 " ) /_/husky.sh"
3-
41yarn commitlint --edit ${1}
Original file line number Diff line number Diff line change 1- #! /bin/sh
2- . " $( dirname " $0 " ) /_/husky.sh"
3-
41yarn
Original file line number Diff line number Diff line change 1- #! /bin/sh
2- . " $( dirname " $0 " ) /_/husky.sh"
3-
41git status
Original file line number Diff line number Diff line change 1- #! /bin/sh
2- . " $( dirname " $0 " ) /_/husky.sh"
3-
41yarn pre-commit
Original file line number Diff line number Diff line change 1- #! /bin/sh
2- . " $( dirname " $0 " ) /_/husky.sh"
3-
41yarn build
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ export enum AppDataTypes {
1515}
1616
1717export type ResponseData < T = UsefulnessNoveltyRatings > = {
18- response : string ;
18+ response : string | Array < string > ;
1919 round ?: number ;
2020 bot ?: boolean ;
2121 assistantId ?: AssistantId ;
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import { useAppDataContext } from '@/modules/context/AppDataContext';
1616import { useSettings } from '@/modules/context/SettingsContext' ;
1717import { useTranslation } from 'react-i18next' ;
1818import { useActivityContext } from '@/modules/context/ActivityContext' ;
19+ import { joinMultipleResponses } from './utils/responses' ;
1920
2021interface UseAssistantsValues {
2122 generateSingleResponse : ( ) => Promise < ChatbotResponseAppData | undefined > ;
@@ -152,8 +153,10 @@ const useAssistants = (): UseAssistantsValues => {
152153 set . data . assistant === persona . id && set . data . round === round - 1 ,
153154 ) ;
154155 if ( assistantSet ) {
155- const responses = assistantSet . data . responses . map (
156- ( r ) => allResponses . find ( ( { id } ) => r === id ) ?. data . response || '' ,
156+ const responses = assistantSet . data . responses . map ( ( r ) =>
157+ joinMultipleResponses (
158+ allResponses . find ( ( { id } ) => r === id ) ?. data . response || '' ,
159+ ) ,
157160 ) ;
158161 return promptAssistant (
159162 persona ,
Original file line number Diff line number Diff line change @@ -127,3 +127,7 @@ export const isOwnResponse = (
127127) : boolean =>
128128 response . creator ?. id === memberId &&
129129 typeof response . data ?. assistantId === 'undefined' ;
130+
131+ export const joinMultipleResponses = (
132+ response : string | Array < string > ,
133+ ) : string => ( typeof response === 'string' ? response : response . join ( '\n' ) ) ;
Original file line number Diff line number Diff line change 4848 },
4949 "RESPONSE_CARD" : {
5050 "BUILD_ON_THIS" : " Build on this" ,
51- "OWN" : " You wrote this"
51+ "OWN" : " You wrote this" ,
52+ "AI_GENERATED" : " AI generated" ,
53+ "PARENT_IDEA" : " Parent idea"
5254 },
5355 "SETTINGS" : {
5456 "TITLE" : " Settings" ,
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import {
1111} from '@/config/prompts' ;
1212import useAssistants from '@/hooks/useAssistants' ;
1313
14+ import { joinMultipleResponses } from '@/hooks/utils/responses' ;
1415import { useActivityContext } from '../context/ActivityContext' ;
1516import { useSettings } from '../context/SettingsContext' ;
1617
@@ -37,9 +38,12 @@ const Assistants: FC = () => {
3738 set . data . assistant === persona . id && set . data . round === round - 1 ,
3839 ) ;
3940 if ( assistantSet ) {
40- const responses = assistantSet . data . responses . map (
41- ( r ) => allResponses . find ( ( { id } ) => r === id ) ?. data . response || '' ,
42- ) ;
41+ const responses = assistantSet . data . responses
42+ . map (
43+ ( r ) =>
44+ allResponses . find ( ( { id } ) => r === id ) ?. data . response || '' ,
45+ )
46+ . map ( ( r ) => joinMultipleResponses ( r ) ) ;
4347 return promptAssistant (
4448 persona ,
4549 promptForSingleResponseAndProvideResponses (
You can’t perform that action at this time.
0 commit comments