Skip to content

How do you make function tool parameters optional? #921

Closed Answered by borghives
arbitropy asked this question in Q&A
Discussion options

You must be logged in to vote

if you are using Optional, you should have a default value.

Try this:

def get_employees_list(
    designation_title: Optional[str] = None,
    name: Optional[str] = None,
    email: Optional[str] = None,
    birth_date: Optional[str] = None,

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by arbitropy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants