kopia lustrzana https://github.com/transitive-bullshit/chatgpt-api
chore: fix example code and simplify code
rodzic
07138c9ca7
commit
ff5a878cc9
|
@ -23,7 +23,7 @@ async function main() {
|
|||
const topicJokesFeedback = withHumanFeedback(topicJokes, {
|
||||
type: 'selectN',
|
||||
annotations: false,
|
||||
bail: false,
|
||||
abort: false,
|
||||
editing: true,
|
||||
mechanism: HumanFeedbackMechanismCLI
|
||||
})
|
||||
|
|
|
@ -23,7 +23,7 @@ async function main() {
|
|||
const topicJokesFeedback = withHumanFeedback(topicJokes, {
|
||||
type: 'selectN',
|
||||
annotations: false,
|
||||
bail: false,
|
||||
abort: false,
|
||||
editing: true,
|
||||
mechanism: HumanFeedbackMechanismSlack
|
||||
})
|
||||
|
|
|
@ -23,7 +23,7 @@ async function main() {
|
|||
const topicJokesFeedback = withHumanFeedback(topicJokes, {
|
||||
type: 'selectN',
|
||||
annotations: false,
|
||||
bail: false,
|
||||
abort: false,
|
||||
editing: true,
|
||||
mechanism: HumanFeedbackMechanismTwilio
|
||||
})
|
||||
|
|
|
@ -263,10 +263,7 @@ export function withHumanFeedback<TInput, TOutput, V extends HumanFeedbackType>(
|
|||
) {
|
||||
task = task.clone()
|
||||
|
||||
// Default options defined at the instance level
|
||||
const instanceDefaults = task.agentic.humanFeedbackDefaults
|
||||
|
||||
// Use Object.assign to merge the options, instance defaults, and hard-coded defaults
|
||||
// Use Object.assign to merge the options, instance defaults, and hard-coded defaults:
|
||||
const finalOptions: HumanFeedbackOptions<V, TOutput> = Object.assign(
|
||||
{
|
||||
type: 'confirm',
|
||||
|
@ -275,8 +272,8 @@ export function withHumanFeedback<TInput, TOutput, V extends HumanFeedbackType>(
|
|||
annotations: false,
|
||||
mechanism: HumanFeedbackMechanismCLI
|
||||
},
|
||||
// Defaults from the instance:
|
||||
instanceDefaults,
|
||||
// Default options from the instance:
|
||||
task.agentic.humanFeedbackDefaults,
|
||||
// User-provided options (override instance defaults):
|
||||
options
|
||||
)
|
||||
|
|
Ładowanie…
Reference in New Issue