Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
deekshas8 committed Feb 14, 2025
1 parent a1220a2 commit fd432e7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions packages/orchestration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ You can use the following convenience methods for handling chat completion respo

Setting `response_format` under `templating` guarantees that the model's output aligns with the schema type specified by developers.
It is useful when the model is not calling a tool, but rather, responding to the user in a structured way.
By setting `strict: true`, the model ensures that its outputs conform precisely to the provided schema.

The example below demonstrates how to use `response_format` to return a JSON Schema, with `strict: true` ensuring the outputs conform precisely to the schema.

```ts
templating: {
Expand Down Expand Up @@ -175,7 +176,7 @@ templating: {
}
```

In addition to using JSON schema objects, a Zod schema is also supported.
The `json_schema` can also be initialized directly using a Zod schema.

### Prompt Registry

Expand Down
4 changes: 2 additions & 2 deletions sample-code/src/orchestration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -534,10 +534,10 @@ export async function orchestrationResponseFormat(): Promise<TranslationResponse
}
});

const resonse = await orchestrationClient.chatCompletion({
const response = await orchestrationClient.chatCompletion({
inputParams: {
input: 'Hello World! Why is this phrase so famous?'
}
});
return JSON.parse(resonse.getContent()!) as TranslationResponse;
return JSON.parse(response.getContent()!) as TranslationResponse;
}

0 comments on commit fd432e7

Please sign in to comment.