-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7406d9f
commit f3db605
Showing
16 changed files
with
77 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Basic Usage | ||
|
||
## Single Query | ||
|
||
In the simplest approach you just need to pass a prompt and the model will provide a response for it. | ||
|
||
```python | ||
from llm_wrapper.models import AzureOpenAIModel | ||
from llm_wrapper.domain.configuration import AzureOpenAIConfiguration | ||
from llm_wrapper.domain.response import ResponseData | ||
|
||
configuration = AzureOpenAIConfiguration( | ||
api_key="<OPENAI_API_KEY>", | ||
base_url="<OPENAI_API_BASE>", | ||
api_version="<OPENAI_API_VERSION>", | ||
deployment="<OPENAI_API_DEPLOYMENT_NAME>", | ||
model_name="<OPENAI_API_MODEL_NAME>" | ||
) | ||
|
||
model = AzureOpenAIModel(config=configuration) | ||
|
||
response = model.generate("What is the capital of Poland?") | ||
print(response) | ||
|
||
#[ResponseData(response='The capital of Poland is Warsaw.', input_data=None, number_of_prompt_tokens=7, number_of_generated_tokens=7, error=None)] | ||
``` | ||
|
||
As a response you'll get `List[ResponseData]`, where the first element will contain response from the model in the | ||
`ResponseData.response` field and also information about number of prompt and generated tokens. If any error occurred | ||
also `ResponseData.error` field will be filled with the actual exception. | ||
|
||
|
7 changes: 1 addition & 6 deletions
7
docs/usage/deploy_llama2_on_azure.md → docs/usage/deploy_open_source_models.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,19 @@ | ||
site_name: llm-wrapper | ||
theme: readthedocs | ||
theme: readthedocs | ||
nav: | ||
- Introduction: index.md | ||
- Installation & Quickstart: installation_and_quick_start.md | ||
- F.A.Q: faq.md | ||
- User guide: | ||
- Basic: usage/basic.md | ||
- Advanced: usage/advanced.md | ||
- Forcing Structured Output Format: usage/forcing_response_format.md | ||
- Azure Open-source Models Deployment: usage/deploy_open_source_models.md | ||
- API: | ||
- Domain: api/input_output_dataclasses.md | ||
- Models: | ||
- Azure Llama2: api/models/azure_llama2_model.md | ||
- Azure Mistral: api/models/azure_mistral_model.md | ||
- Azure OpenAI GPT: api/models/azure_openai_model.md | ||
- VertexAI PaLM2: api/models/vertexai_palm_model.md | ||
- VertexAI Gemini: api/models/vertexai_gemini_model.md |