Semantic Scholar API for Delphi
This API provides access to the Semantic Scholar database of papers and citations for Delphi.
- get_paper (single paper)
- get_papers (multiple papers at once)
- getPaperAuthors
- getPaperCitations
- getPaperReferences
- search_paper (search by query)
- get_author
- get_authors
- get_author_papers
- search_author (search by query)
- get_recommended_papers
- get_recommended_papers_from_lists
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 author by ID.
Parameter | Type | Description |
---|---|---|
id |
string |
Author ID |
Get the paper by ID.
Parameter | Type | Description |
---|---|---|
id |
string |
Paper ID |
Search for papers.
Parameter | Type | Description |
---|---|---|
query |
string |
Search term |