diff --git a/x-pack/plugins/search_playground/public/components/header.tsx b/x-pack/plugins/search_playground/public/components/header.tsx index bc468a0e4be87..d348da76b2387 100644 --- a/x-pack/plugins/search_playground/public/components/header.tsx +++ b/x-pack/plugins/search_playground/public/components/header.tsx @@ -56,7 +56,7 @@ export const Header: React.FC = ({ .euiFlexGroup': { flexWrap: 'wrap' }, - backgroundColor: euiTheme.colors.ghost, + backgroundColor: euiTheme.colors.emptyShade, }} paddingSize="s" data-test-subj="chat-playground-home-page" diff --git a/x-pack/plugins/search_playground/public/components/message_list/assistant_message.tsx b/x-pack/plugins/search_playground/public/components/message_list/assistant_message.tsx index 7e94059bdc272..7402c1b257bd1 100644 --- a/x-pack/plugins/search_playground/public/components/message_list/assistant_message.tsx +++ b/x-pack/plugins/search_playground/public/components/message_list/assistant_message.tsx @@ -49,6 +49,15 @@ export const AssistantMessage: React.FC = ({ message }) = const username = i18n.translate('xpack.searchPlayground.chat.message.assistant.username', { defaultMessage: 'AI', }); + const AIMessageWrapperCSS = css` + .euiAvatar { + background-color: ${euiTheme.colors.emptyShade}; + }, + .euiCommentEvent { + border: ${euiTheme.border.thin}; + border-radius: ${euiTheme.border.radius.medium}; + }, +`; return ( <> @@ -58,13 +67,7 @@ export const AssistantMessage: React.FC = ({ message }) = timelineAvatar="dot" data-test-subj="retrieval-docs-comment" eventColor="subdued" - css={{ - '.euiAvatar': { backgroundColor: euiTheme.colors.ghost }, - '.euiCommentEvent': { - border: euiTheme.border.thin, - borderRadius: euiTheme.border.radius.medium, - }, - }} + css={AIMessageWrapperCSS} event={ <> @@ -107,13 +110,7 @@ export const AssistantMessage: React.FC = ({ message }) = timelineAvatar="dot" data-test-subj="retrieval-docs-comment-no-docs" eventColor="subdued" - css={{ - '.euiAvatar': { backgroundColor: euiTheme.colors.ghost }, - '.euiCommentEvent': { - border: euiTheme.border.thin, - borderRadius: euiTheme.border.radius.medium, - }, - }} + css={AIMessageWrapperCSS} event={ <> @@ -163,9 +160,9 @@ export const AssistantMessage: React.FC = ({ message }) = }) } css={{ - '.euiAvatar': { backgroundColor: euiTheme.colors.ghost }, + '.euiAvatar': { backgroundColor: euiTheme.colors.emptyShade }, '.euiCommentEvent__body': { - backgroundColor: euiTheme.colors.ghost, + backgroundColor: euiTheme.colors.emptyShade, }, }} eventColor="subdued" diff --git a/x-pack/plugins/search_playground/public/components/message_list/system_message.tsx b/x-pack/plugins/search_playground/public/components/message_list/system_message.tsx index e973bea3c8a14..63a7c9f5595f4 100644 --- a/x-pack/plugins/search_playground/public/components/message_list/system_message.tsx +++ b/x-pack/plugins/search_playground/public/components/message_list/system_message.tsx @@ -32,7 +32,7 @@ export const SystemMessage: React.FC = ({ content }) => { timelineAvatar="dot" eventColor="subdued" css={{ - '.euiAvatar': { backgroundColor: euiTheme.colors.ghost }, + '.euiAvatar': { backgroundColor: euiTheme.colors.emptyShade }, '.euiCommentEvent': { border: euiTheme.border.thin, borderRadius: euiTheme.border.radius.medium, diff --git a/x-pack/plugins/search_playground/public/components/message_list/user_message.tsx b/x-pack/plugins/search_playground/public/components/message_list/user_message.tsx index 8c15ca1b6b69e..7680adce47b24 100644 --- a/x-pack/plugins/search_playground/public/components/message_list/user_message.tsx +++ b/x-pack/plugins/search_playground/public/components/message_list/user_message.tsx @@ -34,7 +34,7 @@ export const UserMessage: React.FC = ({ content, createdAt }) eventColor="subdued" css={{ '.euiCommentEvent__body': { - backgroundColor: euiTheme.colors.ghost, + backgroundColor: euiTheme.colors.emptyShade, }, }} username={i18n.translate('xpack.searchPlayground.chat.message.user.name', { diff --git a/x-pack/plugins/search_playground/public/components/view_code/examples/__snapshots__/py_lang_client.test.tsx.snap b/x-pack/plugins/search_playground/public/components/view_code/examples/__snapshots__/py_lang_client.test.tsx.snap index e0815458898ce..0001f45600ec2 100644 --- a/x-pack/plugins/search_playground/public/components/view_code/examples/__snapshots__/py_lang_client.test.tsx.snap +++ b/x-pack/plugins/search_playground/public/components/view_code/examples/__snapshots__/py_lang_client.test.tsx.snap @@ -28,7 +28,7 @@ index_source_fields = { ] } -def get_elasticsearch_results(query): +def get_elasticsearch_results(): es_query = { \\"query\\": {}, \\"size\\": 10 @@ -82,7 +82,7 @@ def generate_openai_completion(user_prompt, question): if __name__ == \\"__main__\\": question = \\"my question\\" - elasticsearch_results = get_elasticsearch_results(question) + elasticsearch_results = get_elasticsearch_results() context_prompt = create_openai_prompt(elasticsearch_results) openai_completion = generate_openai_completion(context_prompt, question) print(openai_completion) diff --git a/x-pack/plugins/search_playground/public/components/view_code/examples/py_lang_client.tsx b/x-pack/plugins/search_playground/public/components/view_code/examples/py_lang_client.tsx index 582606a4f6b14..a2d92583c6b63 100644 --- a/x-pack/plugins/search_playground/public/components/view_code/examples/py_lang_client.tsx +++ b/x-pack/plugins/search_playground/public/components/view_code/examples/py_lang_client.tsx @@ -28,7 +28,7 @@ openai_client = OpenAI( index_source_fields = ${JSON.stringify(formValues.source_fields, null, 4)} -def get_elasticsearch_results(query): +def get_elasticsearch_results(): es_query = ${getESQuery({ ...formValues.elasticsearch_query, size: formValues.doc_size, @@ -71,7 +71,7 @@ def generate_openai_completion(user_prompt, question): if __name__ == "__main__": question = "my question" - elasticsearch_results = get_elasticsearch_results(question) + elasticsearch_results = get_elasticsearch_results() context_prompt = create_openai_prompt(elasticsearch_results) openai_completion = generate_openai_completion(context_prompt, question) print(openai_completion)