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 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
Release history Release notifications | RSS feed
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.2.0.tar.gz
.
File metadata
- Download URL: llama_index_llms_alibabacloud_aisearch-0.2.0.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.11.10 Darwin/22.3.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e9d071b5bcabc3cb03f8f82b1706c94ef706b932b459742712c044aca8f6186c |
|
MD5 | 5cd699734db0f9b2a557b902fa5a7964 |
|
BLAKE2b-256 | 11bf0fc968fc5044a48c6e24b66055c45b53886ca9571a7ffd1ae98dc8a19407 |
File details
Details for the file llama_index_llms_alibabacloud_aisearch-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: llama_index_llms_alibabacloud_aisearch-0.2.0-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.11.10 Darwin/22.3.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e0b8e18830ea073b713901a7307e578608771060cbbbfcfb43cb626f897b3dc |
|
MD5 | 63b23195a5a1e6e6e4fabfd26dd86e2e |
|
BLAKE2b-256 | 0cd201718d3778183e5838e9e032eb1a39c3cd68cd8804431816122542ad7b79 |