Skip to content

Commit

Permalink
Merge pull request #12 from mmikita95/patch-1
Browse files Browse the repository at this point in the history
Update README.md
  • Loading branch information
ramedina86 authored Jun 28, 2024
2 parents 8e16987 + af0d4e9 commit 2d76893
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const writer = new Writer({
async function main() {
const chat = await writer.chat.chat({
messages: [{ content: 'string', role: 'user' }],
model: 'palmyra-x-32k',
model: 'palmyra-x-002-32k',
});

console.log(chat.id);
Expand All @@ -48,12 +48,12 @@ import Writer from 'writer-sdk';
const writer = new Writer();

const stream = await writer.completions.create({
model: 'palmyra-x-32k',
model: 'palmyra-x-002-instruct',
prompt: 'Hi, my name is',
stream: true,
});
for await (const streamingData of stream) {
console.log(streamingData.choices);
console.log(streamingData.value);
}
```

Expand All @@ -75,7 +75,7 @@ const writer = new Writer({
async function main() {
const params: Writer.ChatChatParams = {
messages: [{ content: 'string', role: 'user' }],
model: 'palmyra-x-32k',
model: 'palmyra-x-002-32k',
};
const chat: Writer.Chat = await writer.chat.chat(params);
}
Expand Down Expand Up @@ -139,7 +139,7 @@ const writer = new Writer({
});

// Or, configure per-request:
await writer.chat.chat({ messages: [{ content: 'string', role: 'user' }], model: 'palmyra-x-32k' }, {
await writer.chat.chat({ messages: [{ content: 'string', role: 'user' }], model: 'palmyra-x-002-32k' }, {
maxRetries: 5,
});
```
Expand All @@ -156,7 +156,7 @@ const writer = new Writer({
});

// Override per-request:
await writer.chat.chat({ messages: [{ content: 'string', role: 'user' }], model: 'palmyra-x-32k' }, {
await writer.chat.chat({ messages: [{ content: 'string', role: 'user' }], model: 'palmyra-x-002-32k' }, {
timeout: 5 * 1000,
});
```
Expand All @@ -178,13 +178,13 @@ You can also use the `.withResponse()` method to get the raw `Response` along wi
const writer = new Writer();

const response = await writer.chat
.chat({ messages: [{ content: 'string', role: 'user' }], model: 'palmyra-x-32k' })
.chat({ messages: [{ content: 'string', role: 'user' }], model: 'palmyra-x-002-32k' })
.asResponse();
console.log(response.headers.get('X-My-Header'));
console.log(response.statusText); // access the underlying Response object

const { data: chat, response: raw } = await writer.chat
.chat({ messages: [{ content: 'string', role: 'user' }], model: 'palmyra-x-32k' })
.chat({ messages: [{ content: 'string', role: 'user' }], model: 'palmyra-x-002-32k' })
.withResponse();
console.log(raw.headers.get('X-My-Header'));
console.log(chat.id);
Expand Down Expand Up @@ -292,7 +292,7 @@ const writer = new Writer({

// Override per-request:
await writer.chat.chat(
{ messages: [{ content: 'string', role: 'user' }], model: 'palmyra-x-32k' },
{ messages: [{ content: 'string', role: 'user' }], model: 'palmyra-x-002-32k' },
{
httpAgent: new http.Agent({ keepAlive: false }),
},
Expand Down

0 comments on commit 2d76893

Please sign in to comment.