Best Practices
1.Enum:
- Try to use either
enum
s or options mentioned in descriptions as much as possible.
2. Function descriptions:
- Always include the function description within the function definition for consistency.
Parameters
-
Clear parameter definitions:
- Specify whether parameters like
max_length
refer to the number of characters, words, or sentences. This prevents ambiguity and ensures that users of the function have a clear understanding of how to use it effectively.
- Specify whether parameters like
-
Consistent default parameters:
- Ensure that default parameter values are consistent across different parts of the system. For example, if the default limit for retrieving news is 5, this should be reflected in all system prompts and documentation to avoid confusion.
In short, do not assume any default parameter, if you think something should have a default value, include it either in the system prompt or function field description or as
default
field in the parameter.
3. Pick a clear scenario:
-
The role of the user talking with the AI assistant must be clear. They could be an end-user (such as a guest renting a hotel room through the system), a manager, part of a staff of an establishment, etc. The functions that are included must take the role of the user into account: if the user is an end-user in a booking system, you MUST NOT include functions that perform operations that the user wouldn't reasonably be able to perform, like cancelling other user's bookings.
-
Consistent naming standards: Functions are commonly named with a verb and a noun, such as
get_reservations
,createUser
,get_compliance
,add task
, etc. This standard isn't mandatory, but should be followed if you don't have a good reason not to. You should also pick one "case" and stick with it: PascalCase, camelCase, snake_case, etc. in order to have a consistency for the system having the functionalities.