feat: return string content from get_content and register_call methods#768
Closed
fern-api[bot] wants to merge 1 commit intomainfrom
Closed
feat: return string content from get_content and register_call methods#768fern-api[bot] wants to merge 1 commit intomainfrom
fern-api[bot] wants to merge 1 commit intomainfrom
Conversation
Previously, `get_content` (knowledge base documents) and the Twilio
`register_call` method returned `None` / `HttpResponse[None]`. They now
return the actual response body as a `str` / `HttpResponse[str]`, making
the returned data accessible to callers without having to inspect the raw
HTTP response object.
Additionally, the `api_key` parameter on both `BaseElevenLabs` and
`AsyncBaseElevenLabs` now defaults to `os.getenv("ELEVENLABS_API_KEY")`
instead of `None`, allowing the client to be instantiated without
explicitly passing an API key when the environment variable is set.
The internal `AGENTS.md` documentation file has also been removed.
Key changes:
- `DocumentsClient.get_content` / `AsyncDocumentsClient.get_content` now return `str` (was `None`)
- `RawDocumentsClient.get_content` / `AsyncRawDocumentsClient.get_content` now return `HttpResponse[str]` (was `HttpResponse[None]`)
- `TwilioClient.register_call` / `AsyncTwilioClient.register_call` now return `str` (was `None`)
- `RawTwilioClient.register_call` / `AsyncRawTwilioClient.register_call` now return `HttpResponse[str]` (was `HttpResponse[None]`)
- `api_key` parameter defaults to `os.getenv("ELEVENLABS_API_KEY")` for both sync and async clients
- Removed `AGENTS.md` internal documentation file
🌿 Generated with Fern
1 task
Member
|
This PR is deleting a file which I forgot to add to fernignore (see #769). Was this PR generated? If yes, we could close this and simply re-generate on Monday? |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Version Bump: New observable behavior is added:
get_contentandregister_callnow return meaningfulstrdata instead ofNone, and theapi_keydefault is changed to read from the environment — all backward-compatible additions that provide new capabilities to callers.The
get_contentmethod onDocumentsClient(and its async counterpart) now returns the document content as astrinstead ofNone. Similarly, the Twilioregister_callmethod now returns the TwiML response body as astrinstead ofNone, making the response data directly accessible. The SDK clients now also automatically read theELEVENLABS_API_KEYenvironment variable as the default value forapi_key, so explicit key passing is no longer required when the environment variable is set.Note
Medium Risk
Changes observable SDK behavior by altering return types for
get_content/register_calland introducing an environment-derived default forapi_key, which could affect callers that relied on priorNonereturns or explicit key passing.Overview
Improves response usability for Conversational AI endpoints by returning the actual response body as
strfor knowledge-base documentget_content(sync/async) and Twilioregister_call(sync/async), wiring raw clients to surface_response.textinstead ofNone.Makes authentication setup more convenient by defaulting
api_keyinElevenLabs/AsyncElevenLabstoos.getenv("ELEVENLABS_API_KEY")when not explicitly provided.Bumps SDK version to
2.43.0(including User-Agent/SDK headers), updates generated docs/examples, updates Fern metadata, and adds achangelog.mdentry (now ignored by Fern).Reviewed by Cursor Bugbot for commit 61232d2. Bugbot is set up for automated code reviews on this repo. Configure here.