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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/README.md +7 -1
- data/docs/CLOUD.md +29 -0
- data/docs/CONSOLE_IMPROVEMENTS.md +256 -0
- data/docs/GEM_RELEASE_GUIDE.md +794 -0
- data/docs/GET_RUBYGEMS_SECRET.md +151 -0
- data/docs/QUICK_OTP_SETUP.md +80 -0
- data/docs/QUICK_RELEASE.md +106 -0
- data/docs/README.md +43 -0
- data/docs/RUBYGEMS_OTP_SETUP.md +199 -0
- data/docs/SCHEMA_FIXES.md +147 -0
- data/docs/TEST_UPDATES.md +107 -0
- data/examples/README.md +92 -0
- data/examples/advanced_complex_schemas.rb +6 -3
- data/examples/advanced_multi_step_agent.rb +2 -1
- data/examples/chat_console.rb +12 -3
- data/examples/complete_workflow.rb +14 -4
- data/examples/dhan_console.rb +103 -8
- data/examples/dhanhq/agents/technical_analysis_agent.rb +6 -1
- data/examples/dhanhq/schemas/agent_schemas.rb +2 -2
- data/examples/dhanhq_agent.rb +23 -13
- data/examples/dhanhq_tools.rb +311 -246
- data/examples/multi_step_agent_with_external_data.rb +368 -0
- data/{test_dhanhq_tool_calling.rb → examples/test_dhanhq_tool_calling.rb} +99 -6
- data/lib/ollama/agent/executor.rb +30 -30
- data/lib/ollama/client.rb +73 -80
- data/lib/ollama/dto.rb +7 -7
- data/lib/ollama/options.rb +17 -9
- data/lib/ollama/response.rb +4 -6
- data/lib/ollama/tool/function/parameters.rb +1 -0
- data/lib/ollama/version.rb +1 -1
- metadata +24 -9
- /data/{FEATURES_ADDED.md → docs/FEATURES_ADDED.md} +0 -0
- /data/{HANDLERS_ANALYSIS.md → docs/HANDLERS_ANALYSIS.md} +0 -0
- /data/{PRODUCTION_FIXES.md → docs/PRODUCTION_FIXES.md} +0 -0
- /data/{TESTING.md → docs/TESTING.md} +0 -0
- /data/{test_tool_calling.rb → examples/test_tool_calling.rb} +0 -0
data/examples/dhanhq_agent.rb
CHANGED
|
@@ -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
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
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.
|
|
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
|
)
|