()
| 2 | import chatWithDocsMemory from '../memory/chat-with-docs'; |
| 3 | |
| 4 | const buildPipe = (): PipeI => ({ |
| 5 | apiKey: process.env.LANGBASE_USER_API_KEY, // Replace with your API key https://langbase.com/docs/api-reference/api-keys |
| 6 | name: 'pipe-with-memory', |
| 7 | description: '', |
| 8 | status: 'private', |
| 9 | model: 'openai:gpt-4o-mini', |
| 10 | stream: true, |
| 11 | json: false, |
| 12 | store: true, |
| 13 | moderate: true, |
| 14 | top_p: 1, |
| 15 | max_tokens: 1000, |
| 16 | temperature: 0.7, |
| 17 | presence_penalty: 1, |
| 18 | frequency_penalty: 1, |
| 19 | stop: [], |
| 20 | tool_choice: 'auto', |
| 21 | parallel_tool_calls: false, |
| 22 | messages: [ |
| 23 | { role: 'system', content: `You are a helpful AI assistant.` }, |
| 24 | { role: 'system', name: 'rag', content: "Below is some CONTEXT for you to answer the questions. ONLY answer from the CONTEXT. CONTEXT consists of multiple information chunks. Each chunk has a source mentioned at the end.\n\nFor each piece of response you provide, cite the source in brackets like so: [1].\n\nAt the end of the answer, always list each source with its corresponding number and provide the document name. like so [1] Filename.doc.\n\nIf you don't know the answer, just say that you don't know. Ask for more context and better questions if needed." } |
| 25 | ], |
| 26 | variables: [], |
| 27 | memory: [chatWithDocsMemory()], |
| 28 | tools: [], |
| 29 | }); |
| 30 | |
| 31 | export default buildPipe; |
| 32 |
nothing calls this directly
no outgoing calls
no test coverage detected