Skip to main content

Introduction

This tutorial walks you through creating an Agent using LangChain and Model APIs.

Setup

Get your Personal API Key to use Friendli Model APIs.

Instantiation

Create Agent with LangChain

Step 1. Create Tool

Step 2. Create Prompt

Step 3. Create Agent

Step 4. Run the Agent

When you run the code, it will wait for your input. After inputting, it will wait and output the result. When you ask a question about a specific Wikipedia topic, it will automatically call the Wikipedia tool and output the result.
final result

Full Example Code

Last modified on June 24, 2026