Skip to content

Commit

Permalink
remove duplicate functions
Browse files Browse the repository at this point in the history
  • Loading branch information
miku448 committed Feb 28, 2025
1 parent 921d1af commit cbdadd2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 59 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1293,64 +1293,6 @@ export class FunctionRegistry {
subject: 'an item',
},
},
{
name: 'create_objective',
description: 'Create a new objective for the novel.',
parameters: {
type: 'object',
properties: {
name: { type: 'string', description: 'Name of the objective' },
description: { type: 'string', description: 'Short description of the objective' },
hint: { type: 'string', description: 'Hint for the player about this objective' },
condition: { type: 'string', description: 'Condition prompt that triggers the objective' },
},
required: ['name'],
},
handler: (args) => novelManager.createObjective(args),
displayData: {
isSetter: true,
action: 'created',
subject: 'an objective',
},
},
{
name: 'update_objective',
description: 'Update an existing objective in the novel.',
parameters: {
type: 'object',
properties: {
objectiveId: { type: 'string', description: 'ID of the objective to update' },
name: { type: 'string', description: 'Name of the objective' },
description: { type: 'string', description: 'Short description' },
hint: { type: 'string', description: 'Hint for the player' },
condition: { type: 'string', description: 'Condition prompt that triggers the objective' },
},
required: ['objectiveId'],
},
handler: (args) => novelManager.updateObjective(args),
displayData: {
isSetter: true,
action: 'updated',
subject: 'an objective',
},
},
{
name: 'remove_objective',
description: 'Remove an objective from the novel.',
parameters: {
type: 'object',
properties: {
objectiveId: { type: 'string', description: 'ID of the objective to remove' },
},
required: ['objectiveId'],
},
handler: (args) => novelManager.removeObjective(args.objectiveId),
displayData: {
isSetter: true,
action: 'removed',
subject: 'an objective',
},
},
{
name: 'create_map',
description: 'Create a new map for the novel.',
Expand Down
9 changes: 8 additions & 1 deletion apps/novel-builder/src/libs/assistantCall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,14 @@ export const callChatCompletion = async (
SERVICES_ENDPOINT + '/assistant',
{
messages,
tools,
tools: tools.map((tool) => ({
type: 'function',
function: {
name: tool.function.name,
description: tool.function.description,
parameters: tool.function.parameters,
},
})),
parallel_tool_calls,
tool_choice,
},
Expand Down

0 comments on commit cbdadd2

Please sign in to comment.