langchainrb 0.8.2 → 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +9 -0
  3. data/README.md +57 -27
  4. data/lib/langchain/assistants/assistant.rb +199 -0
  5. data/lib/langchain/assistants/message.rb +58 -0
  6. data/lib/langchain/assistants/thread.rb +34 -0
  7. data/lib/langchain/conversation/memory.rb +1 -6
  8. data/lib/langchain/conversation.rb +7 -18
  9. data/lib/langchain/llm/ai21.rb +1 -1
  10. data/lib/langchain/llm/azure.rb +10 -97
  11. data/lib/langchain/llm/base.rb +1 -0
  12. data/lib/langchain/llm/cohere.rb +4 -6
  13. data/lib/langchain/llm/google_palm.rb +2 -0
  14. data/lib/langchain/llm/google_vertex_ai.rb +12 -10
  15. data/lib/langchain/llm/ollama.rb +167 -27
  16. data/lib/langchain/llm/openai.rb +104 -160
  17. data/lib/langchain/llm/replicate.rb +0 -6
  18. data/lib/langchain/llm/response/anthropic_response.rb +4 -0
  19. data/lib/langchain/llm/response/base_response.rb +7 -0
  20. data/lib/langchain/llm/response/google_palm_response.rb +4 -0
  21. data/lib/langchain/llm/response/ollama_response.rb +22 -0
  22. data/lib/langchain/llm/response/openai_response.rb +8 -0
  23. data/lib/langchain/tool/base.rb +24 -0
  24. data/lib/langchain/tool/google_search.rb +1 -4
  25. data/lib/langchain/utils/token_length/ai21_validator.rb +2 -2
  26. data/lib/langchain/utils/token_length/cohere_validator.rb +2 -2
  27. data/lib/langchain/utils/token_length/google_palm_validator.rb +2 -2
  28. data/lib/langchain/utils/token_length/openai_validator.rb +13 -2
  29. data/lib/langchain/utils/token_length/token_limit_exceeded.rb +1 -1
  30. data/lib/langchain/vectorsearch/pinecone.rb +2 -1
  31. data/lib/langchain/version.rb +1 -1
  32. data/lib/langchain.rb +2 -1
  33. metadata +24 -7
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: langchainrb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.2
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrei Bondarev
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-12-24 00:00:00.000000000 Z
11
+ date: 2024-02-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: baran
@@ -534,14 +534,14 @@ dependencies:
534
534
  requirements:
535
535
  - - "~>"
536
536
  - !ruby/object:Gem::Version
537
- version: 6.1.0
537
+ version: 6.3.0
538
538
  type: :development
539
539
  prerelease: false
540
540
  version_requirements: !ruby/object:Gem::Requirement
541
541
  requirements:
542
542
  - - "~>"
543
543
  - !ruby/object:Gem::Version
544
- version: 6.1.0
544
+ version: 6.3.0
545
545
  - !ruby/object:Gem::Dependency
546
546
  name: safe_ruby
547
547
  requirement: !ruby/object:Gem::Requirement
@@ -576,14 +576,14 @@ dependencies:
576
576
  requirements:
577
577
  - - "~>"
578
578
  - !ruby/object:Gem::Version
579
- version: 0.8.9
579
+ version: 0.8.10
580
580
  type: :development
581
581
  prerelease: false
582
582
  version_requirements: !ruby/object:Gem::Requirement
583
583
  requirements:
584
584
  - - "~>"
585
585
  - !ruby/object:Gem::Version
586
- version: 0.8.9
586
+ version: 0.8.10
587
587
  - !ruby/object:Gem::Dependency
588
588
  name: wikipedia-client
589
589
  requirement: !ruby/object:Gem::Requirement
@@ -598,6 +598,20 @@ dependencies:
598
598
  - - "~>"
599
599
  - !ruby/object:Gem::Version
600
600
  version: 1.17.0
601
+ - !ruby/object:Gem::Dependency
602
+ name: faraday
603
+ requirement: !ruby/object:Gem::Requirement
604
+ requirements:
605
+ - - ">="
606
+ - !ruby/object:Gem::Version
607
+ version: '0'
608
+ type: :development
609
+ prerelease: false
610
+ version_requirements: !ruby/object:Gem::Requirement
611
+ requirements:
612
+ - - ">="
613
+ - !ruby/object:Gem::Version
614
+ version: '0'
601
615
  description: Build LLM-backed Ruby applications with Ruby's LangChain
602
616
  email:
603
617
  - andrei.bondarev13@gmail.com
@@ -616,6 +630,9 @@ files:
616
630
  - lib/langchain/agent/sql_query_agent.rb
617
631
  - lib/langchain/agent/sql_query_agent/sql_query_agent_answer_prompt.yaml
618
632
  - lib/langchain/agent/sql_query_agent/sql_query_agent_sql_prompt.yaml
633
+ - lib/langchain/assistants/assistant.rb
634
+ - lib/langchain/assistants/message.rb
635
+ - lib/langchain/assistants/thread.rb
619
636
  - lib/langchain/chunk.rb
620
637
  - lib/langchain/chunker/base.rb
621
638
  - lib/langchain/chunker/markdown.rb
@@ -738,7 +755,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
738
755
  - !ruby/object:Gem::Version
739
756
  version: '0'
740
757
  requirements: []
741
- rubygems_version: 3.3.7
758
+ rubygems_version: 3.4.1
742
759
  signing_key:
743
760
  specification_version: 4
744
761
  summary: Build LLM-backed Ruby applications with Ruby's LangChain