-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
374 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"from tuneapi import tu, tt, ta\n", | ||
"from dataclasses import dataclass\n", | ||
"from pydantic import BaseModel\n", | ||
"from typing import List, Optional, Dict, Any" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 2, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"class MedicalRecord(BaseModel):\n", | ||
" date: str\n", | ||
" diagnosis: str\n", | ||
" treatment: str\n", | ||
"\n", | ||
"class Dog(BaseModel):\n", | ||
" name: str\n", | ||
" breed: str\n", | ||
" records: Optional[List[MedicalRecord]] = None\n", | ||
"\n", | ||
"class Dogs(BaseModel):\n", | ||
" dogs: List[Dog]\n" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 6, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"Dog: Buddy, Breed: Golden Retriever\n", | ||
" Date: 2023-10-26, Diagnosis: Mild ear infection, Treatment: Ear drops\n", | ||
"\n", | ||
"Dog: Luna, Breed: Beagle\n", | ||
" Date: 2023-10-25, Diagnosis: Routine check-up, Treatment: No treatment needed\n", | ||
" Date: 2023-10-28, Diagnosis: Upset tummy, Treatment: Bland diet and probiotics\n", | ||
"\n", | ||
"Dog: Rocky, Breed: Terrier Mix\n", | ||
" Date: 2023-10-29, Diagnosis: Cut on paw, Treatment: Cleaned and antibiotic ointment\n", | ||
"\n", | ||
"Dog: Daisy, Breed: Poodle\n", | ||
" No medical records on file.\n", | ||
"\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"# As of this moment we have tested it with the following LLMs:\n", | ||
"\n", | ||
"# model = ta.Openai()\n", | ||
"model = ta.Gemini()\n", | ||
"\n", | ||
"out: Dogs = model.chat(tt.Thread(\n", | ||
" tt.human(\"\"\"\n", | ||
" At the Sunny Paws Animal Clinic, we keep detailed records of all our furry patients. Today, we saw a few dogs.\n", | ||
" There was 'Buddy,' a golden retriever, who visited on '2023-10-26' and was diagnosed with a 'mild ear infection,'\n", | ||
" which we treated with 'ear drops.' Then, there was 'Luna,' a playful beagle, who came in on '2023-10-25' for a\n", | ||
" 'routine check-up,' and no treatment was needed, but we also had her back on '2023-10-28' with a 'upset tummy'\n", | ||
" which we treated with 'bland diet and probiotics.' Finally, a third dog named 'Rocky', a small terrier mix,\n", | ||
" showed up on '2023-10-29' with a small 'cut on his paw,' we cleaned it and used an 'antibiotic ointment'. We\n", | ||
" also have 'Daisy,' a fluffy poodle, who doesn't have any medical records yet, thankfully!\n", | ||
" \"\"\"),\n", | ||
" schema=Dogs,\n", | ||
"))\n", | ||
"\n", | ||
"for dog in out.dogs:\n", | ||
" print(f\"Dog: {dog.name}, Breed: {dog.breed}\")\n", | ||
" if dog.records:\n", | ||
" for record in dog.records:\n", | ||
" print(f\" Date: {record.date}, Diagnosis: {record.diagnosis}, Treatment: {record.treatment}\")\n", | ||
" else:\n", | ||
" print(\" No medical records on file.\")\n", | ||
" print()" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.12.7" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "tuneapi" | ||
version = "0.7.0" | ||
version = "0.7.1" | ||
description = "Tune AI APIs." | ||
authors = ["Frello Technology Private Limited <[email protected]>"] | ||
license = "MIT" | ||
|
@@ -18,6 +18,7 @@ snowflake_id = "1.0.2" | |
nutree = "0.8.0" | ||
pillow = "^10.2.0" | ||
httpx = "^0.28.1" | ||
pydantic = "^2.6.4" | ||
protobuf = { version = "^5.27.3", optional = true } | ||
boto3 = { version = "1.29.6", optional = true } | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.