Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Major Assistant & Tool Constructor Changes & Deployment Options v1.2 #13

Merged
merged 2 commits into from
Jun 5, 2024

Conversation

metaskills
Copy link
Owner

Lots of small quality of life changes ( like find by id 404s ) are happening with the Assistant's API. A release out of beta feels like it is coming soon. Time to make some big changes, a huge one is the way our constructor works. When this API was beta, an assistant required a name, description, and instructions. Both Assistants & Tools have removed their (name, description, instructions) ordinal parameters in favor a single options object. Now, the constructor signature is:

// Using Assistant.create() factory.
// 
assistant = new Assistant.craete({
  name: "My Assistant",
  instructions: "My Assistant Instructions",
  ...
});

// Or using ES6 Classes.
//
class MyAssistant extends Assistant {
  constructor() {
    super({
      name: "My Assistant",
      instructions: "My Assistant Instructions",
    });
  }
})

Now that names are no longer unique. The question of how to treat deployments has come up. Document how to use the id parameter to ensure a single assistant is used for a deployment no matter how much horizontal scaling is happing. Otherwise, spinning up new cloud resources such as Lambda instances or K8s pods would result in creating a new assistant for each process. We also support a new skipUpdate option that allows for remote configurations to be applied to new running instances. Thus allowing for new resources to leverage the remote configurations, such as model and instructions. Great for zero deployment changes. For example:

class MyAssistant extends Assistant {
  constructor() {
    super({
      // ...
      id: process.env.MY_ASSISTANT_ID,
      skipUpdate: process.env.SKIP_UPDATE
    });
  }
}

@metaskills metaskills merged commit 8421acb into main Jun 5, 2024
1 check passed
@metaskills metaskills deleted the RequiredProps branch June 22, 2024 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant