Skip to content

Commit

Permalink
Merge pull request #14 from aurelio-labs/simonas/0.0.7
Browse files Browse the repository at this point in the history
chore: schema update
  • Loading branch information
simjak authored Oct 3, 2024
2 parents 8f58102 + da33b3d commit 2a88388
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 125 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ repos:
rev: 24.8.0
hooks:
- id: black
args: [--target-version, py39, -l, "100"]
args: [--target-version, py39, -l, "88"]

- repo: https://github.com/asottile/blacken-docs
rev: 1.16.0
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
format:
poetry run black --target-version py39 -l 88 .
# poetry run black --target-version py39 -l 88 .
poetry run ruff check --select I --fix .

PYTHON_FILES=.
Expand Down
4 changes: 2 additions & 2 deletions aurelio_sdk/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ class Config:
# Embeddings Response
# ----------------------
class BM25Embedding(BaseModel):
indices: list[int] | list[float] | None = None
values: list[float] | list[int] | None = None
indices: list[int]
values: list[float]


class EmbeddingUsage(BaseModel):
Expand Down
128 changes: 9 additions & 119 deletions examples/04_embeddings.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -13,7 +13,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -32,41 +32,9 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"{\n",
" \"message\": null,\n",
" \"model\": \"bm25\",\n",
" \"object\": \"list\",\n",
" \"usage\": {\n",
" \"prompt_tokens\": 2,\n",
" \"total_tokens\": 2\n",
" },\n",
" \"data\": [\n",
" {\n",
" \"object\": \"embedding\",\n",
" \"index\": 0,\n",
" \"embedding\": {\n",
" \"indices\": [\n",
" 613153351,\n",
" 4220927227\n",
" ],\n",
" \"values\": [\n",
" 0.7652411540594288,\n",
" 0.7652411540594288\n",
" ]\n",
" }\n",
" }\n",
" ]\n",
"}\n"
]
}
],
"outputs": [],
"source": [
"response = client.embedding(input=\"Hello world\", model=\"bm25\")\n",
"\n",
Expand All @@ -75,55 +43,9 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"{\n",
" \"message\": null,\n",
" \"model\": \"bm25\",\n",
" \"object\": \"list\",\n",
" \"usage\": {\n",
" \"prompt_tokens\": 4,\n",
" \"total_tokens\": 4\n",
" },\n",
" \"data\": [\n",
" {\n",
" \"object\": \"embedding\",\n",
" \"index\": 0,\n",
" \"embedding\": {\n",
" \"indices\": [\n",
" 613153351,\n",
" 4220927227\n",
" ],\n",
" \"values\": [\n",
" 0.7652411540594288,\n",
" 0.7652411540594288\n",
" ]\n",
" }\n",
" },\n",
" {\n",
" \"object\": \"embedding\",\n",
" \"index\": 1,\n",
" \"embedding\": {\n",
" \"indices\": [\n",
" 613153351,\n",
" 4220927227\n",
" ],\n",
" \"values\": [\n",
" 0.7652411540594288,\n",
" 0.7652411540594288\n",
" ]\n",
" }\n",
" }\n",
" ]\n",
"}\n"
]
}
],
"outputs": [],
"source": [
"# Multiple inputs\n",
"response = client.embedding(input=[\"Hello world\", \"Hello world\"], model=\"bm25\")\n",
Expand All @@ -139,7 +61,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -151,41 +73,9 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"{\n",
" \"message\": null,\n",
" \"model\": \"bm25\",\n",
" \"object\": \"list\",\n",
" \"usage\": {\n",
" \"prompt_tokens\": 2,\n",
" \"total_tokens\": 2\n",
" },\n",
" \"data\": [\n",
" {\n",
" \"object\": \"embedding\",\n",
" \"index\": 0,\n",
" \"embedding\": {\n",
" \"indices\": [\n",
" 613153351,\n",
" 4220927227\n",
" ],\n",
" \"values\": [\n",
" 0.7652411540594288,\n",
" 0.7652411540594288\n",
" ]\n",
" }\n",
" }\n",
" ]\n",
"}\n"
]
}
],
"outputs": [],
"source": [
"response = await async_client.embedding(input=\"Hello world\", model=\"bm25\")\n",
"print(response.model_dump_json(indent=2))"
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[tool.poetry]
name = "aurelio-sdk"
version = "0.0.6"
version = "0.0.7"
description = "Aurelio Platform SDK"
authors = ["Team <[email protected]>"]
readme = "README.md"
packages = [{ include = "aurelio_sdk" }]

[project]
name = "aurelio-sdk"
version = "0.0.6"
version = "0.0.7"
license = { file = "LICENSE" }

[tool.poetry.dependencies]
Expand Down

0 comments on commit 2a88388

Please sign in to comment.