Short Sleeve Plaid Shirt",        'url': 'https://www.klarna.com/us/shopping/pl/cl10001/3201826024/Clothing/Carhartt-Men-s-Loose-Fit-Midweight-Short-Sleeve-Plaid-Shirt/?utm_source=openai&ref-site=openai_plugin',        'price': '$17.99',        'attributes': ['Material:Cotton',         'Target Group:Man',         'Color:Red,Brown,Blue,Green',         'Properties:Pockets',         'Pattern:Checkered',         'Size (Small-Large):S,XL,L,M']}]}}Functions‚ÄãWe can unpack what is happening when we use the functions to call external APIs.Let's look at the LangSmith trace:See here that we call the OpenAI LLM with the provided API spec:https://www.klarna.com/us/shopping/public/openai/v0/api-docs/The prompt then tells the LLM to use the API spec with input question:Use the provided APIs to respond to this user query:What are some options for a men's large blue button down shirtThe LLM returns the parameters for the function call productsUsingGET, which is specified in the provided API spec:function_call:  name: productsUsingGET  arguments: |-    {      "params": {        "countryCode": "US",        "q": "men's large blue button down shirt",        "size": 5,        "min_price": 0,        "max_price": 100      }    }This Dict above split and the API is called here.API Chain‚ÄãWe can also build our own interface to external APIs using the APIChain and provided API documentation.from langchain.llms import OpenAIfrom langchain.chains import APIChainfrom langchain.chains.api import open_meteo_docsllm = OpenAI(temperature=0)chain = APIChain.from_llm_and_api_docs(llm, open_meteo_docs.OPEN_METEO_DOCS, verbose=True)chain.run('What is the weather like right now in Munich, Germany in degrees Fahrenheit?')            > Entering new APIChain chain...    https://api.open-meteo.com/v1/forecast?latitude=48.1351&longitude=11.5820&hourly=temperature_2m&temperature_unit=fahrenheit&current_weather=true
Open In Colab
Open In Colab ->: Short Sleeve Plaid Shirt",        'url': 'https://www.klarna.com/us/shopping/pl/cl10001/3201826024/Clothing/Carhartt-Men-s-Loose-Fit-Midweight-Short-Sleeve-Plaid-Shirt/?utm_source=openai&ref-site=openai_plugin',        'price': '$17.99',        'attributes': ['Material:Cotton',         'Target Group:Man',         'Color:Red,Brown,Blue,Green',         'Properties:Pockets',         'Pattern:Checkered',         'Size (Small-Large):S,XL,L,M']}]}}Functions‚ÄãWe can unpack what is happening when we use the functions to call external APIs.Let's look at the LangSmith trace:See here that we call the OpenAI LLM with the provided API spec:https://www.klarna.com/us/shopping/public/openai/v0/api-docs/The prompt then tells the LLM to use the API spec with input question:Use the provided APIs to respond to this user query:What are some options for a men's large blue button down shirtThe LLM returns the parameters for the function call productsUsingGET, which is specified in the provided API spec:function_call:  name: productsUsingGET  arguments: |-    {      "params": {        "countryCode": "US",        "q": "men's large blue button down shirt",        "size": 5,        "min_price": 0,        "max_price": 100      }    }This Dict above split and the API is called here.API Chain‚ÄãWe can also build our own interface to external APIs using the APIChain and provided API documentation.from langchain.llms import OpenAIfrom langchain.chains import APIChainfrom langchain.chains.api import open_meteo_docsllm = OpenAI(temperature=0)chain = APIChain.from_llm_and_api_docs(llm, open_meteo_docs.OPEN_METEO_DOCS, verbose=True)chain.run('What is the weather like right now in Munich, Germany in degrees Fahrenheit?')            > Entering new APIChain chain...    https://api.open-meteo.com/v1/forecast?latitude=48.1351&longitude=11.5820&hourly=temperature_2m&temperature_unit=fahrenheit&current_weather=true