Skip to main content

langchain-openai package for ally

Project description

Ally AI

How to use

Config File

llm:
  api_key: '<private-key>'
  api_version: "<api-version>"
  endpoint: "<endpoint>"
  model: "<model-name>"
  deployment_name: '<deployment-name>'
  temperature: 0.7
  streaming: true

embeddings:
  api_key: '<private-key>'
  api_version: "<api-version>"
  endpoint: "<endpoint>"
  model: "<model-name>"
  deployment_name: '<deployment-name>'

Create LLM

Use Default Settings in LLM

from ally_ai_langchain import LLM

llm = LLM()
response = llm.invoke('What is an ally?')
print(response)

Use Custom Settings in LLM

my_llm:
  api_key: '<private-key>'
  api_version: "<api-version>"
from ally_ai_langchain import LLM, Settings

settings = Settings(section='my_llm')
llm = LLM(settings=settings)
print(llm.settings.path)
print(llm.settings.section)

Override Settings in LLM

from ally_ai_langchain import LLM, Settings

settings = Settings(section='my_llm', api_key='<new-api-key>')
llm = LLM(settings=settings)
response = llm.invoke('What is an ally?')
print(response)

How to Create Embeddings

from ally_ai_langchain import EmbeddingModel

model = EmbeddingModel()
response = model.embed_query('What is an ally?')
print(response)

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

ally_ai_langchain-0.1.0.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

ally_ai_langchain-0.1.0-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ally_ai_langchain-0.1.0.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.10

File hashes

Hashes for ally_ai_langchain-0.1.0.tar.gz
Algorithm Hash digest
SHA256 305e7b0dcc2812ef97110d32e0a1074b4eb50da5ec728d92c0ed0e77530523fd
MD5 0029d1b5b82b898b1dd619c472d1e96b
BLAKE2b-256 019a07c45d87d2fa51e0ba09227fff6dbc7cf5128bacd15288bd9c28e01a81cd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ally_ai_langchain-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 52b3b1582d13dc49a118091cb49b378a620a9ad84d249d4659bc0e853f9b5098
MD5 0c7cfcc00af9970f62c943793f80ab48
BLAKE2b-256 f5ff23142d11191e2b019a667661800a3f633505a38b0efc89e1b5773462dc06

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