Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release: 0.1.0-alpha.1 #5

Merged
merged 6 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.0.1-alpha.1"
".": "0.1.0-alpha.1"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 3
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/beats-ai-beatsfoundation%2Fbeats-foundation-f711efcd99b00b3dc26c741770eecb8c17dc76bac1372c192aa232b4aae417e9.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/beats-ai-beatsfoundation%2Fbeats-foundation-9e8f99d19503143b44d679b3743fc6791e0f6ece45048c58926ed10376d78af5.yml
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Changelog

## 0.1.0-alpha.1 (2025-01-14)

Full Changelog: [v0.0.1-alpha.1...v0.1.0-alpha.1](https://github.com/beatsfoundation/beats-foundation-sdk/compare/v0.0.1-alpha.1...v0.1.0-alpha.1)

### Features

* **api:** api update ([#8](https://github.com/beatsfoundation/beats-foundation-sdk/issues/8)) ([abe66f1](https://github.com/beatsfoundation/beats-foundation-sdk/commit/abe66f1a8d13dc74b713c81c26d824819b2ca0ac))
* **api:** api update ([#9](https://github.com/beatsfoundation/beats-foundation-sdk/issues/9)) ([126444e](https://github.com/beatsfoundation/beats-foundation-sdk/commit/126444eb9473a7c1da054741c7f9aa658cb30dbd))
* **api:** update via SDK Studio ([#6](https://github.com/beatsfoundation/beats-foundation-sdk/issues/6)) ([94dcca5](https://github.com/beatsfoundation/beats-foundation-sdk/commit/94dcca579b38b9c238093de3617f425934432f44))


### Chores

* remove custom code ([7cef31e](https://github.com/beatsfoundation/beats-foundation-sdk/commit/7cef31ea40ff84ec06b17bf92d487e9c011557ec))
* update SDK settings ([#10](https://github.com/beatsfoundation/beats-foundation-sdk/issues/10)) ([8e3d6b5](https://github.com/beatsfoundation/beats-foundation-sdk/commit/8e3d6b51086c021cf77aee85ba8b79794dfa1ae0))

## 0.0.1-alpha.1 (2025-01-13)

Full Changelog: [v0.0.1-alpha.0...v0.0.1-alpha.1](https://github.com/beatsfoundation/beats-foundation-sdk/compare/v0.0.1-alpha.0...v0.0.1-alpha.1)
Expand Down
24 changes: 17 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,37 @@
# AI Creation Engine SDK, by the BEATS AI Foundation
# Beats Foundation Python API library

[![PyPI version](https://img.shields.io/pypi/v/beats_foundation.svg)](https://pypi.org/project/beats_foundation/)
[![PyPI version](https://img.shields.io/pypi/v/beats-foundation.svg)](https://pypi.org/project/beats-foundation/)

The AI Creation Engine SDK, by the BEATS AI Foundation, provides convenient access to the AI Creation Engine REST API from any Python 3.8+
The Beats Foundation Python library provides convenient access to the Beats Foundation REST API from any Python 3.8+
application. The library includes type definitions for all request params and response fields,
and offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).

It is generated with [Stainless](https://www.stainlessapi.com/).

## Documentation

The REST API documentation can be found on [docs.beats-foundation.com](https://docs.beats-foundation.com). The full API of this library can be found in [api.md](api.md).
The REST API documentation can be found on [docs.beatsfoundation.com](https://docs.beatsfoundation.com). The full API of this library can be found in [api.md](api.md).

## Installation

```sh
# install from PyPI
pip install --pre beats_foundation
pip install --pre beats-foundation
```

## Usage

The full API of this library can be found in [api.md](api.md).

```python
import os
from beats_foundation import BeatsFoundation

client = BeatsFoundation()
client = BeatsFoundation(
bearer_token=os.environ.get(
"BEATSFOUNDATION_BEARER_TOKEN"
), # This is the default and can be omitted
)

song = client.songs.retrieve(
"REPLACE_ME",
Expand All @@ -44,10 +49,15 @@ so that your Bearer Token is not stored in source control.
Simply import `AsyncBeatsFoundation` instead of `BeatsFoundation` and use `await` with each API call:

```python
import os
import asyncio
from beats_foundation import AsyncBeatsFoundation

client = AsyncBeatsFoundation()
client = AsyncBeatsFoundation(
bearer_token=os.environ.get(
"BEATSFOUNDATION_BEARER_TOKEN"
), # This is the default and can be omitted
)


async def main() -> None:
Expand Down
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ or products provided by Beats Foundation please follow the respective company's

### Beats Foundation Terms and Policies

Please contact dev-feedback@beats-foundation.com for any questions or concerns regarding security of our services.
Please contact dev-feedback@beatsfoundation.com for any questions or concerns regarding security of our services.

---

Expand Down
2 changes: 1 addition & 1 deletion api.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ from beats_foundation.types import Song, SongCreateResponse, SongListResponse

Methods:

- <code title="post /api/songs">client.songs.<a href="./src/beats_foundation/resources/songs.py">create</a>(\*\*<a href="src/beats_foundation/types/song_create_params.py">params</a>) -> <a href="./src/beats_foundation/types/song_create_response.py">object</a></code>
- <code title="post /api/songs">client.songs.<a href="./src/beats_foundation/resources/songs.py">create</a>(\*\*<a href="src/beats_foundation/types/song_create_params.py">params</a>) -> <a href="./src/beats_foundation/types/song_create_response.py">SongCreateResponse</a></code>
- <code title="get /api/songs/{id}">client.songs.<a href="./src/beats_foundation/resources/songs.py">retrieve</a>(id) -> <a href="./src/beats_foundation/types/song.py">Song</a></code>
- <code title="get /api/songs">client.songs.<a href="./src/beats_foundation/resources/songs.py">list</a>(\*\*<a href="src/beats_foundation/types/song_list_params.py">params</a>) -> <a href="./src/beats_foundation/types/song_list_response.py">SongListResponse</a></code>
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[project]
name = "beats_foundation"
version = "0.0.1-alpha.1"
name = "beats-foundation"
version = "0.1.0-alpha.1"
description = "The official Python library for the beats-foundation API"
dynamic = ["readme"]
license = "Apache-2.0"
authors = [
{ name = "Beats Foundation", email = "dev-feedback@beats-foundation.com" },
{ name = "Beats Foundation", email = "dev-feedback@beatsfoundation.com" },
]
dependencies = [
"httpx>=0.23.0, <1",
Expand Down
4 changes: 2 additions & 2 deletions src/beats_foundation/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def __init__(
if base_url is None:
base_url = os.environ.get("BEATS_FOUNDATION_BASE_URL")
if base_url is None:
base_url = f"https://www.beatsfoundation.com/api"
base_url = f"https://www.beatsfoundation.com"

super().__init__(
version=__version__,
Expand Down Expand Up @@ -259,7 +259,7 @@ def __init__(
if base_url is None:
base_url = os.environ.get("BEATS_FOUNDATION_BASE_URL")
if base_url is None:
base_url = f"https://www.beatsfoundation.com/api"
base_url = f"https://www.beatsfoundation.com"

super().__init__(
version=__version__,
Expand Down
2 changes: 1 addition & 1 deletion src/beats_foundation/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "beats_foundation"
__version__ = "0.0.1-alpha.1" # x-release-please-version
__version__ = "0.1.0-alpha.1" # x-release-please-version
33 changes: 15 additions & 18 deletions src/beats_foundation/resources/songs.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from ..types.song import Song
from .._base_client import make_request_options
from ..types.song_list_response import SongListResponse
from ..types.song_create_response import SongCreateResponse

__all__ = ["SongsResource", "AsyncSongsResource"]

Expand Down Expand Up @@ -49,7 +50,6 @@ def create(
self,
*,
prompt: str,
creator_wallet_address: str | NotGiven = NOT_GIVEN,
genre: str | NotGiven = NOT_GIVEN,
is_instrumental: bool | NotGiven = NOT_GIVEN,
lyrics: str | NotGiven = NOT_GIVEN,
Expand All @@ -60,22 +60,22 @@ def create(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
) -> SongCreateResponse:
"""Generate a new AI song based on provided parameters.

Rate limited to 2 calls per
hour per API key.

Args:
prompt: Text prompt for song generation

creator_wallet_address: Wallet address of the creator
prompt: Text prompt for song generation (max 200 characters)

genre: Musical genre

is_instrumental: Whether the song should be instrumental
is_instrumental: Whether the song should be instrumental. If the song is instrumental, the lyrics
will be ignored.

lyrics: Optional lyrics for the song
lyrics: Optional lyrics for the song. If not provided, the prompt will be used to
generate lyrics.

mood: Mood of the song

Expand All @@ -92,7 +92,6 @@ def create(
body=maybe_transform(
{
"prompt": prompt,
"creator_wallet_address": creator_wallet_address,
"genre": genre,
"is_instrumental": is_instrumental,
"lyrics": lyrics,
Expand All @@ -103,7 +102,7 @@ def create(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=object,
cast_to=SongCreateResponse,
)

def retrieve(
Expand Down Expand Up @@ -210,7 +209,6 @@ async def create(
self,
*,
prompt: str,
creator_wallet_address: str | NotGiven = NOT_GIVEN,
genre: str | NotGiven = NOT_GIVEN,
is_instrumental: bool | NotGiven = NOT_GIVEN,
lyrics: str | NotGiven = NOT_GIVEN,
Expand All @@ -221,22 +219,22 @@ async def create(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
) -> SongCreateResponse:
"""Generate a new AI song based on provided parameters.

Rate limited to 2 calls per
hour per API key.

Args:
prompt: Text prompt for song generation

creator_wallet_address: Wallet address of the creator
prompt: Text prompt for song generation (max 200 characters)

genre: Musical genre

is_instrumental: Whether the song should be instrumental
is_instrumental: Whether the song should be instrumental. If the song is instrumental, the lyrics
will be ignored.

lyrics: Optional lyrics for the song
lyrics: Optional lyrics for the song. If not provided, the prompt will be used to
generate lyrics.

mood: Mood of the song

Expand All @@ -253,7 +251,6 @@ async def create(
body=await async_maybe_transform(
{
"prompt": prompt,
"creator_wallet_address": creator_wallet_address,
"genre": genre,
"is_instrumental": is_instrumental,
"lyrics": lyrics,
Expand All @@ -264,7 +261,7 @@ async def create(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=object,
cast_to=SongCreateResponse,
)

async def retrieve(
Expand Down
1 change: 1 addition & 0 deletions src/beats_foundation/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
from .song_list_params import SongListParams as SongListParams
from .song_create_params import SongCreateParams as SongCreateParams
from .song_list_response import SongListResponse as SongListResponse
from .song_create_response import SongCreateResponse as SongCreateResponse
15 changes: 9 additions & 6 deletions src/beats_foundation/types/song_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,22 @@

class SongCreateParams(TypedDict, total=False):
prompt: Required[str]
"""Text prompt for song generation"""

creator_wallet_address: Annotated[str, PropertyInfo(alias="creatorWalletAddress")]
"""Wallet address of the creator"""
"""Text prompt for song generation (max 200 characters)"""

genre: str
"""Musical genre"""

is_instrumental: Annotated[bool, PropertyInfo(alias="isInstrumental")]
"""Whether the song should be instrumental"""
"""Whether the song should be instrumental.

If the song is instrumental, the lyrics will be ignored.
"""

lyrics: str
"""Optional lyrics for the song"""
"""Optional lyrics for the song.

If not provided, the prompt will be used to generate lyrics.
"""

mood: str
"""Mood of the song"""
12 changes: 12 additions & 0 deletions src/beats_foundation/types/song_create_response.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import Optional

from .song import Song
from .._models import BaseModel

__all__ = ["SongCreateResponse"]


class SongCreateResponse(BaseModel):
song: Optional[Song] = None
Loading
Loading