mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 11:43:54 +00:00
(test) large request
This commit is contained in:
parent
c7e4432597
commit
7aa1c8556d
1 changed files with 9 additions and 5 deletions
|
@ -4,25 +4,29 @@ const openai = require('openai');
|
|||
process.env.DEBUG=false;
|
||||
async function runOpenAI() {
|
||||
const client = new openai.OpenAI({
|
||||
apiKey: 'sk-JkKeNi6WpWDngBsghJ6B9g',
|
||||
baseURL: 'http://0.0.0.0:8000'
|
||||
apiKey: 'sk-1234',
|
||||
baseURL: 'http://0.0.0.0:4000'
|
||||
});
|
||||
|
||||
|
||||
|
||||
try {
|
||||
const response = await client.chat.completions.create({
|
||||
model: 'sagemaker',
|
||||
model: 'anthropic-claude-v2.1',
|
||||
stream: true,
|
||||
max_tokens: 1000,
|
||||
messages: [
|
||||
{
|
||||
role: 'user',
|
||||
content: 'write a 20 pg essay about YC ',
|
||||
content: 'write a 20 pg essay about YC '.repeat(6000),
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
console.log(response);
|
||||
let original = '';
|
||||
for await (const chunk of response) {
|
||||
original += chunk.choices[0].delta.content;
|
||||
console.log(original);
|
||||
console.log(chunk);
|
||||
console.log(chunk.choices[0].delta.content);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue