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, {
|
const topicJokesFeedback = withHumanFeedback(topicJokes, {
|
||||||
type: 'selectN',
|
type: 'selectN',
|
||||||
annotations: false,
|
annotations: false,
|
||||||
bail: false,
|
abort: false,
|
||||||
editing: true,
|
editing: true,
|
||||||
mechanism: HumanFeedbackMechanismCLI
|
mechanism: HumanFeedbackMechanismCLI
|
||||||
})
|
})
|
||||||
|
|
|
@ -23,7 +23,7 @@ async function main() {
|
||||||
const topicJokesFeedback = withHumanFeedback(topicJokes, {
|
const topicJokesFeedback = withHumanFeedback(topicJokes, {
|
||||||
type: 'selectN',
|
type: 'selectN',
|
||||||
annotations: false,
|
annotations: false,
|
||||||
bail: false,
|
abort: false,
|
||||||
editing: true,
|
editing: true,
|
||||||
mechanism: HumanFeedbackMechanismSlack
|
mechanism: HumanFeedbackMechanismSlack
|
||||||
})
|
})
|
||||||
|
|
|
@ -23,7 +23,7 @@ async function main() {
|
||||||
const topicJokesFeedback = withHumanFeedback(topicJokes, {
|
const topicJokesFeedback = withHumanFeedback(topicJokes, {
|
||||||
type: 'selectN',
|
type: 'selectN',
|
||||||
annotations: false,
|
annotations: false,
|
||||||
bail: false,
|
abort: false,
|
||||||
editing: true,
|
editing: true,
|
||||||
mechanism: HumanFeedbackMechanismTwilio
|
mechanism: HumanFeedbackMechanismTwilio
|
||||||
})
|
})
|
||||||
|
|
|
@ -263,10 +263,7 @@ export function withHumanFeedback<TInput, TOutput, V extends HumanFeedbackType>(
|
||||||
) {
|
) {
|
||||||
task = task.clone()
|
task = task.clone()
|
||||||
|
|
||||||
// Default options defined at the instance level
|
// Use Object.assign to merge the options, instance defaults, and hard-coded defaults:
|
||||||
const instanceDefaults = task.agentic.humanFeedbackDefaults
|
|
||||||
|
|
||||||
// Use Object.assign to merge the options, instance defaults, and hard-coded defaults
|
|
||||||
const finalOptions: HumanFeedbackOptions<V, TOutput> = Object.assign(
|
const finalOptions: HumanFeedbackOptions<V, TOutput> = Object.assign(
|
||||||
{
|
{
|
||||||
type: 'confirm',
|
type: 'confirm',
|
||||||
|
@ -275,8 +272,8 @@ export function withHumanFeedback<TInput, TOutput, V extends HumanFeedbackType>(
|
||||||
annotations: false,
|
annotations: false,
|
||||||
mechanism: HumanFeedbackMechanismCLI
|
mechanism: HumanFeedbackMechanismCLI
|
||||||
},
|
},
|
||||||
// Defaults from the instance:
|
// Default options from the instance:
|
||||||
instanceDefaults,
|
task.agentic.humanFeedbackDefaults,
|
||||||
// User-provided options (override instance defaults):
|
// User-provided options (override instance defaults):
|
||||||
options
|
options
|
||||||
)
|
)
|
||||||
|
|
Ładowanie…
Reference in New Issue