-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40 from statelyai/davidkpiano/correlation-id
Correlation ID
- Loading branch information
Showing
9 changed files
with
336 additions
and
195 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
'@statelyai/agent': minor | ||
--- | ||
|
||
Correlation IDs are now provided as part of the result from `agent.generateText(…)` and `agent.streamText(…)`: | ||
|
||
```ts | ||
const result = await agent.generateText({ | ||
prompt: 'Write me a song', | ||
correlationId: 'my-correlation-id', | ||
// ... | ||
}); | ||
|
||
result.correlationId; // 'my-correlation-id' | ||
``` | ||
|
||
These correlation IDs can be passed to feedback: | ||
|
||
```ts | ||
// ... | ||
|
||
agent.addFeedback({ | ||
reward: -1, | ||
correlationId: result.correlationId, | ||
}); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
'@statelyai/agent': minor | ||
--- | ||
|
||
Changes to agent feedback (the `AgentFeedback` interface): | ||
|
||
- `goal` is now optional | ||
- `observationId` is now optional | ||
- `correlationId` has been added (optional) | ||
- `reward` has been added (optional) | ||
- `attributes` are now optional |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.