diff --git a/packages/trace-viewer/src/ui/aiConversation.css b/packages/trace-viewer/src/ui/aiConversation.css index 0e136be8e6..8295f2f81a 100644 --- a/packages/trace-viewer/src/ui/aiConversation.css +++ b/packages/trace-viewer/src/ui/aiConversation.css @@ -1,4 +1,19 @@ -/* Main container */ +/** + * Copyright (c) Microsoft Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + .chat-container { flex: 1; display: flex; diff --git a/packages/trace-viewer/src/ui/aiConversation.tsx b/packages/trace-viewer/src/ui/aiConversation.tsx index 188c99b981..9fd0bc63c7 100644 --- a/packages/trace-viewer/src/ui/aiConversation.tsx +++ b/packages/trace-viewer/src/ui/aiConversation.tsx @@ -2,7 +2,7 @@ import { useCallback, useEffect, useState } from 'react'; import Markdown from 'react-markdown' import './aiConversation.css'; import { clsx } from '@web/uiUtils'; -import { Conversation, LLMMessage } from '@isomorphic/llm'; +import type { Conversation, LLMMessage } from './llm'; export function AIConversation({ history, conversation, firstPrompt }: { history: LLMMessage[], conversation: Conversation, firstPrompt?: LLMMessage }) { const [input, setInput] = useState(''); diff --git a/packages/trace-viewer/src/ui/llm.tsx b/packages/trace-viewer/src/ui/llm.tsx index 24f4d92b24..02bb7b7d04 100644 --- a/packages/trace-viewer/src/ui/llm.tsx +++ b/packages/trace-viewer/src/ui/llm.tsx @@ -108,7 +108,7 @@ class OpenAI implements LLM { 'x-pw-serviceworker': 'forward', }, body: JSON.stringify({ - model: 'gpt-4o', + model: 'gpt-4o', // TODO: make configurable messages: messages.map(({ role, content }) => ({ role, content })), stream: true, }), @@ -140,7 +140,7 @@ class Anthropic implements LLM { 'x-pw-serviceworker': 'forward', }, body: JSON.stringify({ - model: 'claude-3-5-sonnet-20241022', + model: 'claude-3-5-sonnet-20241022', // TODO: make configurable messages: messages.filter(({ role }) => role !== 'developer').map(({ role, content }) => ({ role, content })), system: messages.find(({ role }) => role === 'developer')?.content, max_tokens: 1024, @@ -173,7 +173,7 @@ class LLMChat { } } -class Conversation { +export class Conversation { history: LLMMessage[]; onChange = new EventEmitter();