Skip to content

CBIIT/nci-webtools-ctri-research-optimizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Research Optimizer

API Usage Examples

model/run

const endpoint = "http://localhost:8080/api/model/run";
const model = "anthropic.claude-3-5-sonnet-20240620-v1:0";
const messages = [
  {
    role: "user",
    content: [{ text: "Please provide the answer to everything." }],
  },
];
// you may also pass in a string to the 'messages' parameter
// const messages = "Please provide the answer to everything."

const response = await fetch(endpoint, {
  method: "post",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({ model, messages }),
});
const results = await response.json();
console.log(results, results.output.message);

You can also make GET requests directly in your browser. http://localhost:8080/api/model/run?messages=Return+42

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published