examples/ernie-function-call-example/README.md
This example demonstrates how to use the ERNIE (Enhanced Representation through kNowledge IntEgration) language model with function calling capabilities using the LangChain Go library.
Initializes the ERNIE Model:
Defines a Weather Function:
getCurrentWeather function that simulates fetching weather data for a given location.Registers Function Definition:
Generates Content with Function Call:
getCurrentWeather function if needed.Handles the Response:
ak, sk, and accesstoken with your actual ERNIE API credentials.getCurrentWeather function.To run this example, ensure you have the necessary dependencies installed and your ERNIE API credentials set up. Then, execute the Go file to see the model's response and any potential function calls it makes.
This example provides a great starting point for developers looking to integrate ERNIE's language capabilities with custom function calling in their Go applications.