Wikipedia API for Delphi
This API provides access to Wikipedia data for Delphi.
import {
Agent,
type ChatMessage,
type ClientOptions,
Context,
} from "@wecandobetter/delphi";
import { addToMap } from "./index";
async function fn(messages: ChatMessage[], options: ClientOptions) {
// Call the model here and return the result
}
// Create an agent
const agent = new Agent("my-agent", fn, {
client: { model: "gpt-4-1106-preview" },
});
// Create a context
const context = new Context();
// Add the functions to the contex's function map anbd enable them
addToMap(context.functions, true);
// Now the agent can use the functions in the context
Get the categories for a Wikipedia page.
Parameter | Type | Description |
---|---|---|
title |
string |
Page title |
Get the content for a Wikipedia page.
Parameter | Type | Description |
---|---|---|
title |
string |
Page title |
Get the coordinates for a Wikipedia page.
Parameter | Type | Description |
---|---|---|
title |
string |
Page title |
Get the infobox for a Wikipedia page.
Parameter | Type | Description |
---|---|---|
title |
string |
Page title |
Get the introduction for a Wikipedia page.
Parameter | Type | Description |
---|---|---|
title |
string |
Page title |
Get the links for a Wikipedia page.
Parameter | Type | Description |
---|---|---|
title |
string |
Page title |
Get the mobile HTML for a Wikipedia page.
Parameter | Type | Description |
---|---|---|
title |
string |
Page title |
Get the references for a Wikipedia page.
Parameter | Type | Description |
---|---|---|
title |
string |
Page title |
Get the related pages for a Wikipedia page.
Parameter | Type | Description |
---|---|---|
title |
string |
Page title |
Search Wikipedia for pages matching a query.
Parameter | Type | Description |
---|---|---|
query |
string |
Query |
Get the tables for a Wikipedia page.
Parameter | Type | Description |
---|---|---|
title |
string |
Page title |