reportify-sdk 0.3.17 → 0.3.19
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.
- package/dist/index.d.mts +108 -3
- package/dist/index.d.ts +108 -3
- package/dist/index.js +111 -4
- package/dist/index.mjs +111 -4
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -734,6 +734,30 @@ interface BacktestParams {
|
|
|
734
734
|
autoClose?: boolean;
|
|
735
735
|
labels?: Record<string, string>;
|
|
736
736
|
}
|
|
737
|
+
interface Kline1mParams {
|
|
738
|
+
symbol: string;
|
|
739
|
+
startDateTime: string;
|
|
740
|
+
endDateTime: string;
|
|
741
|
+
market?: StockMarket;
|
|
742
|
+
}
|
|
743
|
+
interface BatchKline1mParams {
|
|
744
|
+
symbols: string[];
|
|
745
|
+
startDateTime: string;
|
|
746
|
+
endDateTime: string;
|
|
747
|
+
market?: StockMarket;
|
|
748
|
+
}
|
|
749
|
+
interface MinuteParams {
|
|
750
|
+
symbol: string;
|
|
751
|
+
startDateTime: string;
|
|
752
|
+
endDateTime: string;
|
|
753
|
+
market?: StockMarket;
|
|
754
|
+
}
|
|
755
|
+
interface BatchMinuteParams {
|
|
756
|
+
symbols: string[];
|
|
757
|
+
startDateTime: string;
|
|
758
|
+
endDateTime: string;
|
|
759
|
+
market?: StockMarket;
|
|
760
|
+
}
|
|
737
761
|
interface BacktestResult {
|
|
738
762
|
success: boolean;
|
|
739
763
|
initial_cash: number;
|
|
@@ -936,6 +960,74 @@ declare class QuantModule {
|
|
|
936
960
|
* ```
|
|
937
961
|
*/
|
|
938
962
|
ohlcvBatch(params: BatchOHLCVParams): Promise<OHLCVData[]>;
|
|
963
|
+
/**
|
|
964
|
+
* Get 1-minute kline data for a single symbol
|
|
965
|
+
*
|
|
966
|
+
* @param params - Kline parameters
|
|
967
|
+
* @returns Array of 1-minute kline data
|
|
968
|
+
*
|
|
969
|
+
* @example
|
|
970
|
+
* ```typescript
|
|
971
|
+
* const data = await client.quant.kline1m({
|
|
972
|
+
* symbol: '000001',
|
|
973
|
+
* startDateTime: '2024-01-01 09:30:00',
|
|
974
|
+
* endDateTime: '2024-01-01 15:00:00'
|
|
975
|
+
* });
|
|
976
|
+
* console.log(data);
|
|
977
|
+
* ```
|
|
978
|
+
*/
|
|
979
|
+
kline1m(params: Kline1mParams): Promise<OHLCVData[]>;
|
|
980
|
+
/**
|
|
981
|
+
* Get batch 1-minute kline data for multiple symbols
|
|
982
|
+
*
|
|
983
|
+
* @param params - Batch kline parameters
|
|
984
|
+
* @returns Array of 1-minute kline data sorted by date (ascending), then by symbol
|
|
985
|
+
*
|
|
986
|
+
* @example
|
|
987
|
+
* ```typescript
|
|
988
|
+
* const data = await client.quant.kline1mBatch({
|
|
989
|
+
* symbols: ['000001', '600519'],
|
|
990
|
+
* startDateTime: '2024-01-01 09:30:00',
|
|
991
|
+
* endDateTime: '2024-01-01 15:00:00'
|
|
992
|
+
* });
|
|
993
|
+
* console.log(data);
|
|
994
|
+
* ```
|
|
995
|
+
*/
|
|
996
|
+
kline1mBatch(params: BatchKline1mParams): Promise<OHLCVData[]>;
|
|
997
|
+
/**
|
|
998
|
+
* Get minute data for a single symbol
|
|
999
|
+
*
|
|
1000
|
+
* @param params - Minute parameters
|
|
1001
|
+
* @returns Array of minute data
|
|
1002
|
+
*
|
|
1003
|
+
* @example
|
|
1004
|
+
* ```typescript
|
|
1005
|
+
* const data = await client.quant.minute({
|
|
1006
|
+
* symbol: '000001',
|
|
1007
|
+
* startDateTime: '2024-01-01 09:30:00',
|
|
1008
|
+
* endDateTime: '2024-01-01 15:00:00'
|
|
1009
|
+
* });
|
|
1010
|
+
* console.log(data);
|
|
1011
|
+
* ```
|
|
1012
|
+
*/
|
|
1013
|
+
minute(params: MinuteParams): Promise<OHLCVData[]>;
|
|
1014
|
+
/**
|
|
1015
|
+
* Get batch minute data for multiple symbols
|
|
1016
|
+
*
|
|
1017
|
+
* @param params - Batch minute parameters
|
|
1018
|
+
* @returns Array of minute data sorted by date (ascending), then by symbol
|
|
1019
|
+
*
|
|
1020
|
+
* @example
|
|
1021
|
+
* ```typescript
|
|
1022
|
+
* const data = await client.quant.minuteBatch({
|
|
1023
|
+
* symbols: ['000001', '600519'],
|
|
1024
|
+
* startDateTime: '2024-01-01 09:30:00',
|
|
1025
|
+
* endDateTime: '2024-01-01 15:00:00'
|
|
1026
|
+
* });
|
|
1027
|
+
* console.log(data);
|
|
1028
|
+
* ```
|
|
1029
|
+
*/
|
|
1030
|
+
minuteBatch(params: BatchMinuteParams): Promise<OHLCVData[]>;
|
|
939
1031
|
/**
|
|
940
1032
|
* Execute strategy backtest
|
|
941
1033
|
*
|
|
@@ -1189,19 +1281,28 @@ declare class AgentModule {
|
|
|
1189
1281
|
* Create a new agent conversation
|
|
1190
1282
|
*
|
|
1191
1283
|
* @param agentId - Agent ID
|
|
1192
|
-
* @param
|
|
1284
|
+
* @param options - Optional parameters
|
|
1285
|
+
* @param options.title - Conversation title
|
|
1286
|
+
* @param options.conversationType - Conversation type: "agent_chat", "task_chat", "debug_chat", "bot_chat"
|
|
1193
1287
|
*/
|
|
1194
|
-
createConversation(agentId: number,
|
|
1288
|
+
createConversation(agentId: number, options?: {
|
|
1289
|
+
title?: string;
|
|
1290
|
+
conversationType?: string;
|
|
1291
|
+
}): Promise<AgentConversation>;
|
|
1195
1292
|
/**
|
|
1196
1293
|
* Chat with agent in a conversation
|
|
1197
1294
|
*
|
|
1198
1295
|
* @param conversationId - Conversation ID
|
|
1199
1296
|
* @param message - User message
|
|
1200
1297
|
* @param options - Chat options
|
|
1298
|
+
* @param options.documents - Related documents
|
|
1299
|
+
* @param options.stream - Whether to use streaming response (default: true)
|
|
1300
|
+
* @param options.background - Whether to run agent task in background (default: false). When true, returns immediately without waiting for events.
|
|
1201
1301
|
*/
|
|
1202
1302
|
chat(conversationId: number, message: string, options?: {
|
|
1203
1303
|
documents?: DocumentInput[];
|
|
1204
1304
|
stream?: boolean;
|
|
1305
|
+
background?: boolean;
|
|
1205
1306
|
}): Promise<unknown>;
|
|
1206
1307
|
/**
|
|
1207
1308
|
* Get conversation details
|
|
@@ -1480,6 +1581,10 @@ declare class UserModule {
|
|
|
1480
1581
|
group_id: string;
|
|
1481
1582
|
name: string;
|
|
1482
1583
|
count: number;
|
|
1584
|
+
follow_values: Array<{
|
|
1585
|
+
follow_type: number;
|
|
1586
|
+
follow_value: string;
|
|
1587
|
+
}>;
|
|
1483
1588
|
}>;
|
|
1484
1589
|
/**
|
|
1485
1590
|
* Update a follow group
|
|
@@ -1758,4 +1863,4 @@ declare class Reportify {
|
|
|
1758
1863
|
getBytes(path: string): Promise<ArrayBuffer>;
|
|
1759
1864
|
}
|
|
1760
1865
|
|
|
1761
|
-
export { APIError, type AgentConversation, type AgentMessage, AgentModule, AuthenticationError, type BacktestParams, type BacktestResult, type BatchOHLCVParams, type Calendar, type Channel, ChannelsModule, type ChatCompletionOptions, type ChatCompletionResponse, type ChatMode, ChatModule, type Chunk, type ChunkSearchOptions, type CompanyInfo, type CompanyOverview, type Concept, type ConceptDoc, type ConceptEvent, type ConceptFeed, type ConceptStock, ConceptsModule, type DocsListOptions, DocsModule, type Document, type DocumentInput, type EarningsEvent, type EarningsSearchOptions, type FactorComputeParams, type FactorMeta, type FinancialStatement, type FollowedCompany, type IPOEvent, type IPOStatus, type IndexConstituent, type IndexFund, type IndicatorComputeParams, type IndicatorData, type IndicatorMeta, type IndustryConstituent, KBModule, type KBSearchOptions, type Market, NotFoundError, type OHLCVData, type OHLCVParams, type PaginatedResponse, type Period, type PriceData, QuantModule, type Quote, RateLimitError, Reportify, type ReportifyConfig, ReportifyError, type ScreenParams, type ScreenedStock, SearchModule, type SearchOptions, type Shareholder, type ShareholderType, type StockInfo, type StockMarket, StockModule, TimelineModule, type TimelineOptions, type UploadDocRequest, UserModule };
|
|
1866
|
+
export { APIError, type AgentConversation, type AgentMessage, AgentModule, AuthenticationError, type BacktestParams, type BacktestResult, type BatchKline1mParams, type BatchMinuteParams, type BatchOHLCVParams, type Calendar, type Channel, ChannelsModule, type ChatCompletionOptions, type ChatCompletionResponse, type ChatMode, ChatModule, type Chunk, type ChunkSearchOptions, type CompanyInfo, type CompanyOverview, type Concept, type ConceptDoc, type ConceptEvent, type ConceptFeed, type ConceptStock, ConceptsModule, type DocsListOptions, DocsModule, type Document, type DocumentInput, type EarningsEvent, type EarningsSearchOptions, type FactorComputeParams, type FactorMeta, type FinancialStatement, type FollowedCompany, type IPOEvent, type IPOStatus, type IndexConstituent, type IndexFund, type IndicatorComputeParams, type IndicatorData, type IndicatorMeta, type IndustryConstituent, KBModule, type KBSearchOptions, type Kline1mParams, type Market, type MinuteParams, NotFoundError, type OHLCVData, type OHLCVParams, type PaginatedResponse, type Period, type PriceData, QuantModule, type Quote, RateLimitError, Reportify, type ReportifyConfig, ReportifyError, type ScreenParams, type ScreenedStock, SearchModule, type SearchOptions, type Shareholder, type ShareholderType, type StockInfo, type StockMarket, StockModule, TimelineModule, type TimelineOptions, type UploadDocRequest, UserModule };
|
package/dist/index.d.ts
CHANGED
|
@@ -734,6 +734,30 @@ interface BacktestParams {
|
|
|
734
734
|
autoClose?: boolean;
|
|
735
735
|
labels?: Record<string, string>;
|
|
736
736
|
}
|
|
737
|
+
interface Kline1mParams {
|
|
738
|
+
symbol: string;
|
|
739
|
+
startDateTime: string;
|
|
740
|
+
endDateTime: string;
|
|
741
|
+
market?: StockMarket;
|
|
742
|
+
}
|
|
743
|
+
interface BatchKline1mParams {
|
|
744
|
+
symbols: string[];
|
|
745
|
+
startDateTime: string;
|
|
746
|
+
endDateTime: string;
|
|
747
|
+
market?: StockMarket;
|
|
748
|
+
}
|
|
749
|
+
interface MinuteParams {
|
|
750
|
+
symbol: string;
|
|
751
|
+
startDateTime: string;
|
|
752
|
+
endDateTime: string;
|
|
753
|
+
market?: StockMarket;
|
|
754
|
+
}
|
|
755
|
+
interface BatchMinuteParams {
|
|
756
|
+
symbols: string[];
|
|
757
|
+
startDateTime: string;
|
|
758
|
+
endDateTime: string;
|
|
759
|
+
market?: StockMarket;
|
|
760
|
+
}
|
|
737
761
|
interface BacktestResult {
|
|
738
762
|
success: boolean;
|
|
739
763
|
initial_cash: number;
|
|
@@ -936,6 +960,74 @@ declare class QuantModule {
|
|
|
936
960
|
* ```
|
|
937
961
|
*/
|
|
938
962
|
ohlcvBatch(params: BatchOHLCVParams): Promise<OHLCVData[]>;
|
|
963
|
+
/**
|
|
964
|
+
* Get 1-minute kline data for a single symbol
|
|
965
|
+
*
|
|
966
|
+
* @param params - Kline parameters
|
|
967
|
+
* @returns Array of 1-minute kline data
|
|
968
|
+
*
|
|
969
|
+
* @example
|
|
970
|
+
* ```typescript
|
|
971
|
+
* const data = await client.quant.kline1m({
|
|
972
|
+
* symbol: '000001',
|
|
973
|
+
* startDateTime: '2024-01-01 09:30:00',
|
|
974
|
+
* endDateTime: '2024-01-01 15:00:00'
|
|
975
|
+
* });
|
|
976
|
+
* console.log(data);
|
|
977
|
+
* ```
|
|
978
|
+
*/
|
|
979
|
+
kline1m(params: Kline1mParams): Promise<OHLCVData[]>;
|
|
980
|
+
/**
|
|
981
|
+
* Get batch 1-minute kline data for multiple symbols
|
|
982
|
+
*
|
|
983
|
+
* @param params - Batch kline parameters
|
|
984
|
+
* @returns Array of 1-minute kline data sorted by date (ascending), then by symbol
|
|
985
|
+
*
|
|
986
|
+
* @example
|
|
987
|
+
* ```typescript
|
|
988
|
+
* const data = await client.quant.kline1mBatch({
|
|
989
|
+
* symbols: ['000001', '600519'],
|
|
990
|
+
* startDateTime: '2024-01-01 09:30:00',
|
|
991
|
+
* endDateTime: '2024-01-01 15:00:00'
|
|
992
|
+
* });
|
|
993
|
+
* console.log(data);
|
|
994
|
+
* ```
|
|
995
|
+
*/
|
|
996
|
+
kline1mBatch(params: BatchKline1mParams): Promise<OHLCVData[]>;
|
|
997
|
+
/**
|
|
998
|
+
* Get minute data for a single symbol
|
|
999
|
+
*
|
|
1000
|
+
* @param params - Minute parameters
|
|
1001
|
+
* @returns Array of minute data
|
|
1002
|
+
*
|
|
1003
|
+
* @example
|
|
1004
|
+
* ```typescript
|
|
1005
|
+
* const data = await client.quant.minute({
|
|
1006
|
+
* symbol: '000001',
|
|
1007
|
+
* startDateTime: '2024-01-01 09:30:00',
|
|
1008
|
+
* endDateTime: '2024-01-01 15:00:00'
|
|
1009
|
+
* });
|
|
1010
|
+
* console.log(data);
|
|
1011
|
+
* ```
|
|
1012
|
+
*/
|
|
1013
|
+
minute(params: MinuteParams): Promise<OHLCVData[]>;
|
|
1014
|
+
/**
|
|
1015
|
+
* Get batch minute data for multiple symbols
|
|
1016
|
+
*
|
|
1017
|
+
* @param params - Batch minute parameters
|
|
1018
|
+
* @returns Array of minute data sorted by date (ascending), then by symbol
|
|
1019
|
+
*
|
|
1020
|
+
* @example
|
|
1021
|
+
* ```typescript
|
|
1022
|
+
* const data = await client.quant.minuteBatch({
|
|
1023
|
+
* symbols: ['000001', '600519'],
|
|
1024
|
+
* startDateTime: '2024-01-01 09:30:00',
|
|
1025
|
+
* endDateTime: '2024-01-01 15:00:00'
|
|
1026
|
+
* });
|
|
1027
|
+
* console.log(data);
|
|
1028
|
+
* ```
|
|
1029
|
+
*/
|
|
1030
|
+
minuteBatch(params: BatchMinuteParams): Promise<OHLCVData[]>;
|
|
939
1031
|
/**
|
|
940
1032
|
* Execute strategy backtest
|
|
941
1033
|
*
|
|
@@ -1189,19 +1281,28 @@ declare class AgentModule {
|
|
|
1189
1281
|
* Create a new agent conversation
|
|
1190
1282
|
*
|
|
1191
1283
|
* @param agentId - Agent ID
|
|
1192
|
-
* @param
|
|
1284
|
+
* @param options - Optional parameters
|
|
1285
|
+
* @param options.title - Conversation title
|
|
1286
|
+
* @param options.conversationType - Conversation type: "agent_chat", "task_chat", "debug_chat", "bot_chat"
|
|
1193
1287
|
*/
|
|
1194
|
-
createConversation(agentId: number,
|
|
1288
|
+
createConversation(agentId: number, options?: {
|
|
1289
|
+
title?: string;
|
|
1290
|
+
conversationType?: string;
|
|
1291
|
+
}): Promise<AgentConversation>;
|
|
1195
1292
|
/**
|
|
1196
1293
|
* Chat with agent in a conversation
|
|
1197
1294
|
*
|
|
1198
1295
|
* @param conversationId - Conversation ID
|
|
1199
1296
|
* @param message - User message
|
|
1200
1297
|
* @param options - Chat options
|
|
1298
|
+
* @param options.documents - Related documents
|
|
1299
|
+
* @param options.stream - Whether to use streaming response (default: true)
|
|
1300
|
+
* @param options.background - Whether to run agent task in background (default: false). When true, returns immediately without waiting for events.
|
|
1201
1301
|
*/
|
|
1202
1302
|
chat(conversationId: number, message: string, options?: {
|
|
1203
1303
|
documents?: DocumentInput[];
|
|
1204
1304
|
stream?: boolean;
|
|
1305
|
+
background?: boolean;
|
|
1205
1306
|
}): Promise<unknown>;
|
|
1206
1307
|
/**
|
|
1207
1308
|
* Get conversation details
|
|
@@ -1480,6 +1581,10 @@ declare class UserModule {
|
|
|
1480
1581
|
group_id: string;
|
|
1481
1582
|
name: string;
|
|
1482
1583
|
count: number;
|
|
1584
|
+
follow_values: Array<{
|
|
1585
|
+
follow_type: number;
|
|
1586
|
+
follow_value: string;
|
|
1587
|
+
}>;
|
|
1483
1588
|
}>;
|
|
1484
1589
|
/**
|
|
1485
1590
|
* Update a follow group
|
|
@@ -1758,4 +1863,4 @@ declare class Reportify {
|
|
|
1758
1863
|
getBytes(path: string): Promise<ArrayBuffer>;
|
|
1759
1864
|
}
|
|
1760
1865
|
|
|
1761
|
-
export { APIError, type AgentConversation, type AgentMessage, AgentModule, AuthenticationError, type BacktestParams, type BacktestResult, type BatchOHLCVParams, type Calendar, type Channel, ChannelsModule, type ChatCompletionOptions, type ChatCompletionResponse, type ChatMode, ChatModule, type Chunk, type ChunkSearchOptions, type CompanyInfo, type CompanyOverview, type Concept, type ConceptDoc, type ConceptEvent, type ConceptFeed, type ConceptStock, ConceptsModule, type DocsListOptions, DocsModule, type Document, type DocumentInput, type EarningsEvent, type EarningsSearchOptions, type FactorComputeParams, type FactorMeta, type FinancialStatement, type FollowedCompany, type IPOEvent, type IPOStatus, type IndexConstituent, type IndexFund, type IndicatorComputeParams, type IndicatorData, type IndicatorMeta, type IndustryConstituent, KBModule, type KBSearchOptions, type Market, NotFoundError, type OHLCVData, type OHLCVParams, type PaginatedResponse, type Period, type PriceData, QuantModule, type Quote, RateLimitError, Reportify, type ReportifyConfig, ReportifyError, type ScreenParams, type ScreenedStock, SearchModule, type SearchOptions, type Shareholder, type ShareholderType, type StockInfo, type StockMarket, StockModule, TimelineModule, type TimelineOptions, type UploadDocRequest, UserModule };
|
|
1866
|
+
export { APIError, type AgentConversation, type AgentMessage, AgentModule, AuthenticationError, type BacktestParams, type BacktestResult, type BatchKline1mParams, type BatchMinuteParams, type BatchOHLCVParams, type Calendar, type Channel, ChannelsModule, type ChatCompletionOptions, type ChatCompletionResponse, type ChatMode, ChatModule, type Chunk, type ChunkSearchOptions, type CompanyInfo, type CompanyOverview, type Concept, type ConceptDoc, type ConceptEvent, type ConceptFeed, type ConceptStock, ConceptsModule, type DocsListOptions, DocsModule, type Document, type DocumentInput, type EarningsEvent, type EarningsSearchOptions, type FactorComputeParams, type FactorMeta, type FinancialStatement, type FollowedCompany, type IPOEvent, type IPOStatus, type IndexConstituent, type IndexFund, type IndicatorComputeParams, type IndicatorData, type IndicatorMeta, type IndustryConstituent, KBModule, type KBSearchOptions, type Kline1mParams, type Market, type MinuteParams, NotFoundError, type OHLCVData, type OHLCVParams, type PaginatedResponse, type Period, type PriceData, QuantModule, type Quote, RateLimitError, Reportify, type ReportifyConfig, ReportifyError, type ScreenParams, type ScreenedStock, SearchModule, type SearchOptions, type Shareholder, type ShareholderType, type StockInfo, type StockMarket, StockModule, TimelineModule, type TimelineOptions, type UploadDocRequest, UserModule };
|
package/dist/index.js
CHANGED
|
@@ -834,6 +834,106 @@ var QuantModule = class {
|
|
|
834
834
|
});
|
|
835
835
|
return response.datas || [];
|
|
836
836
|
}
|
|
837
|
+
/**
|
|
838
|
+
* Get 1-minute kline data for a single symbol
|
|
839
|
+
*
|
|
840
|
+
* @param params - Kline parameters
|
|
841
|
+
* @returns Array of 1-minute kline data
|
|
842
|
+
*
|
|
843
|
+
* @example
|
|
844
|
+
* ```typescript
|
|
845
|
+
* const data = await client.quant.kline1m({
|
|
846
|
+
* symbol: '000001',
|
|
847
|
+
* startDateTime: '2024-01-01 09:30:00',
|
|
848
|
+
* endDateTime: '2024-01-01 15:00:00'
|
|
849
|
+
* });
|
|
850
|
+
* console.log(data);
|
|
851
|
+
* ```
|
|
852
|
+
*/
|
|
853
|
+
async kline1m(params) {
|
|
854
|
+
const response = await this.client.post("/v1/quant/quotes/1mkline", {
|
|
855
|
+
symbol: params.symbol,
|
|
856
|
+
start_datetime: params.startDateTime,
|
|
857
|
+
end_datetime: params.endDateTime,
|
|
858
|
+
market: params.market || "cn"
|
|
859
|
+
});
|
|
860
|
+
return response.datas || [];
|
|
861
|
+
}
|
|
862
|
+
/**
|
|
863
|
+
* Get batch 1-minute kline data for multiple symbols
|
|
864
|
+
*
|
|
865
|
+
* @param params - Batch kline parameters
|
|
866
|
+
* @returns Array of 1-minute kline data sorted by date (ascending), then by symbol
|
|
867
|
+
*
|
|
868
|
+
* @example
|
|
869
|
+
* ```typescript
|
|
870
|
+
* const data = await client.quant.kline1mBatch({
|
|
871
|
+
* symbols: ['000001', '600519'],
|
|
872
|
+
* startDateTime: '2024-01-01 09:30:00',
|
|
873
|
+
* endDateTime: '2024-01-01 15:00:00'
|
|
874
|
+
* });
|
|
875
|
+
* console.log(data);
|
|
876
|
+
* ```
|
|
877
|
+
*/
|
|
878
|
+
async kline1mBatch(params) {
|
|
879
|
+
const response = await this.client.post("/v1/quant/quotes/1mkline/batch", {
|
|
880
|
+
symbols: params.symbols,
|
|
881
|
+
start_datetime: params.startDateTime,
|
|
882
|
+
end_datetime: params.endDateTime,
|
|
883
|
+
market: params.market || "cn"
|
|
884
|
+
});
|
|
885
|
+
return response.datas || [];
|
|
886
|
+
}
|
|
887
|
+
/**
|
|
888
|
+
* Get minute data for a single symbol
|
|
889
|
+
*
|
|
890
|
+
* @param params - Minute parameters
|
|
891
|
+
* @returns Array of minute data
|
|
892
|
+
*
|
|
893
|
+
* @example
|
|
894
|
+
* ```typescript
|
|
895
|
+
* const data = await client.quant.minute({
|
|
896
|
+
* symbol: '000001',
|
|
897
|
+
* startDateTime: '2024-01-01 09:30:00',
|
|
898
|
+
* endDateTime: '2024-01-01 15:00:00'
|
|
899
|
+
* });
|
|
900
|
+
* console.log(data);
|
|
901
|
+
* ```
|
|
902
|
+
*/
|
|
903
|
+
async minute(params) {
|
|
904
|
+
const response = await this.client.post("/v1/quant/quotes/minute", {
|
|
905
|
+
symbol: params.symbol,
|
|
906
|
+
start_datetime: params.startDateTime,
|
|
907
|
+
end_datetime: params.endDateTime,
|
|
908
|
+
market: params.market || "cn"
|
|
909
|
+
});
|
|
910
|
+
return response.datas || [];
|
|
911
|
+
}
|
|
912
|
+
/**
|
|
913
|
+
* Get batch minute data for multiple symbols
|
|
914
|
+
*
|
|
915
|
+
* @param params - Batch minute parameters
|
|
916
|
+
* @returns Array of minute data sorted by date (ascending), then by symbol
|
|
917
|
+
*
|
|
918
|
+
* @example
|
|
919
|
+
* ```typescript
|
|
920
|
+
* const data = await client.quant.minuteBatch({
|
|
921
|
+
* symbols: ['000001', '600519'],
|
|
922
|
+
* startDateTime: '2024-01-01 09:30:00',
|
|
923
|
+
* endDateTime: '2024-01-01 15:00:00'
|
|
924
|
+
* });
|
|
925
|
+
* console.log(data);
|
|
926
|
+
* ```
|
|
927
|
+
*/
|
|
928
|
+
async minuteBatch(params) {
|
|
929
|
+
const response = await this.client.post("/v1/quant/quotes/minute/batch", {
|
|
930
|
+
symbols: params.symbols,
|
|
931
|
+
start_datetime: params.startDateTime,
|
|
932
|
+
end_datetime: params.endDateTime,
|
|
933
|
+
market: params.market || "cn"
|
|
934
|
+
});
|
|
935
|
+
return response.datas || [];
|
|
936
|
+
}
|
|
837
937
|
// ===========================================================================
|
|
838
938
|
// Backtest
|
|
839
939
|
// ===========================================================================
|
|
@@ -1110,11 +1210,14 @@ var AgentModule = class {
|
|
|
1110
1210
|
* Create a new agent conversation
|
|
1111
1211
|
*
|
|
1112
1212
|
* @param agentId - Agent ID
|
|
1113
|
-
* @param
|
|
1213
|
+
* @param options - Optional parameters
|
|
1214
|
+
* @param options.title - Conversation title
|
|
1215
|
+
* @param options.conversationType - Conversation type: "agent_chat", "task_chat", "debug_chat", "bot_chat"
|
|
1114
1216
|
*/
|
|
1115
|
-
async createConversation(agentId,
|
|
1217
|
+
async createConversation(agentId, options = {}) {
|
|
1116
1218
|
const body = { agent_id: agentId };
|
|
1117
|
-
if (title) body.title = title;
|
|
1219
|
+
if (options.title) body.title = options.title;
|
|
1220
|
+
if (options.conversationType) body.conversation_type = options.conversationType;
|
|
1118
1221
|
const response = await this.client.post("/v1/agent/conversations", body);
|
|
1119
1222
|
return {
|
|
1120
1223
|
id: response.id,
|
|
@@ -1133,11 +1236,15 @@ var AgentModule = class {
|
|
|
1133
1236
|
* @param conversationId - Conversation ID
|
|
1134
1237
|
* @param message - User message
|
|
1135
1238
|
* @param options - Chat options
|
|
1239
|
+
* @param options.documents - Related documents
|
|
1240
|
+
* @param options.stream - Whether to use streaming response (default: true)
|
|
1241
|
+
* @param options.background - Whether to run agent task in background (default: false). When true, returns immediately without waiting for events.
|
|
1136
1242
|
*/
|
|
1137
1243
|
async chat(conversationId, message, options = {}) {
|
|
1138
1244
|
const body = {
|
|
1139
1245
|
message,
|
|
1140
|
-
stream: options.stream ?? true
|
|
1246
|
+
stream: options.stream ?? true,
|
|
1247
|
+
background: options.background ?? false
|
|
1141
1248
|
};
|
|
1142
1249
|
if (options.documents) {
|
|
1143
1250
|
body.documents = options.documents.map((doc) => ({
|
package/dist/index.mjs
CHANGED
|
@@ -792,6 +792,106 @@ var QuantModule = class {
|
|
|
792
792
|
});
|
|
793
793
|
return response.datas || [];
|
|
794
794
|
}
|
|
795
|
+
/**
|
|
796
|
+
* Get 1-minute kline data for a single symbol
|
|
797
|
+
*
|
|
798
|
+
* @param params - Kline parameters
|
|
799
|
+
* @returns Array of 1-minute kline data
|
|
800
|
+
*
|
|
801
|
+
* @example
|
|
802
|
+
* ```typescript
|
|
803
|
+
* const data = await client.quant.kline1m({
|
|
804
|
+
* symbol: '000001',
|
|
805
|
+
* startDateTime: '2024-01-01 09:30:00',
|
|
806
|
+
* endDateTime: '2024-01-01 15:00:00'
|
|
807
|
+
* });
|
|
808
|
+
* console.log(data);
|
|
809
|
+
* ```
|
|
810
|
+
*/
|
|
811
|
+
async kline1m(params) {
|
|
812
|
+
const response = await this.client.post("/v1/quant/quotes/1mkline", {
|
|
813
|
+
symbol: params.symbol,
|
|
814
|
+
start_datetime: params.startDateTime,
|
|
815
|
+
end_datetime: params.endDateTime,
|
|
816
|
+
market: params.market || "cn"
|
|
817
|
+
});
|
|
818
|
+
return response.datas || [];
|
|
819
|
+
}
|
|
820
|
+
/**
|
|
821
|
+
* Get batch 1-minute kline data for multiple symbols
|
|
822
|
+
*
|
|
823
|
+
* @param params - Batch kline parameters
|
|
824
|
+
* @returns Array of 1-minute kline data sorted by date (ascending), then by symbol
|
|
825
|
+
*
|
|
826
|
+
* @example
|
|
827
|
+
* ```typescript
|
|
828
|
+
* const data = await client.quant.kline1mBatch({
|
|
829
|
+
* symbols: ['000001', '600519'],
|
|
830
|
+
* startDateTime: '2024-01-01 09:30:00',
|
|
831
|
+
* endDateTime: '2024-01-01 15:00:00'
|
|
832
|
+
* });
|
|
833
|
+
* console.log(data);
|
|
834
|
+
* ```
|
|
835
|
+
*/
|
|
836
|
+
async kline1mBatch(params) {
|
|
837
|
+
const response = await this.client.post("/v1/quant/quotes/1mkline/batch", {
|
|
838
|
+
symbols: params.symbols,
|
|
839
|
+
start_datetime: params.startDateTime,
|
|
840
|
+
end_datetime: params.endDateTime,
|
|
841
|
+
market: params.market || "cn"
|
|
842
|
+
});
|
|
843
|
+
return response.datas || [];
|
|
844
|
+
}
|
|
845
|
+
/**
|
|
846
|
+
* Get minute data for a single symbol
|
|
847
|
+
*
|
|
848
|
+
* @param params - Minute parameters
|
|
849
|
+
* @returns Array of minute data
|
|
850
|
+
*
|
|
851
|
+
* @example
|
|
852
|
+
* ```typescript
|
|
853
|
+
* const data = await client.quant.minute({
|
|
854
|
+
* symbol: '000001',
|
|
855
|
+
* startDateTime: '2024-01-01 09:30:00',
|
|
856
|
+
* endDateTime: '2024-01-01 15:00:00'
|
|
857
|
+
* });
|
|
858
|
+
* console.log(data);
|
|
859
|
+
* ```
|
|
860
|
+
*/
|
|
861
|
+
async minute(params) {
|
|
862
|
+
const response = await this.client.post("/v1/quant/quotes/minute", {
|
|
863
|
+
symbol: params.symbol,
|
|
864
|
+
start_datetime: params.startDateTime,
|
|
865
|
+
end_datetime: params.endDateTime,
|
|
866
|
+
market: params.market || "cn"
|
|
867
|
+
});
|
|
868
|
+
return response.datas || [];
|
|
869
|
+
}
|
|
870
|
+
/**
|
|
871
|
+
* Get batch minute data for multiple symbols
|
|
872
|
+
*
|
|
873
|
+
* @param params - Batch minute parameters
|
|
874
|
+
* @returns Array of minute data sorted by date (ascending), then by symbol
|
|
875
|
+
*
|
|
876
|
+
* @example
|
|
877
|
+
* ```typescript
|
|
878
|
+
* const data = await client.quant.minuteBatch({
|
|
879
|
+
* symbols: ['000001', '600519'],
|
|
880
|
+
* startDateTime: '2024-01-01 09:30:00',
|
|
881
|
+
* endDateTime: '2024-01-01 15:00:00'
|
|
882
|
+
* });
|
|
883
|
+
* console.log(data);
|
|
884
|
+
* ```
|
|
885
|
+
*/
|
|
886
|
+
async minuteBatch(params) {
|
|
887
|
+
const response = await this.client.post("/v1/quant/quotes/minute/batch", {
|
|
888
|
+
symbols: params.symbols,
|
|
889
|
+
start_datetime: params.startDateTime,
|
|
890
|
+
end_datetime: params.endDateTime,
|
|
891
|
+
market: params.market || "cn"
|
|
892
|
+
});
|
|
893
|
+
return response.datas || [];
|
|
894
|
+
}
|
|
795
895
|
// ===========================================================================
|
|
796
896
|
// Backtest
|
|
797
897
|
// ===========================================================================
|
|
@@ -1068,11 +1168,14 @@ var AgentModule = class {
|
|
|
1068
1168
|
* Create a new agent conversation
|
|
1069
1169
|
*
|
|
1070
1170
|
* @param agentId - Agent ID
|
|
1071
|
-
* @param
|
|
1171
|
+
* @param options - Optional parameters
|
|
1172
|
+
* @param options.title - Conversation title
|
|
1173
|
+
* @param options.conversationType - Conversation type: "agent_chat", "task_chat", "debug_chat", "bot_chat"
|
|
1072
1174
|
*/
|
|
1073
|
-
async createConversation(agentId,
|
|
1175
|
+
async createConversation(agentId, options = {}) {
|
|
1074
1176
|
const body = { agent_id: agentId };
|
|
1075
|
-
if (title) body.title = title;
|
|
1177
|
+
if (options.title) body.title = options.title;
|
|
1178
|
+
if (options.conversationType) body.conversation_type = options.conversationType;
|
|
1076
1179
|
const response = await this.client.post("/v1/agent/conversations", body);
|
|
1077
1180
|
return {
|
|
1078
1181
|
id: response.id,
|
|
@@ -1091,11 +1194,15 @@ var AgentModule = class {
|
|
|
1091
1194
|
* @param conversationId - Conversation ID
|
|
1092
1195
|
* @param message - User message
|
|
1093
1196
|
* @param options - Chat options
|
|
1197
|
+
* @param options.documents - Related documents
|
|
1198
|
+
* @param options.stream - Whether to use streaming response (default: true)
|
|
1199
|
+
* @param options.background - Whether to run agent task in background (default: false). When true, returns immediately without waiting for events.
|
|
1094
1200
|
*/
|
|
1095
1201
|
async chat(conversationId, message, options = {}) {
|
|
1096
1202
|
const body = {
|
|
1097
1203
|
message,
|
|
1098
|
-
stream: options.stream ?? true
|
|
1204
|
+
stream: options.stream ?? true,
|
|
1205
|
+
background: options.background ?? false
|
|
1099
1206
|
};
|
|
1100
1207
|
if (options.documents) {
|
|
1101
1208
|
body.documents = options.documents.map((doc) => ({
|