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.2.0.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: ally_ai_langchain-0.2.0.tar.gz
  • Upload date:
  • Size: 3.1 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.2.0.tar.gz
Algorithm Hash digest
SHA256 48292be8a9fbd30022dd9ab8781fe16f99d8e45592180eef404bd955dc1ef98f
MD5 9b86da44d2ec6ca07b77446dfc8922c3
BLAKE2b-256 5ca0acb3ea5230a84252422204a1341538af25918678cc00e6e2438a54d97a91

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ally_ai_langchain-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 db5531d764af8358dc7f1fd9c127a08c71def01f4f1567305fd9a68c99bd4689
MD5 edc65b2d1e3a71724ec19e6acce09185
BLAKE2b-256 d05c717948128c85b0c2a356afd8dcaa7260eb0f601990b1578e0582489d7fdd

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