deepset-ai / haystack-tutorials

Here you can find all the Tutorials for Haystack 📓
https://haystack.deepset.ai/tutorials
Apache License 2.0
227 stars 80 forks source link

Add a tutorial with OpenAI function calling #301

Closed bilgeyucel closed 4 months ago

review-notebook-app[bot] commented 4 months ago

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

bilgeyucel commented 4 months ago

@vblagoje, I’d appreciate it if you could provide your feedback in terms of technical terms and the use case

vblagoje commented 4 months ago

Looks good overall @bilgeyucel There are small areas for improvement as Stefano would say! As there is a lot of code here perhaps see where and how you can minimize the amount of code without sacrificing clarity. For example,

messages = []
messages.append(
    ChatMessage.from_system(
        "Don't make assumptions about what values to plug into functions. Ask for clarification if a user request is ambiguous."
    )
)
messages.append(ChatMessage.from_user("Can you tell me where Mark lives?"))

can be instead:

messages = [ChatMessage.from_system("Don't make assumptions about what values to plug into functions. Ask for clarification if a user request is ambiguous."),
                     ChatMessage.from_user("Can you tell me where Mark lives?")]

Stuff like that....