import { InMemoryWorkspace } from '../../agent-utils/index.js';
import { Chat, OpenAIEmbeddingAPI, AgentContext } from '../../agent-core/index.js';
import { ScriptWriter } from './ScriptWriter.js';
export const createScriptWriter = (context) => {
    const workspace = new InMemoryWorkspace();
    const chat = new Chat(context.chat.tokenizer);
    const embedding = new OpenAIEmbeddingAPI(context.env?.OPENAI_API_KEY || '', context.logger, context.chat.tokenizer, context.env.OPENAI_API_BASE_URL);
    return new ScriptWriter(new AgentContext(context.llm, embedding, chat, context.logger, workspace, context.internals, context.env));
};
