mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-09-09 22:31:10 +00:00
added test for openai responses
This commit is contained in:
parent
863ba5581e
commit
af10f175d4
1 changed files with 21 additions and 0 deletions
21
packages/tools/test/openai-responses-test.ts
Normal file
21
packages/tools/test/openai-responses-test.ts
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
import { OpenAI } from "openai"
|
||||
import { withSupermemory } from "../src/openai"
|
||||
|
||||
const openai = new OpenAI({
|
||||
apiKey: process.env.OPENAI_API_KEY,
|
||||
})
|
||||
|
||||
const openaiWithSupermemory = withSupermemory(openai, "user_id_life", {
|
||||
verbose: true,
|
||||
mode: "full",
|
||||
addMemory: "always",
|
||||
})
|
||||
|
||||
const response = await openaiWithSupermemory.responses.create({
|
||||
model: "gpt-4o",
|
||||
instructions: "you are ai girlfriend",
|
||||
input: "Where do i live?",
|
||||
})
|
||||
|
||||
console.log("Response output:", JSON.stringify(response.output[0], null, 2))
|
||||
console.log("Usage:", response.usage)
|
||||
Loading…
Add table
Reference in a new issue