Skip to content

Latest commit

 

History

History
81 lines (59 loc) · 1.84 KB

README.md

File metadata and controls

81 lines (59 loc) · 1.84 KB

Semantic Scholar API for Delphi

This API provides access to the Semantic Scholar database of papers and citations for Delphi.

Implemented

  • 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

Example

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

Functions

author

Get the author by ID.

Parameter Type Description
id string Author ID

paper

Get the paper by ID.

Parameter Type Description
id string Paper ID

search

Search for papers.

Parameter Type Description
query string Search term

See Also