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 Embeddings

embeddings = Embeddings()
response = embeddings.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.0.2.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

ally_ai_langchain-0.0.2-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ally_ai_langchain-0.0.2.tar.gz
  • Upload date:
  • Size: 2.9 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.0.2.tar.gz
Algorithm Hash digest
SHA256 7b2bea2b77f72c8d48c0d522e6112729f803d5e306275f02c3807e53dbb0ebed
MD5 cc9088c92e9b0a8460b7588ec07461e0
BLAKE2b-256 f9005ed4aa73f9b7d8de3174e860698ffa923761c4b21f08ed02d1acc87ac35e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ally_ai_langchain-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1172aeccb0a404e412fad571c86d0bc927e99be7d1d7b55b106fbf78a211bd86
MD5 943ae397aed60da3a42c5edc0f9cb6ed
BLAKE2b-256 7de0fdd7eabdab3be8761b8ab103677855a514f30ad7b9dd61b24cb3f416633f

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