Skip to content

Commit 657963d

Browse files
koiclittlechu
authored andcommitted
[Doc] Document deprecated APIs using @deprecated tag (patterns-ai-core#991)
This change adds the `@deprecated` YARD tag to several classes and methods. This makes it possible to explicitly mark the API as deprecated in the YARD documentation. It also updates inline references from backtick-style (`name`) to the link-style (`{name}`) for improved documentation rendering.
1 parent 124d57f commit 657963d

File tree

5 files changed

+16
-11
lines changed

5 files changed

+16
-11
lines changed

lib/langchain/llm/ai21.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ module Langchain::LLM
1010
# Usage:
1111
# llm = Langchain::LLM::AI21.new(api_key: ENV["AI21_API_KEY"])
1212
#
13+
# @deprecated Use another LLM provider.
1314
class AI21 < Base
1415
DEFAULTS = {
1516
temperature: 0.0,

lib/langchain/llm/base.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ class Base
2626
# Default LLM options. Can be overridden by passing `default_options: {}` to the Langchain::LLM::* constructors.
2727
attr_reader :defaults
2828

29-
# Ensuring backward compatibility for `default_dimensions`.
29+
# Ensuring backward compatibility for {default_dimensions}.
3030
#
31-
# @deprecated Use `default_dimensions` instead.
31+
# @deprecated Use {default_dimensions} instead.
3232
# @see https://github.com/patterns-ai-core/langchainrb/pull/586
3333
def default_dimension
3434
Langchain.logger.warn "DEPRECATED: `default_dimension` is deprecated, and will be removed in the next major version. Please use `default_dimensions` instead."

lib/langchain/llm/llama_cpp.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ module Langchain::LLM
1313
# n_threads: Integer(ENV["LLAMACPP_N_THREADS"])
1414
# )
1515
#
16+
# @deprecated Use {Langchain::LLM::Ollama} for self-hosted LLM inference.
1617
class LlamaCpp < Base
1718
attr_accessor :model_path, :n_gpu_layers, :n_ctx, :seed
1819
attr_writer :n_threads

lib/langchain/llm/openai.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ def embed(
9898
# @param prompt [String] The prompt to generate a completion for
9999
# @param params [Hash] The parameters to pass to the `chat()` method
100100
# @return [Langchain::LLM::OpenAIResponse] Response object
101+
# @deprecated Use {chat} instead.
101102
def complete(prompt:, **params)
102103
Langchain.logger.warn "DEPRECATED: `Langchain::LLM::OpenAI#complete` is deprecated, and will be removed in the next major version. Use `Langchain::LLM::OpenAI#chat` instead."
103104

lib/langchain/vectorsearch/epsilla.rb

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,18 @@
44
require "timeout"
55

66
module Langchain::Vectorsearch
7+
#
8+
# Wrapper around Epsilla client library
9+
#
10+
# Gem requirements:
11+
# gem "epsilla-ruby", "~> 0.0.3"
12+
#
13+
# Usage:
14+
# epsilla = Langchain::Vectorsearch::Epsilla.new(url:, db_name:, db_path:, index_name:, llm:)
15+
#
16+
# @deprecated Use other vector storage engines.
17+
#
718
class Epsilla < Base
8-
#
9-
# Wrapper around Epsilla client library
10-
#
11-
# Gem requirements:
12-
# gem "epsilla-ruby", "~> 0.0.3"
13-
#
14-
# Usage:
15-
# epsilla = Langchain::Vectorsearch::Epsilla.new(url:, db_name:, db_path:, index_name:, llm:)
16-
#
1719
# Initialize Epsilla client
1820
# @param url [String] URL to connect to the Epsilla db instance, protocol://host:port
1921
# @param db_name [String] The name of the database to use

0 commit comments

Comments
 (0)