llama-cloud 0.0.4__tar.gz → 0.0.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of llama-cloud might be problematic. Click here for more details.
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/PKG-INFO +1 -1
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/__init__.py +0 -8
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/client.py +0 -9
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/resources/__init__.py +1 -16
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/__init__.py +0 -2
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/pyproject.toml +1 -1
- llama_cloud-0.0.4/llama_cloud/resources/api_keys/client.py +0 -297
- llama_cloud-0.0.4/llama_cloud/resources/billing/client.py +0 -231
- llama_cloud-0.0.4/llama_cloud/resources/deprecated/client.py +0 -961
- llama_cloud-0.0.4/llama_cloud/resources/evals/__init__.py +0 -2
- llama_cloud-0.0.4/llama_cloud/resources/parsing/__init__.py +0 -2
- llama_cloud-0.0.4/llama_cloud/resources/projects/__init__.py +0 -2
- llama_cloud-0.0.4/llama_cloud/types/api_key.py +0 -40
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/LICENSE +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/README.md +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/core/__init__.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/core/api_error.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/core/client_wrapper.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/core/datetime_utils.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/core/jsonable_encoder.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/core/remove_none_from_dict.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/environment.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/errors/__init__.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/errors/unprocessable_entity_error.py +0 -0
- {llama_cloud-0.0.4/llama_cloud/resources/api_keys → llama_cloud-0.0.5/llama_cloud/resources/component_definitions}/__init__.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/resources/component_definitions/client.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/resources/data_sinks/__init__.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/resources/data_sinks/client.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/resources/data_sinks/types/__init__.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/resources/data_sinks/types/data_sink_update_component.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/resources/data_sinks/types/data_sink_update_component_one.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/resources/data_sources/__init__.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/resources/data_sources/client.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/resources/data_sources/types/__init__.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/resources/data_sources/types/data_source_update_component.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/resources/data_sources/types/data_source_update_component_one.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/resources/data_sources/types/data_source_update_custom_metadata_value.py +0 -0
- {llama_cloud-0.0.4/llama_cloud/resources/billing → llama_cloud-0.0.5/llama_cloud/resources/evals}/__init__.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/resources/evals/client.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/resources/files/__init__.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/resources/files/client.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/resources/files/types/__init__.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/resources/files/types/file_create_resource_info_value.py +0 -0
- {llama_cloud-0.0.4/llama_cloud/resources/component_definitions → llama_cloud-0.0.5/llama_cloud/resources/parsing}/__init__.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/resources/parsing/client.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/resources/pipelines/__init__.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/resources/pipelines/client.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/resources/pipelines/types/__init__.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/resources/pipelines/types/pipeline_file_update_custom_metadata_value.py +0 -0
- {llama_cloud-0.0.4/llama_cloud/resources/deprecated → llama_cloud-0.0.5/llama_cloud/resources/projects}/__init__.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/resources/projects/client.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/azure_open_ai_embedding.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/base.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/base_prompt_template.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/bedrock_embedding.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/chat_message.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/cloud_az_storage_blob_data_source.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/cloud_chroma_vector_store.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/cloud_document.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/cloud_document_create.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/cloud_gcs_data_source.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/cloud_google_drive_data_source.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/cloud_one_drive_data_source.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/cloud_pinecone_vector_store.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/cloud_postgres_vector_store.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/cloud_qdrant_vector_store.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/cloud_s_3_data_source.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/cloud_sharepoint_data_source.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/cloud_weaviate_vector_store.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/code_splitter.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/cohere_embedding.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/configurable_data_sink_names.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/configurable_data_source_names.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/configurable_transformation_definition.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/configurable_transformation_names.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/configured_transformation_item.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/configured_transformation_item_component.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/configured_transformation_item_component_one.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/data_sink.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/data_sink_component.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/data_sink_component_one.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/data_sink_create.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/data_sink_create_component.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/data_sink_create_component_one.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/data_sink_definition.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/data_source.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/data_source_component.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/data_source_component_one.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/data_source_create.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/data_source_create_component.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/data_source_create_component_one.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/data_source_create_custom_metadata_value.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/data_source_custom_metadata_value.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/data_source_definition.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/eval_dataset.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/eval_dataset_job_params.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/eval_dataset_job_record.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/eval_execution_params.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/eval_execution_params_override.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/eval_llm_model_data.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/eval_question.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/eval_question_create.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/eval_question_result.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/file.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/file_resource_info_value.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/filter_condition.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/filter_operator.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/gemini_embedding.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/html_node_parser.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/http_validation_error.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/hugging_face_inference_api_embedding.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/hugging_face_inference_api_embedding_token.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/json_node_parser.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/llama_parse_supported_file_extensions.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/llm.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/local_eval.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/local_eval_results.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/local_eval_sets.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/managed_ingestion_status.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/markdown_element_node_parser.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/markdown_node_parser.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/message_role.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/metadata_filter.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/metadata_filter_value.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/metadata_filters.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/metadata_filters_filters_item.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/metric_result.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/node_parser.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/object_type.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/open_ai_embedding.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/parser_languages.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/parsing_history_item.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/parsing_job.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/parsing_job_json_result.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/parsing_job_markdown_result.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/parsing_job_text_result.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/parsing_usage.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/pipeline.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/pipeline_create.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/pipeline_data_source.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/pipeline_data_source_component.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/pipeline_data_source_component_one.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/pipeline_data_source_create.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/pipeline_data_source_custom_metadata_value.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/pipeline_deployment.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/pipeline_file.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/pipeline_file_create.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/pipeline_file_create_custom_metadata_value.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/pipeline_file_custom_metadata_value.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/pipeline_file_resource_info_value.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/pipeline_file_status_response.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/pipeline_type.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/pooling.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/preset_retrieval_params.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/presigned_url.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/project.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/project_create.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/prompt_mixin_prompts.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/prompt_spec.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/pydantic_program_mode.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/related_node_info.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/retrieve_results.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/sentence_splitter.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/simple_file_node_parser.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/status_enum.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/supported_eval_llm_model.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/supported_eval_llm_model_names.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/text_node.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/text_node_relationships_value.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/text_node_with_score.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/token_text_splitter.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/transformation_category_names.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/validation_error.py +0 -0
- {llama_cloud-0.0.4 → llama_cloud-0.0.5}/llama_cloud/types/validation_error_loc_item.py +0 -0
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
3
|
from .types import (
|
|
4
|
-
ApiKey,
|
|
5
4
|
AzureOpenAiEmbedding,
|
|
6
5
|
Base,
|
|
7
6
|
BasePromptTemplate,
|
|
@@ -135,12 +134,9 @@ from .resources import (
|
|
|
135
134
|
DataSourceUpdateCustomMetadataValue,
|
|
136
135
|
FileCreateResourceInfoValue,
|
|
137
136
|
PipelineFileUpdateCustomMetadataValue,
|
|
138
|
-
api_keys,
|
|
139
|
-
billing,
|
|
140
137
|
component_definitions,
|
|
141
138
|
data_sinks,
|
|
142
139
|
data_sources,
|
|
143
|
-
deprecated,
|
|
144
140
|
evals,
|
|
145
141
|
files,
|
|
146
142
|
parsing,
|
|
@@ -150,7 +146,6 @@ from .resources import (
|
|
|
150
146
|
from .environment import LlamaCloudEnvironment
|
|
151
147
|
|
|
152
148
|
__all__ = [
|
|
153
|
-
"ApiKey",
|
|
154
149
|
"AzureOpenAiEmbedding",
|
|
155
150
|
"Base",
|
|
156
151
|
"BasePromptTemplate",
|
|
@@ -283,12 +278,9 @@ __all__ = [
|
|
|
283
278
|
"UnprocessableEntityError",
|
|
284
279
|
"ValidationError",
|
|
285
280
|
"ValidationErrorLocItem",
|
|
286
|
-
"api_keys",
|
|
287
|
-
"billing",
|
|
288
281
|
"component_definitions",
|
|
289
282
|
"data_sinks",
|
|
290
283
|
"data_sources",
|
|
291
|
-
"deprecated",
|
|
292
284
|
"evals",
|
|
293
285
|
"files",
|
|
294
286
|
"parsing",
|
|
@@ -6,12 +6,9 @@ import httpx
|
|
|
6
6
|
|
|
7
7
|
from .core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
8
8
|
from .environment import LlamaCloudEnvironment
|
|
9
|
-
from .resources.api_keys.client import ApiKeysClient, AsyncApiKeysClient
|
|
10
|
-
from .resources.billing.client import AsyncBillingClient, BillingClient
|
|
11
9
|
from .resources.component_definitions.client import AsyncComponentDefinitionsClient, ComponentDefinitionsClient
|
|
12
10
|
from .resources.data_sinks.client import AsyncDataSinksClient, DataSinksClient
|
|
13
11
|
from .resources.data_sources.client import AsyncDataSourcesClient, DataSourcesClient
|
|
14
|
-
from .resources.deprecated.client import AsyncDeprecatedClient, DeprecatedClient
|
|
15
12
|
from .resources.evals.client import AsyncEvalsClient, EvalsClient
|
|
16
13
|
from .resources.files.client import AsyncFilesClient, FilesClient
|
|
17
14
|
from .resources.parsing.client import AsyncParsingClient, ParsingClient
|
|
@@ -34,7 +31,6 @@ class LlamaCloud:
|
|
|
34
31
|
token=token,
|
|
35
32
|
httpx_client=httpx.Client(timeout=timeout) if httpx_client is None else httpx_client,
|
|
36
33
|
)
|
|
37
|
-
self.api_keys = ApiKeysClient(client_wrapper=self._client_wrapper)
|
|
38
34
|
self.data_sinks = DataSinksClient(client_wrapper=self._client_wrapper)
|
|
39
35
|
self.data_sources = DataSourcesClient(client_wrapper=self._client_wrapper)
|
|
40
36
|
self.projects = ProjectsClient(client_wrapper=self._client_wrapper)
|
|
@@ -43,8 +39,6 @@ class LlamaCloud:
|
|
|
43
39
|
self.evals = EvalsClient(client_wrapper=self._client_wrapper)
|
|
44
40
|
self.parsing = ParsingClient(client_wrapper=self._client_wrapper)
|
|
45
41
|
self.component_definitions = ComponentDefinitionsClient(client_wrapper=self._client_wrapper)
|
|
46
|
-
self.billing = BillingClient(client_wrapper=self._client_wrapper)
|
|
47
|
-
self.deprecated = DeprecatedClient(client_wrapper=self._client_wrapper)
|
|
48
42
|
|
|
49
43
|
|
|
50
44
|
class AsyncLlamaCloud:
|
|
@@ -62,7 +56,6 @@ class AsyncLlamaCloud:
|
|
|
62
56
|
token=token,
|
|
63
57
|
httpx_client=httpx.AsyncClient(timeout=timeout) if httpx_client is None else httpx_client,
|
|
64
58
|
)
|
|
65
|
-
self.api_keys = AsyncApiKeysClient(client_wrapper=self._client_wrapper)
|
|
66
59
|
self.data_sinks = AsyncDataSinksClient(client_wrapper=self._client_wrapper)
|
|
67
60
|
self.data_sources = AsyncDataSourcesClient(client_wrapper=self._client_wrapper)
|
|
68
61
|
self.projects = AsyncProjectsClient(client_wrapper=self._client_wrapper)
|
|
@@ -71,8 +64,6 @@ class AsyncLlamaCloud:
|
|
|
71
64
|
self.evals = AsyncEvalsClient(client_wrapper=self._client_wrapper)
|
|
72
65
|
self.parsing = AsyncParsingClient(client_wrapper=self._client_wrapper)
|
|
73
66
|
self.component_definitions = AsyncComponentDefinitionsClient(client_wrapper=self._client_wrapper)
|
|
74
|
-
self.billing = AsyncBillingClient(client_wrapper=self._client_wrapper)
|
|
75
|
-
self.deprecated = AsyncDeprecatedClient(client_wrapper=self._client_wrapper)
|
|
76
67
|
|
|
77
68
|
|
|
78
69
|
def _get_base_url(*, base_url: typing.Optional[str] = None, environment: LlamaCloudEnvironment) -> str:
|
|
@@ -1,18 +1,6 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
-
from . import
|
|
4
|
-
api_keys,
|
|
5
|
-
billing,
|
|
6
|
-
component_definitions,
|
|
7
|
-
data_sinks,
|
|
8
|
-
data_sources,
|
|
9
|
-
deprecated,
|
|
10
|
-
evals,
|
|
11
|
-
files,
|
|
12
|
-
parsing,
|
|
13
|
-
pipelines,
|
|
14
|
-
projects,
|
|
15
|
-
)
|
|
3
|
+
from . import component_definitions, data_sinks, data_sources, evals, files, parsing, pipelines, projects
|
|
16
4
|
from .data_sinks import DataSinkUpdateComponent, DataSinkUpdateComponentOne
|
|
17
5
|
from .data_sources import DataSourceUpdateComponent, DataSourceUpdateComponentOne, DataSourceUpdateCustomMetadataValue
|
|
18
6
|
from .files import FileCreateResourceInfoValue
|
|
@@ -26,12 +14,9 @@ __all__ = [
|
|
|
26
14
|
"DataSourceUpdateCustomMetadataValue",
|
|
27
15
|
"FileCreateResourceInfoValue",
|
|
28
16
|
"PipelineFileUpdateCustomMetadataValue",
|
|
29
|
-
"api_keys",
|
|
30
|
-
"billing",
|
|
31
17
|
"component_definitions",
|
|
32
18
|
"data_sinks",
|
|
33
19
|
"data_sources",
|
|
34
|
-
"deprecated",
|
|
35
20
|
"evals",
|
|
36
21
|
"files",
|
|
37
22
|
"parsing",
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
-
from .api_key import ApiKey
|
|
4
3
|
from .azure_open_ai_embedding import AzureOpenAiEmbedding
|
|
5
4
|
from .base import Base
|
|
6
5
|
from .base_prompt_template import BasePromptTemplate
|
|
@@ -126,7 +125,6 @@ from .validation_error import ValidationError
|
|
|
126
125
|
from .validation_error_loc_item import ValidationErrorLocItem
|
|
127
126
|
|
|
128
127
|
__all__ = [
|
|
129
|
-
"ApiKey",
|
|
130
128
|
"AzureOpenAiEmbedding",
|
|
131
129
|
"Base",
|
|
132
130
|
"BasePromptTemplate",
|
|
@@ -1,297 +0,0 @@
|
|
|
1
|
-
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
-
|
|
3
|
-
import typing
|
|
4
|
-
import urllib.parse
|
|
5
|
-
from json.decoder import JSONDecodeError
|
|
6
|
-
|
|
7
|
-
from ...core.api_error import ApiError
|
|
8
|
-
from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
9
|
-
from ...core.jsonable_encoder import jsonable_encoder
|
|
10
|
-
from ...errors.unprocessable_entity_error import UnprocessableEntityError
|
|
11
|
-
from ...types.api_key import ApiKey
|
|
12
|
-
from ...types.http_validation_error import HttpValidationError
|
|
13
|
-
|
|
14
|
-
try:
|
|
15
|
-
import pydantic
|
|
16
|
-
if pydantic.__version__.startswith("1."):
|
|
17
|
-
raise ImportError
|
|
18
|
-
import pydantic.v1 as pydantic # type: ignore
|
|
19
|
-
except ImportError:
|
|
20
|
-
import pydantic # type: ignore
|
|
21
|
-
|
|
22
|
-
# this is used as the default value for optional parameters
|
|
23
|
-
OMIT = typing.cast(typing.Any, ...)
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
class ApiKeysClient:
|
|
27
|
-
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
28
|
-
self._client_wrapper = client_wrapper
|
|
29
|
-
|
|
30
|
-
def get_keys(self) -> typing.List[ApiKey]:
|
|
31
|
-
"""
|
|
32
|
-
Get all API Keys for a user.
|
|
33
|
-
|
|
34
|
-
---
|
|
35
|
-
from llama_cloud.client import LlamaCloud
|
|
36
|
-
|
|
37
|
-
client = LlamaCloud(
|
|
38
|
-
token="YOUR_TOKEN",
|
|
39
|
-
)
|
|
40
|
-
client.api_keys.get_keys()
|
|
41
|
-
"""
|
|
42
|
-
_response = self._client_wrapper.httpx_client.request(
|
|
43
|
-
"GET",
|
|
44
|
-
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/api-keys"),
|
|
45
|
-
headers=self._client_wrapper.get_headers(),
|
|
46
|
-
timeout=60,
|
|
47
|
-
)
|
|
48
|
-
if 200 <= _response.status_code < 300:
|
|
49
|
-
return pydantic.parse_obj_as(typing.List[ApiKey], _response.json()) # type: ignore
|
|
50
|
-
if _response.status_code == 422:
|
|
51
|
-
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
|
|
52
|
-
try:
|
|
53
|
-
_response_json = _response.json()
|
|
54
|
-
except JSONDecodeError:
|
|
55
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
56
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
57
|
-
|
|
58
|
-
def generate_key(self, *, name: typing.Optional[str] = OMIT) -> ApiKey:
|
|
59
|
-
"""
|
|
60
|
-
Generate a new API Key.
|
|
61
|
-
|
|
62
|
-
Parameters:
|
|
63
|
-
- name: typing.Optional[str].
|
|
64
|
-
---
|
|
65
|
-
from llama_cloud.client import LlamaCloud
|
|
66
|
-
|
|
67
|
-
client = LlamaCloud(
|
|
68
|
-
token="YOUR_TOKEN",
|
|
69
|
-
)
|
|
70
|
-
client.api_keys.generate_key()
|
|
71
|
-
"""
|
|
72
|
-
_request: typing.Dict[str, typing.Any] = {}
|
|
73
|
-
if name is not OMIT:
|
|
74
|
-
_request["name"] = name
|
|
75
|
-
_response = self._client_wrapper.httpx_client.request(
|
|
76
|
-
"POST",
|
|
77
|
-
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/api-keys"),
|
|
78
|
-
json=jsonable_encoder(_request),
|
|
79
|
-
headers=self._client_wrapper.get_headers(),
|
|
80
|
-
timeout=60,
|
|
81
|
-
)
|
|
82
|
-
if 200 <= _response.status_code < 300:
|
|
83
|
-
return pydantic.parse_obj_as(ApiKey, _response.json()) # type: ignore
|
|
84
|
-
if _response.status_code == 422:
|
|
85
|
-
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
|
|
86
|
-
try:
|
|
87
|
-
_response_json = _response.json()
|
|
88
|
-
except JSONDecodeError:
|
|
89
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
90
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
91
|
-
|
|
92
|
-
def update_existing_api_key(self, api_key_id: str, *, name: typing.Optional[str] = OMIT) -> ApiKey:
|
|
93
|
-
"""
|
|
94
|
-
Update name of an existing API Key.
|
|
95
|
-
|
|
96
|
-
Parameters:
|
|
97
|
-
- api_key_id: str.
|
|
98
|
-
|
|
99
|
-
- name: typing.Optional[str].
|
|
100
|
-
---
|
|
101
|
-
from llama_cloud.client import LlamaCloud
|
|
102
|
-
|
|
103
|
-
client = LlamaCloud(
|
|
104
|
-
token="YOUR_TOKEN",
|
|
105
|
-
)
|
|
106
|
-
client.api_keys.update_existing_api_key(
|
|
107
|
-
api_key_id="string",
|
|
108
|
-
)
|
|
109
|
-
"""
|
|
110
|
-
_request: typing.Dict[str, typing.Any] = {}
|
|
111
|
-
if name is not OMIT:
|
|
112
|
-
_request["name"] = name
|
|
113
|
-
_response = self._client_wrapper.httpx_client.request(
|
|
114
|
-
"PUT",
|
|
115
|
-
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/api-keys/{api_key_id}"),
|
|
116
|
-
json=jsonable_encoder(_request),
|
|
117
|
-
headers=self._client_wrapper.get_headers(),
|
|
118
|
-
timeout=60,
|
|
119
|
-
)
|
|
120
|
-
if 200 <= _response.status_code < 300:
|
|
121
|
-
return pydantic.parse_obj_as(ApiKey, _response.json()) # type: ignore
|
|
122
|
-
if _response.status_code == 422:
|
|
123
|
-
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
|
|
124
|
-
try:
|
|
125
|
-
_response_json = _response.json()
|
|
126
|
-
except JSONDecodeError:
|
|
127
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
128
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
129
|
-
|
|
130
|
-
def delete_api_key(self, api_key_id: str) -> None:
|
|
131
|
-
"""
|
|
132
|
-
Delete an API Key by ID.
|
|
133
|
-
|
|
134
|
-
Parameters:
|
|
135
|
-
- api_key_id: str.
|
|
136
|
-
---
|
|
137
|
-
from llama_cloud.client import LlamaCloud
|
|
138
|
-
|
|
139
|
-
client = LlamaCloud(
|
|
140
|
-
token="YOUR_TOKEN",
|
|
141
|
-
)
|
|
142
|
-
client.api_keys.delete_api_key(
|
|
143
|
-
api_key_id="string",
|
|
144
|
-
)
|
|
145
|
-
"""
|
|
146
|
-
_response = self._client_wrapper.httpx_client.request(
|
|
147
|
-
"DELETE",
|
|
148
|
-
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/api-keys/{api_key_id}"),
|
|
149
|
-
headers=self._client_wrapper.get_headers(),
|
|
150
|
-
timeout=60,
|
|
151
|
-
)
|
|
152
|
-
if 200 <= _response.status_code < 300:
|
|
153
|
-
return
|
|
154
|
-
if _response.status_code == 422:
|
|
155
|
-
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
|
|
156
|
-
try:
|
|
157
|
-
_response_json = _response.json()
|
|
158
|
-
except JSONDecodeError:
|
|
159
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
160
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
class AsyncApiKeysClient:
|
|
164
|
-
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
165
|
-
self._client_wrapper = client_wrapper
|
|
166
|
-
|
|
167
|
-
async def get_keys(self) -> typing.List[ApiKey]:
|
|
168
|
-
"""
|
|
169
|
-
Get all API Keys for a user.
|
|
170
|
-
|
|
171
|
-
---
|
|
172
|
-
from llama_cloud.client import AsyncLlamaCloud
|
|
173
|
-
|
|
174
|
-
client = AsyncLlamaCloud(
|
|
175
|
-
token="YOUR_TOKEN",
|
|
176
|
-
)
|
|
177
|
-
await client.api_keys.get_keys()
|
|
178
|
-
"""
|
|
179
|
-
_response = await self._client_wrapper.httpx_client.request(
|
|
180
|
-
"GET",
|
|
181
|
-
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/api-keys"),
|
|
182
|
-
headers=self._client_wrapper.get_headers(),
|
|
183
|
-
timeout=60,
|
|
184
|
-
)
|
|
185
|
-
if 200 <= _response.status_code < 300:
|
|
186
|
-
return pydantic.parse_obj_as(typing.List[ApiKey], _response.json()) # type: ignore
|
|
187
|
-
if _response.status_code == 422:
|
|
188
|
-
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
|
|
189
|
-
try:
|
|
190
|
-
_response_json = _response.json()
|
|
191
|
-
except JSONDecodeError:
|
|
192
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
193
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
194
|
-
|
|
195
|
-
async def generate_key(self, *, name: typing.Optional[str] = OMIT) -> ApiKey:
|
|
196
|
-
"""
|
|
197
|
-
Generate a new API Key.
|
|
198
|
-
|
|
199
|
-
Parameters:
|
|
200
|
-
- name: typing.Optional[str].
|
|
201
|
-
---
|
|
202
|
-
from llama_cloud.client import AsyncLlamaCloud
|
|
203
|
-
|
|
204
|
-
client = AsyncLlamaCloud(
|
|
205
|
-
token="YOUR_TOKEN",
|
|
206
|
-
)
|
|
207
|
-
await client.api_keys.generate_key()
|
|
208
|
-
"""
|
|
209
|
-
_request: typing.Dict[str, typing.Any] = {}
|
|
210
|
-
if name is not OMIT:
|
|
211
|
-
_request["name"] = name
|
|
212
|
-
_response = await self._client_wrapper.httpx_client.request(
|
|
213
|
-
"POST",
|
|
214
|
-
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/api-keys"),
|
|
215
|
-
json=jsonable_encoder(_request),
|
|
216
|
-
headers=self._client_wrapper.get_headers(),
|
|
217
|
-
timeout=60,
|
|
218
|
-
)
|
|
219
|
-
if 200 <= _response.status_code < 300:
|
|
220
|
-
return pydantic.parse_obj_as(ApiKey, _response.json()) # type: ignore
|
|
221
|
-
if _response.status_code == 422:
|
|
222
|
-
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
|
|
223
|
-
try:
|
|
224
|
-
_response_json = _response.json()
|
|
225
|
-
except JSONDecodeError:
|
|
226
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
227
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
228
|
-
|
|
229
|
-
async def update_existing_api_key(self, api_key_id: str, *, name: typing.Optional[str] = OMIT) -> ApiKey:
|
|
230
|
-
"""
|
|
231
|
-
Update name of an existing API Key.
|
|
232
|
-
|
|
233
|
-
Parameters:
|
|
234
|
-
- api_key_id: str.
|
|
235
|
-
|
|
236
|
-
- name: typing.Optional[str].
|
|
237
|
-
---
|
|
238
|
-
from llama_cloud.client import AsyncLlamaCloud
|
|
239
|
-
|
|
240
|
-
client = AsyncLlamaCloud(
|
|
241
|
-
token="YOUR_TOKEN",
|
|
242
|
-
)
|
|
243
|
-
await client.api_keys.update_existing_api_key(
|
|
244
|
-
api_key_id="string",
|
|
245
|
-
)
|
|
246
|
-
"""
|
|
247
|
-
_request: typing.Dict[str, typing.Any] = {}
|
|
248
|
-
if name is not OMIT:
|
|
249
|
-
_request["name"] = name
|
|
250
|
-
_response = await self._client_wrapper.httpx_client.request(
|
|
251
|
-
"PUT",
|
|
252
|
-
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/api-keys/{api_key_id}"),
|
|
253
|
-
json=jsonable_encoder(_request),
|
|
254
|
-
headers=self._client_wrapper.get_headers(),
|
|
255
|
-
timeout=60,
|
|
256
|
-
)
|
|
257
|
-
if 200 <= _response.status_code < 300:
|
|
258
|
-
return pydantic.parse_obj_as(ApiKey, _response.json()) # type: ignore
|
|
259
|
-
if _response.status_code == 422:
|
|
260
|
-
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
|
|
261
|
-
try:
|
|
262
|
-
_response_json = _response.json()
|
|
263
|
-
except JSONDecodeError:
|
|
264
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
265
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
266
|
-
|
|
267
|
-
async def delete_api_key(self, api_key_id: str) -> None:
|
|
268
|
-
"""
|
|
269
|
-
Delete an API Key by ID.
|
|
270
|
-
|
|
271
|
-
Parameters:
|
|
272
|
-
- api_key_id: str.
|
|
273
|
-
---
|
|
274
|
-
from llama_cloud.client import AsyncLlamaCloud
|
|
275
|
-
|
|
276
|
-
client = AsyncLlamaCloud(
|
|
277
|
-
token="YOUR_TOKEN",
|
|
278
|
-
)
|
|
279
|
-
await client.api_keys.delete_api_key(
|
|
280
|
-
api_key_id="string",
|
|
281
|
-
)
|
|
282
|
-
"""
|
|
283
|
-
_response = await self._client_wrapper.httpx_client.request(
|
|
284
|
-
"DELETE",
|
|
285
|
-
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/api-keys/{api_key_id}"),
|
|
286
|
-
headers=self._client_wrapper.get_headers(),
|
|
287
|
-
timeout=60,
|
|
288
|
-
)
|
|
289
|
-
if 200 <= _response.status_code < 300:
|
|
290
|
-
return
|
|
291
|
-
if _response.status_code == 422:
|
|
292
|
-
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
|
|
293
|
-
try:
|
|
294
|
-
_response_json = _response.json()
|
|
295
|
-
except JSONDecodeError:
|
|
296
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
297
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
@@ -1,231 +0,0 @@
|
|
|
1
|
-
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
-
|
|
3
|
-
import typing
|
|
4
|
-
import urllib.parse
|
|
5
|
-
from json.decoder import JSONDecodeError
|
|
6
|
-
|
|
7
|
-
from ...core.api_error import ApiError
|
|
8
|
-
from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
9
|
-
from ...core.jsonable_encoder import jsonable_encoder
|
|
10
|
-
from ...core.remove_none_from_dict import remove_none_from_dict
|
|
11
|
-
from ...errors.unprocessable_entity_error import UnprocessableEntityError
|
|
12
|
-
from ...types.http_validation_error import HttpValidationError
|
|
13
|
-
|
|
14
|
-
try:
|
|
15
|
-
import pydantic
|
|
16
|
-
if pydantic.__version__.startswith("1."):
|
|
17
|
-
raise ImportError
|
|
18
|
-
import pydantic.v1 as pydantic # type: ignore
|
|
19
|
-
except ImportError:
|
|
20
|
-
import pydantic # type: ignore
|
|
21
|
-
|
|
22
|
-
# this is used as the default value for optional parameters
|
|
23
|
-
OMIT = typing.cast(typing.Any, ...)
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
class BillingClient:
|
|
27
|
-
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
28
|
-
self._client_wrapper = client_wrapper
|
|
29
|
-
|
|
30
|
-
def create_checkout_session(self, *, success_url: str, cancel_url: str) -> str:
|
|
31
|
-
"""
|
|
32
|
-
Create a new checkout session.
|
|
33
|
-
|
|
34
|
-
Parameters:
|
|
35
|
-
- success_url: str.
|
|
36
|
-
|
|
37
|
-
- cancel_url: str.
|
|
38
|
-
---
|
|
39
|
-
from llama_cloud.client import LlamaCloud
|
|
40
|
-
|
|
41
|
-
client = LlamaCloud(
|
|
42
|
-
token="YOUR_TOKEN",
|
|
43
|
-
)
|
|
44
|
-
client.billing.create_checkout_session(
|
|
45
|
-
success_url="string",
|
|
46
|
-
cancel_url="string",
|
|
47
|
-
)
|
|
48
|
-
"""
|
|
49
|
-
_response = self._client_wrapper.httpx_client.request(
|
|
50
|
-
"POST",
|
|
51
|
-
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/billing/checkout-session"),
|
|
52
|
-
json=jsonable_encoder({"success_url": success_url, "cancel_url": cancel_url}),
|
|
53
|
-
headers=self._client_wrapper.get_headers(),
|
|
54
|
-
timeout=60,
|
|
55
|
-
)
|
|
56
|
-
if 200 <= _response.status_code < 300:
|
|
57
|
-
return pydantic.parse_obj_as(str, _response.json()) # type: ignore
|
|
58
|
-
if _response.status_code == 422:
|
|
59
|
-
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
|
|
60
|
-
try:
|
|
61
|
-
_response_json = _response.json()
|
|
62
|
-
except JSONDecodeError:
|
|
63
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
64
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
65
|
-
|
|
66
|
-
def create_customer_portal_session(self, *, return_url: str) -> str:
|
|
67
|
-
"""
|
|
68
|
-
Create a new customer portal session.
|
|
69
|
-
|
|
70
|
-
Parameters:
|
|
71
|
-
- return_url: str.
|
|
72
|
-
---
|
|
73
|
-
from llama_cloud.client import LlamaCloud
|
|
74
|
-
|
|
75
|
-
client = LlamaCloud(
|
|
76
|
-
token="YOUR_TOKEN",
|
|
77
|
-
)
|
|
78
|
-
client.billing.create_customer_portal_session(
|
|
79
|
-
return_url="string",
|
|
80
|
-
)
|
|
81
|
-
"""
|
|
82
|
-
_response = self._client_wrapper.httpx_client.request(
|
|
83
|
-
"POST",
|
|
84
|
-
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/billing/customer-portal-session"),
|
|
85
|
-
json=jsonable_encoder({"return_url": return_url}),
|
|
86
|
-
headers=self._client_wrapper.get_headers(),
|
|
87
|
-
timeout=60,
|
|
88
|
-
)
|
|
89
|
-
if 200 <= _response.status_code < 300:
|
|
90
|
-
return pydantic.parse_obj_as(str, _response.json()) # type: ignore
|
|
91
|
-
if _response.status_code == 422:
|
|
92
|
-
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
|
|
93
|
-
try:
|
|
94
|
-
_response_json = _response.json()
|
|
95
|
-
except JSONDecodeError:
|
|
96
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
97
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
98
|
-
|
|
99
|
-
def stripe_webhook(self, *, stripe_signature: typing.Optional[str] = None) -> typing.Any:
|
|
100
|
-
"""
|
|
101
|
-
Stripe webhook endpoint.
|
|
102
|
-
|
|
103
|
-
Parameters:
|
|
104
|
-
- stripe_signature: typing.Optional[str].
|
|
105
|
-
---
|
|
106
|
-
from llama_cloud.client import LlamaCloud
|
|
107
|
-
|
|
108
|
-
client = LlamaCloud(
|
|
109
|
-
token="YOUR_TOKEN",
|
|
110
|
-
)
|
|
111
|
-
client.billing.stripe_webhook()
|
|
112
|
-
"""
|
|
113
|
-
_response = self._client_wrapper.httpx_client.request(
|
|
114
|
-
"POST",
|
|
115
|
-
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/billing/webhook"),
|
|
116
|
-
headers=remove_none_from_dict({**self._client_wrapper.get_headers(), "stripe-signature": stripe_signature}),
|
|
117
|
-
timeout=60,
|
|
118
|
-
)
|
|
119
|
-
if 200 <= _response.status_code < 300:
|
|
120
|
-
return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
|
|
121
|
-
if _response.status_code == 422:
|
|
122
|
-
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
|
|
123
|
-
try:
|
|
124
|
-
_response_json = _response.json()
|
|
125
|
-
except JSONDecodeError:
|
|
126
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
127
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
class AsyncBillingClient:
|
|
131
|
-
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
132
|
-
self._client_wrapper = client_wrapper
|
|
133
|
-
|
|
134
|
-
async def create_checkout_session(self, *, success_url: str, cancel_url: str) -> str:
|
|
135
|
-
"""
|
|
136
|
-
Create a new checkout session.
|
|
137
|
-
|
|
138
|
-
Parameters:
|
|
139
|
-
- success_url: str.
|
|
140
|
-
|
|
141
|
-
- cancel_url: str.
|
|
142
|
-
---
|
|
143
|
-
from llama_cloud.client import AsyncLlamaCloud
|
|
144
|
-
|
|
145
|
-
client = AsyncLlamaCloud(
|
|
146
|
-
token="YOUR_TOKEN",
|
|
147
|
-
)
|
|
148
|
-
await client.billing.create_checkout_session(
|
|
149
|
-
success_url="string",
|
|
150
|
-
cancel_url="string",
|
|
151
|
-
)
|
|
152
|
-
"""
|
|
153
|
-
_response = await self._client_wrapper.httpx_client.request(
|
|
154
|
-
"POST",
|
|
155
|
-
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/billing/checkout-session"),
|
|
156
|
-
json=jsonable_encoder({"success_url": success_url, "cancel_url": cancel_url}),
|
|
157
|
-
headers=self._client_wrapper.get_headers(),
|
|
158
|
-
timeout=60,
|
|
159
|
-
)
|
|
160
|
-
if 200 <= _response.status_code < 300:
|
|
161
|
-
return pydantic.parse_obj_as(str, _response.json()) # type: ignore
|
|
162
|
-
if _response.status_code == 422:
|
|
163
|
-
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
|
|
164
|
-
try:
|
|
165
|
-
_response_json = _response.json()
|
|
166
|
-
except JSONDecodeError:
|
|
167
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
168
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
169
|
-
|
|
170
|
-
async def create_customer_portal_session(self, *, return_url: str) -> str:
|
|
171
|
-
"""
|
|
172
|
-
Create a new customer portal session.
|
|
173
|
-
|
|
174
|
-
Parameters:
|
|
175
|
-
- return_url: str.
|
|
176
|
-
---
|
|
177
|
-
from llama_cloud.client import AsyncLlamaCloud
|
|
178
|
-
|
|
179
|
-
client = AsyncLlamaCloud(
|
|
180
|
-
token="YOUR_TOKEN",
|
|
181
|
-
)
|
|
182
|
-
await client.billing.create_customer_portal_session(
|
|
183
|
-
return_url="string",
|
|
184
|
-
)
|
|
185
|
-
"""
|
|
186
|
-
_response = await self._client_wrapper.httpx_client.request(
|
|
187
|
-
"POST",
|
|
188
|
-
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/billing/customer-portal-session"),
|
|
189
|
-
json=jsonable_encoder({"return_url": return_url}),
|
|
190
|
-
headers=self._client_wrapper.get_headers(),
|
|
191
|
-
timeout=60,
|
|
192
|
-
)
|
|
193
|
-
if 200 <= _response.status_code < 300:
|
|
194
|
-
return pydantic.parse_obj_as(str, _response.json()) # type: ignore
|
|
195
|
-
if _response.status_code == 422:
|
|
196
|
-
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
|
|
197
|
-
try:
|
|
198
|
-
_response_json = _response.json()
|
|
199
|
-
except JSONDecodeError:
|
|
200
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
201
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
202
|
-
|
|
203
|
-
async def stripe_webhook(self, *, stripe_signature: typing.Optional[str] = None) -> typing.Any:
|
|
204
|
-
"""
|
|
205
|
-
Stripe webhook endpoint.
|
|
206
|
-
|
|
207
|
-
Parameters:
|
|
208
|
-
- stripe_signature: typing.Optional[str].
|
|
209
|
-
---
|
|
210
|
-
from llama_cloud.client import AsyncLlamaCloud
|
|
211
|
-
|
|
212
|
-
client = AsyncLlamaCloud(
|
|
213
|
-
token="YOUR_TOKEN",
|
|
214
|
-
)
|
|
215
|
-
await client.billing.stripe_webhook()
|
|
216
|
-
"""
|
|
217
|
-
_response = await self._client_wrapper.httpx_client.request(
|
|
218
|
-
"POST",
|
|
219
|
-
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/billing/webhook"),
|
|
220
|
-
headers=remove_none_from_dict({**self._client_wrapper.get_headers(), "stripe-signature": stripe_signature}),
|
|
221
|
-
timeout=60,
|
|
222
|
-
)
|
|
223
|
-
if 200 <= _response.status_code < 300:
|
|
224
|
-
return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
|
|
225
|
-
if _response.status_code == 422:
|
|
226
|
-
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
|
|
227
|
-
try:
|
|
228
|
-
_response_json = _response.json()
|
|
229
|
-
except JSONDecodeError:
|
|
230
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
231
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|