Skip to main content

llama-index llms alibabacloud_aisearch integration

Project description

LlamaIndex Llms Integration: Alibabacloud_Aisearch

Installation

pip install llama-index-llms-alibabacloud-aisearch

Usage

For further details, please visit https://help.aliyun.com/zh/open-search/search-platform/developer-reference/text-generation-api-details

You can specify the endpoint and aisearch_api_key in the constructor, or set the environment variables AISEARCH_ENDPOINT and AISEARCH_API_KEY.

from llama_index.llms.alibabacloud_aisearch import AlibabaCloudAISearchLLM
from llama_index.core import ChatPromptTemplate

llm = AlibabaCloudAISearchLLM(service_id="ops-qwen-turbo")
prompt_template = ChatPromptTemplate.from_messages(
    [("system", "You are helpful assistant."), ("user", "{prompt}")]
)
messages = prompt_template.format_messages(prompt="<your question>")
print(llm.chat(messages))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Built Distribution

File details

Details for the file llama_index_llms_alibabacloud_aisearch-0.1.0.tar.gz.

File metadata

File hashes

Hashes for llama_index_llms_alibabacloud_aisearch-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9dd8f7bead3936923c6612b1e60fce0fd5986cf40bc8330e1c3560b435d476f9
MD5 f9016e493e0b5e11e07ba1b1fbd85b5c
BLAKE2b-256 b13d20361e80439871e64bcc09c16a0356e1cc805b2f6b3f239dc5d9ff78c27c

See more details on using hashes here.

File details

Details for the file llama_index_llms_alibabacloud_aisearch-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_index_llms_alibabacloud_aisearch-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 048a66081317f72f4487a57bc24a266f24ba472375be3b10249c993cbd57dfed
MD5 0aa169830079bf1b4404d1a6c29cf811
BLAKE2b-256 52ef5cc40969e42044fb5c1f667636052c290a04f9fbc617a1af160b539fe91e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page