ollama-client 0.2.2 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +8 -0
  3. data/README.md +7 -1
  4. data/docs/CLOUD.md +29 -0
  5. data/docs/CONSOLE_IMPROVEMENTS.md +256 -0
  6. data/docs/GEM_RELEASE_GUIDE.md +794 -0
  7. data/docs/GET_RUBYGEMS_SECRET.md +151 -0
  8. data/docs/QUICK_OTP_SETUP.md +80 -0
  9. data/docs/QUICK_RELEASE.md +106 -0
  10. data/docs/README.md +43 -0
  11. data/docs/RUBYGEMS_OTP_SETUP.md +199 -0
  12. data/docs/SCHEMA_FIXES.md +147 -0
  13. data/docs/TEST_UPDATES.md +107 -0
  14. data/examples/README.md +92 -0
  15. data/examples/advanced_complex_schemas.rb +6 -3
  16. data/examples/advanced_multi_step_agent.rb +2 -1
  17. data/examples/chat_console.rb +12 -3
  18. data/examples/complete_workflow.rb +14 -4
  19. data/examples/dhan_console.rb +103 -8
  20. data/examples/dhanhq/agents/technical_analysis_agent.rb +6 -1
  21. data/examples/dhanhq/schemas/agent_schemas.rb +2 -2
  22. data/examples/dhanhq_agent.rb +23 -13
  23. data/examples/dhanhq_tools.rb +311 -246
  24. data/examples/multi_step_agent_with_external_data.rb +368 -0
  25. data/{test_dhanhq_tool_calling.rb → examples/test_dhanhq_tool_calling.rb} +99 -6
  26. data/lib/ollama/agent/executor.rb +30 -30
  27. data/lib/ollama/client.rb +73 -80
  28. data/lib/ollama/dto.rb +7 -7
  29. data/lib/ollama/options.rb +17 -9
  30. data/lib/ollama/response.rb +4 -6
  31. data/lib/ollama/tool/function/parameters.rb +1 -0
  32. data/lib/ollama/version.rb +1 -1
  33. metadata +24 -9
  34. /data/{FEATURES_ADDED.md → docs/FEATURES_ADDED.md} +0 -0
  35. /data/{HANDLERS_ANALYSIS.md → docs/HANDLERS_ANALYSIS.md} +0 -0
  36. /data/{PRODUCTION_FIXES.md → docs/PRODUCTION_FIXES.md} +0 -0
  37. /data/{TESTING.md → docs/TESTING.md} +0 -0
  38. /data/{test_tool_calling.rb → examples/test_tool_calling.rb} +0 -0
@@ -76,7 +76,7 @@ class DataAgent
76
76
  "type" => "number",
77
77
  "minimum" => 0,
78
78
  "maximum" => 1,
79
- "description" => "Confidence in this decision"
79
+ "description" => "Confidence in this decision (0.0 to 1.0, where 1.0 is 100% confident)"
80
80
  },
81
81
  "parameters" => {
82
82
  "type" => "object",
@@ -304,7 +304,7 @@ class TradingAgent
304
304
  "type" => "number",
305
305
  "minimum" => 0,
306
306
  "maximum" => 1,
307
- "description" => "Confidence in this decision"
307
+ "description" => "Confidence in this decision (0.0 to 1.0, where 1.0 is 100% confident)"
308
308
  },
309
309
  "parameters" => {
310
310
  "type" => "object",
@@ -662,16 +662,26 @@ if __FILE__ == $PROGRAM_NAME
662
662
  puts " ⚠️ RELIANCE data error: #{e.message}"
663
663
  end
664
664
 
665
- # NOTE: Positions and holdings are not part of the 6 Data APIs
665
+ # NOTE: Positions and holdings are not part of the 6 Data APIs, but available via DhanHQ gem
666
666
  begin
667
- positions_result = { action: "check_positions", result: { positions: [], count: 0 },
668
- note: "Positions API not available in Data Tools" }
669
- if positions_result[:result]
670
- market_data[:positions] = positions_result[:result][:positions] || []
671
- puts " ✅ Positions: #{positions_result[:result][:count] || 0} active"
672
- else
673
- puts " ✅ Positions: 0 active (Positions API not in Data Tools)"
674
- market_data[:positions] = []
667
+ positions_list = DhanHQ::Models::Position.all
668
+ positions_data = positions_list.map do |pos|
669
+ {
670
+ trading_symbol: pos.trading_symbol,
671
+ quantity: pos.net_qty,
672
+ average_price: pos.buy_avg,
673
+ exchange_segment: pos.exchange_segment,
674
+ security_id: pos.security_id,
675
+ pnl: pos.realized_profit
676
+ }
677
+ end
678
+ market_data[:positions] = positions_data
679
+ puts " ✅ Positions: #{positions_data.length} active"
680
+
681
+ if positions_data.any?
682
+ positions_data.each do |pos|
683
+ puts " - #{pos[:trading_symbol]}: Qty #{pos[:quantity]} @ ₹#{pos[:average_price]}"
684
+ end
675
685
  end
676
686
  rescue StandardError => e
677
687
  puts " ⚠️ Positions error: #{e.message}"
@@ -852,8 +862,8 @@ if __FILE__ == $PROGRAM_NAME
852
862
  begin
853
863
  # NOTE: Options symbols may need different format
854
864
  # Try with NIFTY which typically has options
855
- # First, get the list of available expiries
856
- expiry_list_result = DhanHQDataTools.get_option_chain(
865
+ # First, get the list of available expiries using get_expiry_list
866
+ expiry_list_result = DhanHQDataTools.get_expiry_list(
857
867
  symbol: "NIFTY", # NIFTY typically has options, RELIANCE might not
858
868
  exchange_segment: "IDX_I"
859
869
  )