code
stringlengths
66
870k
docstring
stringlengths
19
26.7k
func_name
stringlengths
1
138
language
stringclasses
1 value
repo
stringlengths
7
68
path
stringlengths
5
324
url
stringlengths
46
389
license
stringclasses
7 values
def normalize_symbol(symbol: str) -> str: """ Parameters ---------- symbol: str symbol Returns ------- symbol """ symbol = f"{int(symbol):06}" return f"SH{symbol}" if symbol.startswith("60") or symbol.startswith("688") els...
Parameters ---------- symbol: str symbol Returns ------- symbol
normalize_symbol
python
microsoft/qlib
scripts/data_collector/cn_index/collector.py
https://github.com/microsoft/qlib/blob/master/scripts/data_collector/cn_index/collector.py
MIT
def get_new_companies(self) -> pd.DataFrame: """ Returns ------- pd.DataFrame: symbol start_date end_date SH600000 2000-01-01 2099-12-31 dtypes: symbol: str start_date: pd.Timestamp ...
Returns ------- pd.DataFrame: symbol start_date end_date SH600000 2000-01-01 2099-12-31 dtypes: symbol: str start_date: pd.Timestamp end_date: pd.Timestamp
get_new_companies
python
microsoft/qlib
scripts/data_collector/cn_index/collector.py
https://github.com/microsoft/qlib/blob/master/scripts/data_collector/cn_index/collector.py
MIT
def get_history_companies(self) -> pd.DataFrame: """ Returns ------- pd.DataFrame: symbol date type SH600000 2019-11-11 add SH600000 2020-11-10 remove dtypes: symbol: str ...
Returns ------- pd.DataFrame: symbol date type SH600000 2019-11-11 add SH600000 2020-11-10 remove dtypes: symbol: str date: pd.Timestamp type: str, value from ["...
get_history_companies
python
microsoft/qlib
scripts/data_collector/cn_index/collector.py
https://github.com/microsoft/qlib/blob/master/scripts/data_collector/cn_index/collector.py
MIT
def fill_1min_using_1d( data_1min_dir: [str, Path], qlib_data_1d_dir: [str, Path], max_workers: int = 16, date_field_name: str = "date", symbol_field_name: str = "symbol", ): """Use 1d data to fill in the missing symbols relative to 1min Parameters ---------- data_1min_dir: str ...
Use 1d data to fill in the missing symbols relative to 1min Parameters ---------- data_1min_dir: str 1min data dir qlib_data_1d_dir: str 1d qlib data(bin data) dir, from: https://qlib.readthedocs.io/en/latest/component/data.html#converting-csv-format-into-qlib-format max_workers: in...
fill_1min_using_1d
python
microsoft/qlib
scripts/data_collector/contrib/fill_cn_1min_data/fill_cn_1min_data.py
https://github.com/microsoft/qlib/blob/master/scripts/data_collector/contrib/fill_cn_1min_data/fill_cn_1min_data.py
MIT
def future_calendar_collector(qlib_dir: [str, Path], freq: str = "day"): """get future calendar Parameters ---------- qlib_dir: str or Path qlib data directory freq: str value from ["day", "1min"], by default day """ qlib_dir = Path(qlib_dir).expanduser().resolve() if no...
get future calendar Parameters ---------- qlib_dir: str or Path qlib data directory freq: str value from ["day", "1min"], by default day
future_calendar_collector
python
microsoft/qlib
scripts/data_collector/contrib/future_trading_date_collector/future_trading_date_collector.py
https://github.com/microsoft/qlib/blob/master/scripts/data_collector/contrib/future_trading_date_collector/future_trading_date_collector.py
MIT
def get_cg_crypto_symbols(qlib_data_path: [str, Path] = None) -> list: """get crypto symbols in coingecko Returns ------- crypto symbols in given exchanges list of coingecko """ global _CG_CRYPTO_SYMBOLS # pylint: disable=W0603 @deco_retry def _get_coingecko(): try: ...
get crypto symbols in coingecko Returns ------- crypto symbols in given exchanges list of coingecko
get_cg_crypto_symbols
python
microsoft/qlib
scripts/data_collector/crypto/collector.py
https://github.com/microsoft/qlib/blob/master/scripts/data_collector/crypto/collector.py
MIT
def __init__(self, source_dir=None, normalize_dir=None, max_workers=4, interval="1d", region=REGION_CN): """ Parameters ---------- source_dir: str The directory where the raw data collected from the Internet is saved, default "Path(__file__).parent/source" normalize_...
Parameters ---------- source_dir: str The directory where the raw data collected from the Internet is saved, default "Path(__file__).parent/source" normalize_dir: str Directory for normalize data, default "Path(__file__).parent/normalize" max_workers: in...
__init__
python
microsoft/qlib
scripts/data_collector/fund/collector.py
https://github.com/microsoft/qlib/blob/master/scripts/data_collector/fund/collector.py
MIT
def _get_first_close(self, df: pd.DataFrame) -> float: """get first close value Notes ----- For incremental updates(append) to Yahoo 1D data, user need to use a close that is not 0 on the first trading day of the existing data """ df = df.loc[df["close"].first_valid_...
get first close value Notes ----- For incremental updates(append) to Yahoo 1D data, user need to use a close that is not 0 on the first trading day of the existing data
_get_first_close
python
microsoft/qlib
scripts/data_collector/yahoo/collector.py
https://github.com/microsoft/qlib/blob/master/scripts/data_collector/yahoo/collector.py
MIT
def _manual_adj_data(self, df: pd.DataFrame) -> pd.DataFrame: """manual adjust data: All fields (except change) are standardized according to the close of the first day""" if df.empty: return df df = df.copy() df.sort_values(self._date_field_name, inplace=True) df = d...
manual adjust data: All fields (except change) are standardized according to the close of the first day
_manual_adj_data
python
microsoft/qlib
scripts/data_collector/yahoo/collector.py
https://github.com/microsoft/qlib/blob/master/scripts/data_collector/yahoo/collector.py
MIT
def __init__( self, old_qlib_data_dir: [str, Path], date_field_name: str = "date", symbol_field_name: str = "symbol", **kwargs ): """ Parameters ---------- old_qlib_data_dir: str, Path the qlib data to be updated for yahoo, usually from: https://github.com/micros...
Parameters ---------- old_qlib_data_dir: str, Path the qlib data to be updated for yahoo, usually from: https://github.com/microsoft/qlib/tree/main/scripts#download-cn-data date_field_name: str date field name, default is date symbol_field_name: str ...
__init__
python
microsoft/qlib
scripts/data_collector/yahoo/collector.py
https://github.com/microsoft/qlib/blob/master/scripts/data_collector/yahoo/collector.py
MIT
def __init__( self, qlib_data_1d_dir: [str, Path], date_field_name: str = "date", symbol_field_name: str = "symbol", **kwargs ): """ Parameters ---------- qlib_data_1d_dir: str, Path the qlib data to be updated for yahoo, usually from: Normalised to 1min using lo...
Parameters ---------- qlib_data_1d_dir: str, Path the qlib data to be updated for yahoo, usually from: Normalised to 1min using local 1d data date_field_name: str date field name, default is date symbol_field_name: str symbol field name, defa...
__init__
python
microsoft/qlib
scripts/data_collector/yahoo/collector.py
https://github.com/microsoft/qlib/blob/master/scripts/data_collector/yahoo/collector.py
MIT
def __init__(self, source_dir=None, normalize_dir=None, max_workers=1, interval="1d", region=REGION_CN): """ Parameters ---------- source_dir: str The directory where the raw data collected from the Internet is saved, default "Path(__file__).parent/source" normalize_...
Parameters ---------- source_dir: str The directory where the raw data collected from the Internet is saved, default "Path(__file__).parent/source" normalize_dir: str Directory for normalize data, default "Path(__file__).parent/normalize" max_workers: in...
__init__
python
microsoft/qlib
scripts/data_collector/yahoo/collector.py
https://github.com/microsoft/qlib/blob/master/scripts/data_collector/yahoo/collector.py
MIT
def normalize_data( self, date_field_name: str = "date", symbol_field_name: str = "symbol", end_date: str = None, qlib_data_1d_dir: str = None, ): """normalize data Parameters ---------- date_field_name: str date field name, defaul...
normalize data Parameters ---------- date_field_name: str date field name, default date symbol_field_name: str symbol field name, default symbol end_date: str if not None, normalize the last date saved (including end_date); if None, it will ig...
normalize_data
python
microsoft/qlib
scripts/data_collector/yahoo/collector.py
https://github.com/microsoft/qlib/blob/master/scripts/data_collector/yahoo/collector.py
MIT
def normalize_data_1d_extend( self, old_qlib_data_dir, date_field_name: str = "date", symbol_field_name: str = "symbol" ): """normalize data extend; extending yahoo qlib data(from: https://github.com/microsoft/qlib/tree/main/scripts#download-cn-data) Notes ----- Steps to...
normalize data extend; extending yahoo qlib data(from: https://github.com/microsoft/qlib/tree/main/scripts#download-cn-data) Notes ----- Steps to extend yahoo qlib data: 1. download qlib data: https://github.com/microsoft/qlib/tree/main/scripts#download-cn-data; save to <di...
normalize_data_1d_extend
python
microsoft/qlib
scripts/data_collector/yahoo/collector.py
https://github.com/microsoft/qlib/blob/master/scripts/data_collector/yahoo/collector.py
MIT
def update_data_to_bin( self, qlib_data_1d_dir: str, end_date: str = None, check_data_length: int = None, delay: float = 1, exists_skip: bool = False, ): """update yahoo data to bin Parameters ---------- qlib_data_1d_dir: str ...
update yahoo data to bin Parameters ---------- qlib_data_1d_dir: str the qlib data to be updated for yahoo, usually from: https://github.com/microsoft/qlib/tree/main/scripts#download-cn-data end_date: str end datetime, default ``pd.Timestamp(trading_date + pd.Ti...
update_data_to_bin
python
microsoft/qlib
scripts/data_collector/yahoo/collector.py
https://github.com/microsoft/qlib/blob/master/scripts/data_collector/yahoo/collector.py
MIT
def train(uri_path: str = None): """train model Returns ------- pred_score: pandas.DataFrame predict scores performance: dict model performance """ # model initialization model = init_instance_by_config(CSI300_GBDT_TASK["model"]) dataset = init_insta...
train model Returns ------- pred_score: pandas.DataFrame predict scores performance: dict model performance
train
python
microsoft/qlib
tests/test_all_pipeline.py
https://github.com/microsoft/qlib/blob/master/tests/test_all_pipeline.py
MIT
def fake_experiment(): """A fake experiment workflow to test uri Returns ------- pass_or_not_for_default_uri: bool pass_or_not_for_current_uri: bool temporary_exp_dir: str """ # start exp default_uri = R.get_uri() current_uri = "file:./temp-test-exp-mag" with R....
A fake experiment workflow to test uri Returns ------- pass_or_not_for_default_uri: bool pass_or_not_for_current_uri: bool temporary_exp_dir: str
fake_experiment
python
microsoft/qlib
tests/test_all_pipeline.py
https://github.com/microsoft/qlib/blob/master/tests/test_all_pipeline.py
MIT
def backtest_analysis(pred, rid, uri_path: str = None): """backtest and analysis Parameters ---------- rid : str the id of the recorder to be used in this function uri_path: str mlflow uri path Returns ------- analysis : pandas.DataFrame the analysis result ...
backtest and analysis Parameters ---------- rid : str the id of the recorder to be used in this function uri_path: str mlflow uri path Returns ------- analysis : pandas.DataFrame the analysis result
backtest_analysis
python
microsoft/qlib
tests/test_all_pipeline.py
https://github.com/microsoft/qlib/blob/master/tests/test_all_pipeline.py
MIT
def test_TSDataSampler2(self): """ Extra test TSDataSampler to prevent incorrect filling of nan for the values at the front """ datetime_list = ["2000-01-31", "2000-02-29", "2000-03-31", "2000-04-30", "2000-05-31"] instruments = ["000001", "000002", "000003", "000004", "000005"] ...
Extra test TSDataSampler to prevent incorrect filling of nan for the values at the front
test_TSDataSampler2
python
microsoft/qlib
tests/data_mid_layer_tests/test_dataset.py
https://github.com/microsoft/qlib/blob/master/tests/data_mid_layer_tests/test_dataset.py
MIT
def test_creating_client(self): """ Please refer to qlib/workflow/expm.py:MLflowExpManager._client we don't cache _client (this is helpful to reduce maintainance work when MLflowExpManager's uri is chagned) This implementation is based on the assumption creating a client is fast ...
Please refer to qlib/workflow/expm.py:MLflowExpManager._client we don't cache _client (this is helpful to reduce maintainance work when MLflowExpManager's uri is chagned) This implementation is based on the assumption creating a client is fast
test_creating_client
python
microsoft/qlib
tests/dependency_tests/test_mlflow.py
https://github.com/microsoft/qlib/blob/master/tests/dependency_tests/test_mlflow.py
MIT
def test_multi_proc(self): """ For testing if it will raise error """ iter_n = 2 pool = Pool(iter_n) res = [] for _ in range(iter_n): res.append(pool.apply_async(get_features, (self.FIELDS,), {})) for r in res: print(r.get()) ...
For testing if it will raise error
test_multi_proc
python
microsoft/qlib
tests/misc/test_get_multi_proc.py
https://github.com/microsoft/qlib/blob/master/tests/misc/test_get_multi_proc.py
MIT
def cal_sam_minute(x: pd.Timestamp, sam_minutes: int, region: str): """ Sample raw calendar into calendar with sam_minutes freq, shift represents the shift minute the market time - open time of stock market is [9:30 - shift*pd.Timedelta(minutes=1)] - mid close time of stock market is [11:29 - sh...
Sample raw calendar into calendar with sam_minutes freq, shift represents the shift minute the market time - open time of stock market is [9:30 - shift*pd.Timedelta(minutes=1)] - mid close time of stock market is [11:29 - shift*pd.Timedelta(minutes=1)] - mid open time of stock market is [13...
cal_sam_minute
python
microsoft/qlib
tests/misc/test_utils.py
https://github.com/microsoft/qlib/blob/master/tests/misc/test_utils.py
MIT
def test_update_pred(self): """ This test is for testing if it will raise error if the `to_date` is out of the boundary. """ task = copy.deepcopy(CSI300_GBDT_TASK) task["record"] = ["qlib.workflow.record_temp.SignalRecord"] exp_name = "online_srv_test" cal = D....
This test is for testing if it will raise error if the `to_date` is out of the boundary.
test_update_pred
python
microsoft/qlib
tests/rolling_tests/test_update_pred.py
https://github.com/microsoft/qlib/blob/master/tests/rolling_tests/test_update_pred.py
MIT
def test_instrument_storage(self): """ The meaning of instrument, such as CSI500: CSI500 composition changes: date add remove 2005-01-01 SH600000 2005-01-01 SH600001 2005-01-01 SH600002 ...
The meaning of instrument, such as CSI500: CSI500 composition changes: date add remove 2005-01-01 SH600000 2005-01-01 SH600001 2005-01-01 SH600002 2005-02-01 SH600003 SH600000...
test_instrument_storage
python
microsoft/qlib
tests/storage_tests/test_storage.py
https://github.com/microsoft/qlib/blob/master/tests/storage_tests/test_storage.py
MIT
def test_feature_storage(self): """ Calendar: pd.date_range(start="2005-01-01", stop="2005-03-01", freq="1D") Instrument: { "SH600000": [(2005-01-01, 2005-01-31), (2005-02-15, 2005-03-01)], "SH600001": [(2005-01-01, 2005-03-01)], ...
Calendar: pd.date_range(start="2005-01-01", stop="2005-03-01", freq="1D") Instrument: { "SH600000": [(2005-01-01, 2005-01-31), (2005-02-15, 2005-03-01)], "SH600001": [(2005-01-01, 2005-03-01)], "SH600002": [(2005-01-01, 2005-02-14...
test_feature_storage
python
microsoft/qlib
tests/storage_tests/test_storage.py
https://github.com/microsoft/qlib/blob/master/tests/storage_tests/test_storage.py
MIT
def convert_realtime( self, voice_id: str, *, text: typing.Iterator[str], model_id: typing.Optional[str] = OMIT, output_format: typing.Optional[OutputFormat] = "mp3_44100_128", voice_settings: typing.Optional[VoiceSettings] = OMIT, request_options: typing....
Converts text into speech using a voice of your choice and returns audio. Parameters: - voice_id: str. Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices. - text: typing.Iterator[str]. The text that will get converted into spe...
convert_realtime
python
elevenlabs/elevenlabs-python
src/elevenlabs/realtime_tts.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/realtime_tts.py
MIT
def construct_event(self, rawBody: str, sig_header: str, secret: str) -> Dict: """ Constructs a webhook event object from a payload and signature. Verifies the webhook signature to ensure the event came from ElevenLabs. Args: rawBody: The webhook request body. Must be the ra...
Constructs a webhook event object from a payload and signature. Verifies the webhook signature to ensure the event came from ElevenLabs. Args: rawBody: The webhook request body. Must be the raw body, not a JSON object sig_header: The signature header from the request ...
construct_event
python
elevenlabs/elevenlabs-python
src/elevenlabs/webhooks.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/webhooks.py
MIT
def convert( self, *, audio: core.File, file_format: typing.Optional[AudioIsolationConvertRequestFileFormat] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Iterator[bytes]: """ Removes background noise from audio. Paramet...
Removes background noise from audio. Parameters ---------- audio : core.File See core.File for more documentation file_format : typing.Optional[AudioIsolationConvertRequestFileFormat] The format of input audio. Options are 'pcm_s16le_16' or 'other' For ...
convert
python
elevenlabs/elevenlabs-python
src/elevenlabs/audio_isolation/client.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/audio_isolation/client.py
MIT
def stream( self, *, audio: core.File, file_format: typing.Optional[AudioIsolationStreamRequestFileFormat] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Iterator[bytes]: """ Removes background noise from audio. Parameter...
Removes background noise from audio. Parameters ---------- audio : core.File See core.File for more documentation file_format : typing.Optional[AudioIsolationStreamRequestFileFormat] The format of input audio. Options are 'pcm_s16le_16' or 'other' For `...
stream
python
elevenlabs/elevenlabs-python
src/elevenlabs/audio_isolation/client.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/audio_isolation/client.py
MIT
async def convert( self, *, audio: core.File, file_format: typing.Optional[AudioIsolationConvertRequestFileFormat] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.AsyncIterator[bytes]: """ Removes background noise from audio. ...
Removes background noise from audio. Parameters ---------- audio : core.File See core.File for more documentation file_format : typing.Optional[AudioIsolationConvertRequestFileFormat] The format of input audio. Options are 'pcm_s16le_16' or 'other' For ...
convert
python
elevenlabs/elevenlabs-python
src/elevenlabs/audio_isolation/client.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/audio_isolation/client.py
MIT
async def stream( self, *, audio: core.File, file_format: typing.Optional[AudioIsolationStreamRequestFileFormat] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.AsyncIterator[bytes]: """ Removes background noise from audio. ...
Removes background noise from audio. Parameters ---------- audio : core.File See core.File for more documentation file_format : typing.Optional[AudioIsolationStreamRequestFileFormat] The format of input audio. Options are 'pcm_s16le_16' or 'other' For `...
stream
python
elevenlabs/elevenlabs-python
src/elevenlabs/audio_isolation/client.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/audio_isolation/client.py
MIT
def convert( self, *, audio: core.File, file_format: typing.Optional[AudioIsolationConvertRequestFileFormat] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Iterator[HttpResponse[typing.Iterator[bytes]]]: """ Removes background noi...
Removes background noise from audio. Parameters ---------- audio : core.File See core.File for more documentation file_format : typing.Optional[AudioIsolationConvertRequestFileFormat] The format of input audio. Options are 'pcm_s16le_16' or 'other' For ...
convert
python
elevenlabs/elevenlabs-python
src/elevenlabs/audio_isolation/raw_client.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/audio_isolation/raw_client.py
MIT
def stream( self, *, audio: core.File, file_format: typing.Optional[AudioIsolationStreamRequestFileFormat] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Iterator[HttpResponse[typing.Iterator[bytes]]]: """ Removes background noise...
Removes background noise from audio. Parameters ---------- audio : core.File See core.File for more documentation file_format : typing.Optional[AudioIsolationStreamRequestFileFormat] The format of input audio. Options are 'pcm_s16le_16' or 'other' For `...
stream
python
elevenlabs/elevenlabs-python
src/elevenlabs/audio_isolation/raw_client.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/audio_isolation/raw_client.py
MIT
async def convert( self, *, audio: core.File, file_format: typing.Optional[AudioIsolationConvertRequestFileFormat] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]]: """ R...
Removes background noise from audio. Parameters ---------- audio : core.File See core.File for more documentation file_format : typing.Optional[AudioIsolationConvertRequestFileFormat] The format of input audio. Options are 'pcm_s16le_16' or 'other' For ...
convert
python
elevenlabs/elevenlabs-python
src/elevenlabs/audio_isolation/raw_client.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/audio_isolation/raw_client.py
MIT
async def stream( self, *, audio: core.File, file_format: typing.Optional[AudioIsolationStreamRequestFileFormat] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]]: """ Rem...
Removes background noise from audio. Parameters ---------- audio : core.File See core.File for more documentation file_format : typing.Optional[AudioIsolationStreamRequestFileFormat] The format of input audio. Options are 'pcm_s16le_16' or 'other' For `...
stream
python
elevenlabs/elevenlabs-python
src/elevenlabs/audio_isolation/raw_client.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/audio_isolation/raw_client.py
MIT
def create( self, *, name: str, image: typing.Optional[str] = OMIT, author: typing.Optional[str] = OMIT, title: typing.Optional[str] = OMIT, small: typing.Optional[bool] = OMIT, text_color: typing.Optional[str] = OMIT, background_color: typing.Opti...
Creates Audio Native enabled project, optionally starts conversion and returns project ID and embeddable HTML snippet. Parameters ---------- name : str Project name. image : typing.Optional[str] (Deprecated) Image URL used in the player. If not provided...
create
python
elevenlabs/elevenlabs-python
src/elevenlabs/audio_native/client.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/audio_native/client.py
MIT
def get_settings( self, project_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> GetAudioNativeProjectSettingsResponseModel: """ Get player settings for the specific project. Parameters ---------- project_id : str The ID of the Stu...
Get player settings for the specific project. Parameters ---------- project_id : str The ID of the Studio project. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetAudioNativeP...
get_settings
python
elevenlabs/elevenlabs-python
src/elevenlabs/audio_native/client.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/audio_native/client.py
MIT
def update( self, project_id: str, *, file: typing.Optional[core.File] = OMIT, auto_convert: typing.Optional[bool] = OMIT, auto_publish: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AudioNativeEditContentResponseM...
Updates content for the specific AudioNative Project. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. file : typing.Option...
update
python
elevenlabs/elevenlabs-python
src/elevenlabs/audio_native/client.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/audio_native/client.py
MIT
async def create( self, *, name: str, image: typing.Optional[str] = OMIT, author: typing.Optional[str] = OMIT, title: typing.Optional[str] = OMIT, small: typing.Optional[bool] = OMIT, text_color: typing.Optional[str] = OMIT, background_color: typin...
Creates Audio Native enabled project, optionally starts conversion and returns project ID and embeddable HTML snippet. Parameters ---------- name : str Project name. image : typing.Optional[str] (Deprecated) Image URL used in the player. If not provided...
create
python
elevenlabs/elevenlabs-python
src/elevenlabs/audio_native/client.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/audio_native/client.py
MIT
async def get_settings( self, project_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> GetAudioNativeProjectSettingsResponseModel: """ Get player settings for the specific project. Parameters ---------- project_id : str The ID of t...
Get player settings for the specific project. Parameters ---------- project_id : str The ID of the Studio project. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetAudioNativeP...
get_settings
python
elevenlabs/elevenlabs-python
src/elevenlabs/audio_native/client.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/audio_native/client.py
MIT
async def update( self, project_id: str, *, file: typing.Optional[core.File] = OMIT, auto_convert: typing.Optional[bool] = OMIT, auto_publish: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AudioNativeEditContentRes...
Updates content for the specific AudioNative Project. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. file : typing.Option...
update
python
elevenlabs/elevenlabs-python
src/elevenlabs/audio_native/client.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/audio_native/client.py
MIT
def create( self, *, name: str, image: typing.Optional[str] = OMIT, author: typing.Optional[str] = OMIT, title: typing.Optional[str] = OMIT, small: typing.Optional[bool] = OMIT, text_color: typing.Optional[str] = OMIT, background_color: typing.Opti...
Creates Audio Native enabled project, optionally starts conversion and returns project ID and embeddable HTML snippet. Parameters ---------- name : str Project name. image : typing.Optional[str] (Deprecated) Image URL used in the player. If not provided...
create
python
elevenlabs/elevenlabs-python
src/elevenlabs/audio_native/raw_client.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/audio_native/raw_client.py
MIT
def get_settings( self, project_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[GetAudioNativeProjectSettingsResponseModel]: """ Get player settings for the specific project. Parameters ---------- project_id : str The...
Get player settings for the specific project. Parameters ---------- project_id : str The ID of the Studio project. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[Ge...
get_settings
python
elevenlabs/elevenlabs-python
src/elevenlabs/audio_native/raw_client.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/audio_native/raw_client.py
MIT
def update( self, project_id: str, *, file: typing.Optional[core.File] = OMIT, auto_convert: typing.Optional[bool] = OMIT, auto_publish: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[AudioNativeEditCon...
Updates content for the specific AudioNative Project. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. file : typing.Option...
update
python
elevenlabs/elevenlabs-python
src/elevenlabs/audio_native/raw_client.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/audio_native/raw_client.py
MIT
async def create( self, *, name: str, image: typing.Optional[str] = OMIT, author: typing.Optional[str] = OMIT, title: typing.Optional[str] = OMIT, small: typing.Optional[bool] = OMIT, text_color: typing.Optional[str] = OMIT, background_color: typin...
Creates Audio Native enabled project, optionally starts conversion and returns project ID and embeddable HTML snippet. Parameters ---------- name : str Project name. image : typing.Optional[str] (Deprecated) Image URL used in the player. If not provided...
create
python
elevenlabs/elevenlabs-python
src/elevenlabs/audio_native/raw_client.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/audio_native/raw_client.py
MIT
async def get_settings( self, project_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[GetAudioNativeProjectSettingsResponseModel]: """ Get player settings for the specific project. Parameters ---------- project_id : str ...
Get player settings for the specific project. Parameters ---------- project_id : str The ID of the Studio project. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpRespon...
get_settings
python
elevenlabs/elevenlabs-python
src/elevenlabs/audio_native/raw_client.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/audio_native/raw_client.py
MIT
async def update( self, project_id: str, *, file: typing.Optional[core.File] = OMIT, auto_convert: typing.Optional[bool] = OMIT, auto_publish: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[AudioNa...
Updates content for the specific AudioNative Project. Parameters ---------- project_id : str The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. file : typing.Option...
update
python
elevenlabs/elevenlabs-python
src/elevenlabs/audio_native/raw_client.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/audio_native/raw_client.py
MIT
def add_to_knowledge_base( self, *, name: typing.Optional[str] = OMIT, url: typing.Optional[str] = OMIT, file: typing.Optional[core.File] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AddKnowledgeBaseResponseModel: """ Upload a ...
Upload a file or webpage URL to create a knowledge base document. <br> <Note> After creating the document, update the agent's knowledge base by calling [Update agent](/docs/conversational-ai/api-reference/agents/update-agent). </Note> Parameters ---------- name : typing.Optional[str] ...
add_to_knowledge_base
python
elevenlabs/elevenlabs-python
src/elevenlabs/conversational_ai/client.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/conversational_ai/client.py
MIT
def get_document_rag_indexes( self, documentation_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> RagDocumentIndexesResponseModel: """ Provides information about all RAG indexes of the specified knowledgebase document. Parameters ---------- d...
Provides information about all RAG indexes of the specified knowledgebase document. Parameters ---------- documentation_id : str The id of a document from the knowledge base. This is returned on document addition. request_options : typing.Optional[RequestOptions] ...
get_document_rag_indexes
python
elevenlabs/elevenlabs-python
src/elevenlabs/conversational_ai/client.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/conversational_ai/client.py
MIT
def delete_document_rag_index( self, documentation_id: str, rag_index_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> RagDocumentIndexResponseModel: """ Delete RAG index for the knowledgebase document. Parameters ---------- documentation_id :...
Delete RAG index for the knowledgebase document. Parameters ---------- documentation_id : str The id of a document from the knowledge base. This is returned on document addition. rag_index_id : str The id of RAG index of document from the knowledge base...
delete_document_rag_index
python
elevenlabs/elevenlabs-python
src/elevenlabs/conversational_ai/client.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/conversational_ai/client.py
MIT
def rag_index_overview( self, *, request_options: typing.Optional[RequestOptions] = None ) -> RagIndexOverviewResponseModel: """ Provides total size and other information of RAG indexes used by knowledgebase documents Parameters ---------- request_options : typing.Op...
Provides total size and other information of RAG indexes used by knowledgebase documents Parameters ---------- request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- RagIndexOverviewResponseModel ...
rag_index_overview
python
elevenlabs/elevenlabs-python
src/elevenlabs/conversational_ai/client.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/conversational_ai/client.py
MIT
def update_secret( self, secret_id: str, *, name: str, value: str, request_options: typing.Optional[RequestOptions] = None ) -> PostWorkspaceSecretResponseModel: """ Update an existing secret for the workspace Parameters ---------- secret_id : str name : str...
Update an existing secret for the workspace Parameters ---------- secret_id : str name : str value : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- PostWorkspaceSecret...
update_secret
python
elevenlabs/elevenlabs-python
src/elevenlabs/conversational_ai/client.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/conversational_ai/client.py
MIT
async def add_to_knowledge_base( self, *, name: typing.Optional[str] = OMIT, url: typing.Optional[str] = OMIT, file: typing.Optional[core.File] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AddKnowledgeBaseResponseModel: """ Upl...
Upload a file or webpage URL to create a knowledge base document. <br> <Note> After creating the document, update the agent's knowledge base by calling [Update agent](/docs/conversational-ai/api-reference/agents/update-agent). </Note> Parameters ---------- name : typing.Optional[str] ...
add_to_knowledge_base
python
elevenlabs/elevenlabs-python
src/elevenlabs/conversational_ai/client.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/conversational_ai/client.py
MIT
async def get_document_rag_indexes( self, documentation_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> RagDocumentIndexesResponseModel: """ Provides information about all RAG indexes of the specified knowledgebase document. Parameters ---------- ...
Provides information about all RAG indexes of the specified knowledgebase document. Parameters ---------- documentation_id : str The id of a document from the knowledge base. This is returned on document addition. request_options : typing.Optional[RequestOptions] ...
get_document_rag_indexes
python
elevenlabs/elevenlabs-python
src/elevenlabs/conversational_ai/client.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/conversational_ai/client.py
MIT
async def delete_document_rag_index( self, documentation_id: str, rag_index_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> RagDocumentIndexResponseModel: """ Delete RAG index for the knowledgebase document. Parameters ---------- documentatio...
Delete RAG index for the knowledgebase document. Parameters ---------- documentation_id : str The id of a document from the knowledge base. This is returned on document addition. rag_index_id : str The id of RAG index of document from the knowledge base...
delete_document_rag_index
python
elevenlabs/elevenlabs-python
src/elevenlabs/conversational_ai/client.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/conversational_ai/client.py
MIT
async def rag_index_overview( self, *, request_options: typing.Optional[RequestOptions] = None ) -> RagIndexOverviewResponseModel: """ Provides total size and other information of RAG indexes used by knowledgebase documents Parameters ---------- request_options : typ...
Provides total size and other information of RAG indexes used by knowledgebase documents Parameters ---------- request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- RagIndexOverviewResponseModel ...
rag_index_overview
python
elevenlabs/elevenlabs-python
src/elevenlabs/conversational_ai/client.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/conversational_ai/client.py
MIT
async def update_secret( self, secret_id: str, *, name: str, value: str, request_options: typing.Optional[RequestOptions] = None ) -> PostWorkspaceSecretResponseModel: """ Update an existing secret for the workspace Parameters ---------- secret_id : str name...
Update an existing secret for the workspace Parameters ---------- secret_id : str name : str value : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- PostWorkspaceSecret...
update_secret
python
elevenlabs/elevenlabs-python
src/elevenlabs/conversational_ai/client.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/conversational_ai/client.py
MIT
def start(self): """Start the event loop in a separate thread for handling async operations.""" if self._running.is_set(): return def run_event_loop(): self._loop = asyncio.new_event_loop() asyncio.set_event_loop(self._loop) self._running.set() ...
Start the event loop in a separate thread for handling async operations.
start
python
elevenlabs/elevenlabs-python
src/elevenlabs/conversational_ai/conversation.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/conversational_ai/conversation.py
MIT
def stop(self): """Gracefully stop the event loop and clean up resources.""" if self._loop and self._running.is_set(): self._loop.call_soon_threadsafe(self._loop.stop) self._thread.join() self.thread_pool.shutdown(wait=False)
Gracefully stop the event loop and clean up resources.
stop
python
elevenlabs/elevenlabs-python
src/elevenlabs/conversational_ai/conversation.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/conversational_ai/conversation.py
MIT
def register( self, tool_name: str, handler: Union[Callable[[dict], Any], Callable[[dict], Awaitable[Any]]], is_async: bool = False, ) -> None: """Register a new tool that can be called by the AI agent. Args: tool_name: Unique identifier for the tool ...
Register a new tool that can be called by the AI agent. Args: tool_name: Unique identifier for the tool handler: Function that implements the tool's logic is_async: Whether the handler is an async function
register
python
elevenlabs/elevenlabs-python
src/elevenlabs/conversational_ai/conversation.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/conversational_ai/conversation.py
MIT
async def handle(self, tool_name: str, parameters: dict) -> Any: """Execute a registered tool with the given parameters. Returns the result of the tool execution. """ with self.lock: if tool_name not in self.tools: raise ValueError(f"Tool '{tool_name}' is not...
Execute a registered tool with the given parameters. Returns the result of the tool execution.
handle
python
elevenlabs/elevenlabs-python
src/elevenlabs/conversational_ai/conversation.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/conversational_ai/conversation.py
MIT
def execute_tool(self, tool_name: str, parameters: dict, callback: Callable[[dict], None]): """Execute a tool and send its result via the provided callback. This method is non-blocking and handles both sync and async tools. """ if not self._running.is_set(): raise RuntimeErr...
Execute a tool and send its result via the provided callback. This method is non-blocking and handles both sync and async tools.
execute_tool
python
elevenlabs/elevenlabs-python
src/elevenlabs/conversational_ai/conversation.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/conversational_ai/conversation.py
MIT
def __init__( self, client: BaseElevenLabs, agent_id: str, *, requires_auth: bool, audio_interface: AudioInterface, config: Optional[ConversationInitiationData] = None, client_tools: Optional[ClientTools] = None, callback_agent_response: Optional[C...
Conversational AI session. BETA: This API is subject to change without regard to backwards compatibility. Args: client: The ElevenLabs client to use for the conversation. agent_id: The ID of the agent to converse with. requires_auth: Whether the agent requires authe...
__init__
python
elevenlabs/elevenlabs-python
src/elevenlabs/conversational_ai/conversation.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/conversational_ai/conversation.py
MIT
def start_session(self): """Starts the conversation session. Will run in background thread until `end_session` is called. """ ws_url = self._get_signed_url() if self.requires_auth else self._get_wss_url() self._thread = threading.Thread(target=self._run, args=(ws_url,)) ...
Starts the conversation session. Will run in background thread until `end_session` is called.
start_session
python
elevenlabs/elevenlabs-python
src/elevenlabs/conversational_ai/conversation.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/conversational_ai/conversation.py
MIT
def end_session(self): """Ends the conversation session and cleans up resources.""" self.audio_interface.stop() self.client_tools.stop() self._ws = None self._should_stop.set()
Ends the conversation session and cleans up resources.
end_session
python
elevenlabs/elevenlabs-python
src/elevenlabs/conversational_ai/conversation.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/conversational_ai/conversation.py
MIT
def wait_for_session_end(self) -> Optional[str]: """Waits for the conversation session to end. You must call `end_session` before calling this method, otherwise it will block. Returns the conversation ID, if available. """ if not self._thread: raise RuntimeError("Se...
Waits for the conversation session to end. You must call `end_session` before calling this method, otherwise it will block. Returns the conversation ID, if available.
wait_for_session_end
python
elevenlabs/elevenlabs-python
src/elevenlabs/conversational_ai/conversation.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/conversational_ai/conversation.py
MIT
def send_user_message(self, text: str): """Send a text message from the user to the agent. Args: text: The text message to send to the agent. Raises: RuntimeError: If the session is not active or websocket is not connected. """ if not...
Send a text message from the user to the agent. Args: text: The text message to send to the agent. Raises: RuntimeError: If the session is not active or websocket is not connected.
send_user_message
python
elevenlabs/elevenlabs-python
src/elevenlabs/conversational_ai/conversation.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/conversational_ai/conversation.py
MIT
def register_user_activity(self): """Register user activity to prevent session timeout. This sends a ping to the orchestrator to reset the timeout timer. Raises: RuntimeError: If the session is not active or websocket is not connected. """ if not sel...
Register user activity to prevent session timeout. This sends a ping to the orchestrator to reset the timeout timer. Raises: RuntimeError: If the session is not active or websocket is not connected.
register_user_activity
python
elevenlabs/elevenlabs-python
src/elevenlabs/conversational_ai/conversation.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/conversational_ai/conversation.py
MIT
def send_contextual_update(self, content: str): """Send a contextual update to the conversation. Contextual updates are non-interrupting content that is sent to the server to update the conversation state without directly prompting the agent. Args: content: ...
Send a contextual update to the conversation. Contextual updates are non-interrupting content that is sent to the server to update the conversation state without directly prompting the agent. Args: content: The contextual information to send to the conversation. ...
send_contextual_update
python
elevenlabs/elevenlabs-python
src/elevenlabs/conversational_ai/conversation.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/conversational_ai/conversation.py
MIT
def add_to_knowledge_base( self, *, name: typing.Optional[str] = OMIT, url: typing.Optional[str] = OMIT, file: typing.Optional[core.File] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[AddKnowledgeBaseResponseModel]: """ ...
Upload a file or webpage URL to create a knowledge base document. <br> <Note> After creating the document, update the agent's knowledge base by calling [Update agent](/docs/conversational-ai/api-reference/agents/update-agent). </Note> Parameters ---------- name : typing.Optional[str] ...
add_to_knowledge_base
python
elevenlabs/elevenlabs-python
src/elevenlabs/conversational_ai/raw_client.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/conversational_ai/raw_client.py
MIT
def get_document_rag_indexes( self, documentation_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[RagDocumentIndexesResponseModel]: """ Provides information about all RAG indexes of the specified knowledgebase document. Parameters ------...
Provides information about all RAG indexes of the specified knowledgebase document. Parameters ---------- documentation_id : str The id of a document from the knowledge base. This is returned on document addition. request_options : typing.Optional[RequestOptions] ...
get_document_rag_indexes
python
elevenlabs/elevenlabs-python
src/elevenlabs/conversational_ai/raw_client.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/conversational_ai/raw_client.py
MIT
def delete_document_rag_index( self, documentation_id: str, rag_index_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[RagDocumentIndexResponseModel]: """ Delete RAG index for the knowledgebase document. Parameters ---------- docu...
Delete RAG index for the knowledgebase document. Parameters ---------- documentation_id : str The id of a document from the knowledge base. This is returned on document addition. rag_index_id : str The id of RAG index of document from the knowledge base...
delete_document_rag_index
python
elevenlabs/elevenlabs-python
src/elevenlabs/conversational_ai/raw_client.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/conversational_ai/raw_client.py
MIT
def rag_index_overview( self, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[RagIndexOverviewResponseModel]: """ Provides total size and other information of RAG indexes used by knowledgebase documents Parameters ---------- request_optio...
Provides total size and other information of RAG indexes used by knowledgebase documents Parameters ---------- request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[RagIndexOverviewResponseMod...
rag_index_overview
python
elevenlabs/elevenlabs-python
src/elevenlabs/conversational_ai/raw_client.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/conversational_ai/raw_client.py
MIT
def update_secret( self, secret_id: str, *, name: str, value: str, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[PostWorkspaceSecretResponseModel]: """ Update an existing secret for the workspace Parameters ---------- secret_id : str ...
Update an existing secret for the workspace Parameters ---------- secret_id : str name : str value : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[PostWo...
update_secret
python
elevenlabs/elevenlabs-python
src/elevenlabs/conversational_ai/raw_client.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/conversational_ai/raw_client.py
MIT
async def add_to_knowledge_base( self, *, name: typing.Optional[str] = OMIT, url: typing.Optional[str] = OMIT, file: typing.Optional[core.File] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[AddKnowledgeBaseResponseModel]: ...
Upload a file or webpage URL to create a knowledge base document. <br> <Note> After creating the document, update the agent's knowledge base by calling [Update agent](/docs/conversational-ai/api-reference/agents/update-agent). </Note> Parameters ---------- name : typing.Optional[str] ...
add_to_knowledge_base
python
elevenlabs/elevenlabs-python
src/elevenlabs/conversational_ai/raw_client.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/conversational_ai/raw_client.py
MIT
async def get_document_rag_indexes( self, documentation_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[RagDocumentIndexesResponseModel]: """ Provides information about all RAG indexes of the specified knowledgebase document. Parameters ...
Provides information about all RAG indexes of the specified knowledgebase document. Parameters ---------- documentation_id : str The id of a document from the knowledge base. This is returned on document addition. request_options : typing.Optional[RequestOptions] ...
get_document_rag_indexes
python
elevenlabs/elevenlabs-python
src/elevenlabs/conversational_ai/raw_client.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/conversational_ai/raw_client.py
MIT
async def delete_document_rag_index( self, documentation_id: str, rag_index_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[RagDocumentIndexResponseModel]: """ Delete RAG index for the knowledgebase document. Parameters ---------- ...
Delete RAG index for the knowledgebase document. Parameters ---------- documentation_id : str The id of a document from the knowledge base. This is returned on document addition. rag_index_id : str The id of RAG index of document from the knowledge base...
delete_document_rag_index
python
elevenlabs/elevenlabs-python
src/elevenlabs/conversational_ai/raw_client.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/conversational_ai/raw_client.py
MIT
async def rag_index_overview( self, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[RagIndexOverviewResponseModel]: """ Provides total size and other information of RAG indexes used by knowledgebase documents Parameters ---------- re...
Provides total size and other information of RAG indexes used by knowledgebase documents Parameters ---------- request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[RagIndexOverviewRespon...
rag_index_overview
python
elevenlabs/elevenlabs-python
src/elevenlabs/conversational_ai/raw_client.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/conversational_ai/raw_client.py
MIT
async def update_secret( self, secret_id: str, *, name: str, value: str, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[PostWorkspaceSecretResponseModel]: """ Update an existing secret for the workspace Parameters ---------- secret_id ...
Update an existing secret for the workspace Parameters ---------- secret_id : str name : str value : str request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHttpResponse[P...
update_secret
python
elevenlabs/elevenlabs-python
src/elevenlabs/conversational_ai/raw_client.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/conversational_ai/raw_client.py
MIT
def create( self, *, conversation_config: ConversationalConfig, platform_settings: typing.Optional[AgentPlatformSettingsRequestModel] = OMIT, name: typing.Optional[str] = OMIT, tags: typing.Optional[typing.Sequence[str]] = OMIT, request_options: typing.Optional[Re...
Create an agent from a config object Parameters ---------- conversation_config : ConversationalConfig Conversation configuration for an agent platform_settings : typing.Optional[AgentPlatformSettingsRequestModel] Platform settings for the agent are all ...
create
python
elevenlabs/elevenlabs-python
src/elevenlabs/conversational_ai/agents/client.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/conversational_ai/agents/client.py
MIT
def update( self, agent_id: str, *, conversation_config: typing.Optional[ConversationalConfig] = OMIT, platform_settings: typing.Optional[AgentPlatformSettingsRequestModel] = OMIT, name: typing.Optional[str] = OMIT, tags: typing.Optional[typing.Sequence[str]] = OM...
Patches an Agent settings Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. conversation_config : typing.Optional[ConversationalConfig] Conversation configuration for an agent platform_settings : typin...
update
python
elevenlabs/elevenlabs-python
src/elevenlabs/conversational_ai/agents/client.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/conversational_ai/agents/client.py
MIT
def list( self, *, cursor: typing.Optional[str] = None, page_size: typing.Optional[int] = None, search: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> GetAgentsPageResponseModel: """ Returns a list of your ag...
Returns a list of your agents and their metadata. Parameters ---------- cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. page_size : typing.Optional[int] How many Agents to return at maximum. Can not exceed ...
list
python
elevenlabs/elevenlabs-python
src/elevenlabs/conversational_ai/agents/client.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/conversational_ai/agents/client.py
MIT
def simulate_conversation( self, agent_id: str, *, simulation_specification: ConversationSimulationSpecification, extra_evaluation_criteria: typing.Optional[typing.Sequence[PromptEvaluationCriteria]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -...
Run a conversation between the agent and a simulated user. Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. simulation_specification : ConversationSimulationSpecification A specification detailing how the conv...
simulate_conversation
python
elevenlabs/elevenlabs-python
src/elevenlabs/conversational_ai/agents/client.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/conversational_ai/agents/client.py
MIT
def simulate_conversation_stream( self, agent_id: str, *, simulation_specification: ConversationSimulationSpecification, extra_evaluation_criteria: typing.Optional[typing.Sequence[PromptEvaluationCriteria]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ...
Run a conversation between the agent and a simulated user and stream back the response. Response is streamed back as partial lists of messages that should be concatenated and once the conversation has complete a single final message with the conversation analysis will be sent. Parameters -----...
simulate_conversation_stream
python
elevenlabs/elevenlabs-python
src/elevenlabs/conversational_ai/agents/client.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/conversational_ai/agents/client.py
MIT
async def create( self, *, conversation_config: ConversationalConfig, platform_settings: typing.Optional[AgentPlatformSettingsRequestModel] = OMIT, name: typing.Optional[str] = OMIT, tags: typing.Optional[typing.Sequence[str]] = OMIT, request_options: typing.Optio...
Create an agent from a config object Parameters ---------- conversation_config : ConversationalConfig Conversation configuration for an agent platform_settings : typing.Optional[AgentPlatformSettingsRequestModel] Platform settings for the agent are all ...
create
python
elevenlabs/elevenlabs-python
src/elevenlabs/conversational_ai/agents/client.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/conversational_ai/agents/client.py
MIT
async def get( self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> GetAgentResponseModel: """ Retrieve config for an agent Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. ...
Retrieve config for an agent Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- GetAgent...
get
python
elevenlabs/elevenlabs-python
src/elevenlabs/conversational_ai/agents/client.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/conversational_ai/agents/client.py
MIT
async def delete(self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None: """ Delete an agent Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. request_options : typing.Optional[Requ...
Delete an agent Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- None Example...
delete
python
elevenlabs/elevenlabs-python
src/elevenlabs/conversational_ai/agents/client.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/conversational_ai/agents/client.py
MIT
async def update( self, agent_id: str, *, conversation_config: typing.Optional[ConversationalConfig] = OMIT, platform_settings: typing.Optional[AgentPlatformSettingsRequestModel] = OMIT, name: typing.Optional[str] = OMIT, tags: typing.Optional[typing.Sequence[str]...
Patches an Agent settings Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. conversation_config : typing.Optional[ConversationalConfig] Conversation configuration for an agent platform_settings : typin...
update
python
elevenlabs/elevenlabs-python
src/elevenlabs/conversational_ai/agents/client.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/conversational_ai/agents/client.py
MIT
async def list( self, *, cursor: typing.Optional[str] = None, page_size: typing.Optional[int] = None, search: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> GetAgentsPageResponseModel: """ Returns a list of y...
Returns a list of your agents and their metadata. Parameters ---------- cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. page_size : typing.Optional[int] How many Agents to return at maximum. Can not exceed ...
list
python
elevenlabs/elevenlabs-python
src/elevenlabs/conversational_ai/agents/client.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/conversational_ai/agents/client.py
MIT
async def simulate_conversation( self, agent_id: str, *, simulation_specification: ConversationSimulationSpecification, extra_evaluation_criteria: typing.Optional[typing.Sequence[PromptEvaluationCriteria]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ...
Run a conversation between the agent and a simulated user. Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. simulation_specification : ConversationSimulationSpecification A specification detailing how the conv...
simulate_conversation
python
elevenlabs/elevenlabs-python
src/elevenlabs/conversational_ai/agents/client.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/conversational_ai/agents/client.py
MIT
async def simulate_conversation_stream( self, agent_id: str, *, simulation_specification: ConversationSimulationSpecification, extra_evaluation_criteria: typing.Optional[typing.Sequence[PromptEvaluationCriteria]] = OMIT, request_options: typing.Optional[RequestOptions] = ...
Run a conversation between the agent and a simulated user and stream back the response. Response is streamed back as partial lists of messages that should be concatenated and once the conversation has complete a single final message with the conversation analysis will be sent. Parameters -----...
simulate_conversation_stream
python
elevenlabs/elevenlabs-python
src/elevenlabs/conversational_ai/agents/client.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/conversational_ai/agents/client.py
MIT
def create( self, *, conversation_config: ConversationalConfig, platform_settings: typing.Optional[AgentPlatformSettingsRequestModel] = OMIT, name: typing.Optional[str] = OMIT, tags: typing.Optional[typing.Sequence[str]] = OMIT, request_options: typing.Optional[Re...
Create an agent from a config object Parameters ---------- conversation_config : ConversationalConfig Conversation configuration for an agent platform_settings : typing.Optional[AgentPlatformSettingsRequestModel] Platform settings for the agent are all ...
create
python
elevenlabs/elevenlabs-python
src/elevenlabs/conversational_ai/agents/raw_client.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/conversational_ai/agents/raw_client.py
MIT
def get( self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[GetAgentResponseModel]: """ Retrieve config for an agent Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation...
Retrieve config for an agent Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResp...
get
python
elevenlabs/elevenlabs-python
src/elevenlabs/conversational_ai/agents/raw_client.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/conversational_ai/agents/raw_client.py
MIT
def delete(self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> HttpResponse[None]: """ Delete an agent Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. request_options : typing.Optio...
Delete an agent Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- HttpResponse[None] ...
delete
python
elevenlabs/elevenlabs-python
src/elevenlabs/conversational_ai/agents/raw_client.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/conversational_ai/agents/raw_client.py
MIT
def update( self, agent_id: str, *, conversation_config: typing.Optional[ConversationalConfig] = OMIT, platform_settings: typing.Optional[AgentPlatformSettingsRequestModel] = OMIT, name: typing.Optional[str] = OMIT, tags: typing.Optional[typing.Sequence[str]] = OM...
Patches an Agent settings Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. conversation_config : typing.Optional[ConversationalConfig] Conversation configuration for an agent platform_settings : typin...
update
python
elevenlabs/elevenlabs-python
src/elevenlabs/conversational_ai/agents/raw_client.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/conversational_ai/agents/raw_client.py
MIT
def list( self, *, cursor: typing.Optional[str] = None, page_size: typing.Optional[int] = None, search: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[GetAgentsPageResponseModel]: """ Returns a l...
Returns a list of your agents and their metadata. Parameters ---------- cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. page_size : typing.Optional[int] How many Agents to return at maximum. Can not exceed ...
list
python
elevenlabs/elevenlabs-python
src/elevenlabs/conversational_ai/agents/raw_client.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/conversational_ai/agents/raw_client.py
MIT
def simulate_conversation( self, agent_id: str, *, simulation_specification: ConversationSimulationSpecification, extra_evaluation_criteria: typing.Optional[typing.Sequence[PromptEvaluationCriteria]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -...
Run a conversation between the agent and a simulated user. Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. simulation_specification : ConversationSimulationSpecification A specification detailing how the conv...
simulate_conversation
python
elevenlabs/elevenlabs-python
src/elevenlabs/conversational_ai/agents/raw_client.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/conversational_ai/agents/raw_client.py
MIT
def simulate_conversation_stream( self, agent_id: str, *, simulation_specification: ConversationSimulationSpecification, extra_evaluation_criteria: typing.Optional[typing.Sequence[PromptEvaluationCriteria]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ...
Run a conversation between the agent and a simulated user and stream back the response. Response is streamed back as partial lists of messages that should be concatenated and once the conversation has complete a single final message with the conversation analysis will be sent. Parameters -----...
simulate_conversation_stream
python
elevenlabs/elevenlabs-python
src/elevenlabs/conversational_ai/agents/raw_client.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/conversational_ai/agents/raw_client.py
MIT
async def create( self, *, conversation_config: ConversationalConfig, platform_settings: typing.Optional[AgentPlatformSettingsRequestModel] = OMIT, name: typing.Optional[str] = OMIT, tags: typing.Optional[typing.Sequence[str]] = OMIT, request_options: typing.Optio...
Create an agent from a config object Parameters ---------- conversation_config : ConversationalConfig Conversation configuration for an agent platform_settings : typing.Optional[AgentPlatformSettingsRequestModel] Platform settings for the agent are all ...
create
python
elevenlabs/elevenlabs-python
src/elevenlabs/conversational_ai/agents/raw_client.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/conversational_ai/agents/raw_client.py
MIT
async def get( self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[GetAgentResponseModel]: """ Retrieve config for an agent Parameters ---------- agent_id : str The id of an agent. This is returned on age...
Retrieve config for an agent Parameters ---------- agent_id : str The id of an agent. This is returned on agent creation. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- AsyncHtt...
get
python
elevenlabs/elevenlabs-python
src/elevenlabs/conversational_ai/agents/raw_client.py
https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/conversational_ai/agents/raw_client.py
MIT