Skip to content

Conversation

@laoshancun
Copy link

@laoshancun laoshancun commented Feb 18, 2025

There are 2 api change.

  • cache context create
POST http://oneapi/v1/context/create
Authorization: Bearer token
Content-Type: application/json
 
{ 
    "model":"doubao-pro-32k", 
    "messages":[ 
        {"role":"system","content":"long prompt need to cache"}
     ], 
     "ttl":86400, 
     "mode": "common_prefix"
}
  • use cache context
POST http://oneapi/v1/chat/completions
Authorization: Bearer token
Content-Type: application/json
 
{
    "context_id": "ctx-20250218162710-6jwbk", // context_id from context create api result
    "model": "doubao-pro-32k",
    "messages":[ 
       {"role":"user","content":"hello!"}
     ]
}

see also:https://www.volcengine.com/docs/82379/1396490

@laoshancun laoshancun changed the title feat: add prefix create support for volcengine feat: add prefix cache support for volcengine Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant