I'm a graduate student conducting research related to LLM in Korea. I was struggling with how to use the Claude API, but thanks to this video, I was able to resolve it easily. Thank you very much for creating this video.
How would you structure the code if you have too many functions in your app? Similar to chain of command, can the AI first determine the category for what the user wants to do and only send a select list of functions’ jsons to Anthropic. For example, if the user wants to update the user table’s records, agent should only know functions that can update the user records in the table, and there’s no need to send the appointment booking functions’ jsons, until user wants to make an appointment.
Great question! You're on the right track with your thinking. Here's how you could approach this: 1. Code structure: Consider using a modular approach, organizing functions into separate modules or classes based on their purpose (e.g., UserManagement, AppointmentBooking). 2. Categorizing functions: Create a mapping of categories to function sets. For example: ```python function_categories = { "user_management": [update_user, delete_user, ...], "appointment_booking": [book_appointment, cancel_appointment, ...] } ``` 3. Selective function provision: Implement a pre-processing step where you determine the user's intent (you could use a simple keyword matching or a more advanced NLP approach). Then, only send the relevant function set to the AI: ```python def get_relevant_functions(user_input): category = determine_intent(user_input) return function_categories.get(category, []) relevant_functions = get_relevant_functions(user_input) ai_response = call_anthropic_api(user_input, relevant_functions) ``` That's one idea I'd probably try. At the end of the day, it's just similar to converting a really large decision set into something like a tree instead, so each "step" has less breadth (which makes it easier to pick the right thing).
Great question! You're on the right track with your thinking. Here's how you could approach this: Code structure: Consider using a modular approach, organizing functions into separate modules or classes based on their purpose (e.g., UserManagement, AppointmentBooking). Categorizing functions: Create a mapping of categories to function sets. For example: function_categories = { "user_management": [update_user, delete_user, ...], "appointment_booking": [book_appointment, cancel_appointment, ...] } Selective function provision: Implement a pre-processing step where you determine the user's intent (you could use a simple keyword matching or a more advanced NLP approach). Then, only send the relevant function set to the AI: def get_relevant_functions(user_input): category = determine_intent(user_input) return function_categories.get(category, []) relevant_functions = get_relevant_functions(user_input) ai_response = call_anthropic_api(user_input, relevant_functions) That's one idea I'd probably try. At the end of the day, it's just similar to converting a really large decision set into something like a tree instead, so each "step" has less breadth (which makes it easier to pick the right thing).
I do wish Claude did offer image generation. But again not everyone will need that for their use-cases. The Sonnet model might just be better at a certain set of use-cases for some developers (e.g. writing code, or image analysis). Also, for API use-cases, you need to compare the $/per token pricing. GPT 4o is US$5.00/1M, and Sonnet 3.5 is US$3.00/1M. However, I saw GPT 4o-mini just came out recently as well, priced ridiculously low at US$0.15/1M.
I'm a graduate student conducting research related to LLM in Korea. I was struggling with how to use the Claude API, but thanks to this video, I was able to resolve it easily. Thank you very much for creating this video.
So glad to hear that! :D Good luck with your research.
Beautifully clear and precise! THANKS
Glad you enjoyed it!
Great content, thanks!
Don't give up on posting brother. Your videos are great and I think you really have a talent for explanations. Please keep pushing forward!!
very good - bravo
nice job
Thanks! Glad you enjoyed it!
How would you structure the code if you have too many functions in your app? Similar to chain of command, can the AI first determine the category for what the user wants to do and only send a select list of functions’ jsons to Anthropic. For example, if the user wants to update the user table’s records, agent should only know functions that can update the user records in the table, and there’s no need to send the appointment booking functions’ jsons, until user wants to make an appointment.
Great question! You're on the right track with your thinking. Here's how you could approach this:
1. Code structure: Consider using a modular approach, organizing functions into separate modules or classes based on their purpose (e.g., UserManagement, AppointmentBooking).
2. Categorizing functions: Create a mapping of categories to function sets. For example:
```python
function_categories = {
"user_management": [update_user, delete_user, ...],
"appointment_booking": [book_appointment, cancel_appointment, ...]
}
```
3. Selective function provision: Implement a pre-processing step where you determine the user's intent (you could use a simple keyword matching or a more advanced NLP approach). Then, only send the relevant function set to the AI:
```python
def get_relevant_functions(user_input):
category = determine_intent(user_input)
return function_categories.get(category, [])
relevant_functions = get_relevant_functions(user_input)
ai_response = call_anthropic_api(user_input, relevant_functions)
```
That's one idea I'd probably try. At the end of the day, it's just similar to converting a really large decision set into something like a tree instead, so each "step" has less breadth (which makes it easier to pick the right thing).
Great question! You're on the right track with your thinking. Here's how you could approach this:
Code structure: Consider using a modular approach, organizing functions into separate modules or classes based on their purpose (e.g., UserManagement, AppointmentBooking).
Categorizing functions: Create a mapping of categories to function sets. For example:
function_categories = {
"user_management": [update_user, delete_user, ...],
"appointment_booking": [book_appointment, cancel_appointment, ...]
}
Selective function provision: Implement a pre-processing step where you determine the user's intent (you could use a simple keyword matching or a more advanced NLP approach). Then, only send the relevant function set to the AI:
def get_relevant_functions(user_input):
category = determine_intent(user_input)
return function_categories.get(category, [])
relevant_functions = get_relevant_functions(user_input)
ai_response = call_anthropic_api(user_input, relevant_functions)
That's one idea I'd probably try. At the end of the day, it's just similar to converting a really large decision set into something like a tree instead, so each "step" has less breadth (which makes it easier to pick the right thing).
@ Thank you. Ended up going with an agentic workflow. A function calling model sets the function_type (as a variable)
Hey!!, Great video, I am a beginner, Please provide step by step video tutorial.
thanks
What's the name of this guy?
Hi pixegami please help on testing career from 🇮🇳
As long as Claude doesn’t have the ability to create images, cannot compete with chatGPT… unless drop the prices to 10$/per month…
Man, not everybody needs generating images...
I do wish Claude did offer image generation. But again not everyone will need that for their use-cases. The Sonnet model might just be better at a certain set of use-cases for some developers (e.g. writing code, or image analysis).
Also, for API use-cases, you need to compare the $/per token pricing. GPT 4o is US$5.00/1M, and Sonnet 3.5 is US$3.00/1M.
However, I saw GPT 4o-mini just came out recently as well, priced ridiculously low at US$0.15/1M.
Claude is better at coding in my opinion.