Skip to content

Commit

Permalink
add soccerFunction
Browse files Browse the repository at this point in the history
  • Loading branch information
danielruss committed Jan 5, 2024
1 parent 830fa2f commit a745b39
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 248 deletions.
53 changes: 2 additions & 51 deletions daniel/index.html
Original file line number Diff line number Diff line change
@@ -1,56 +1,7 @@
<!DOCTYPE html>
<html>

<head>
<script src="index.js" type="module"></script>
<style>
#readyindicator.ready {
color: green;
}

#readyindicator {
color: red;
}

table {
font-family: Arial, Helvetica, sans-serif;
font-size: x-small;
background-color: white;
}

tr:nth-child(even) {
background-color: lightgray;
}

dd {
font-family: 'Courier New', Courier, monospace;
}

dt {
font-family: Arial, Helvetica, sans-serif;
}

.GPT-error {
font-size: large;
color: red;
margin: 2px;
padding: 3px;
border: thin solid red;
}
</style>
</head>

<body>
<div id="readyindicator">&#x2B24;</div>
<hr>
<h2>Asking a very simple question with a small context.</h2>
<p> To keep the data VERY small, lets look at ONLY Aggravated Assualts with guns since Feb 01, 2023</p>
<table id="tbl1"></table>
<div id="GPTDiv_1"></div>
<hr>
<h2>Let's increase the context size</h2>
<table id="tbl2"></table>
<div id="GPTDiv_2"></div>
</body>
<script src="soccerFunction.mjs" type="module"></script>
</head>

</html>
197 changes: 0 additions & 197 deletions daniel/index.js

This file was deleted.

35 changes: 35 additions & 0 deletions daniel/soccerFunction.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@

const soccer = {
"name": "nci_soccer_v2",
"description": "Occupational coding",
"parameters": {
"type": "object",
"properties": {
"title": {
"type": "string",
"description": "What is your Job Title"
},
"task": {
"type": "string",
"description":"What do you do at work"
},
}
}
};
async function soccerFunction(params){
params.n=1
params.title=params.title||''
params.task=params.task||''
console.log('params:',params)

//genome=hg38&chrom=1&start=100000&end=100100
let function_params = new URLSearchParams(params)
let url = 'https://soccer-myconnect.cancer.gov/soccer/code?'+function_params.toString()

let res = await (await fetch(url)).json()
return `SOCcer thinks the best code is ${res[0].code} ${res[0].label} with a score of ${res[0].score}`
//return JSON.stringify(res)
//debugger
}

window.soccerFunction=soccerFunction

0 comments on commit a745b39

Please sign in to comment.