http://127.0.0.1:11434/api/generate

使用http post请求,参数

{ 
 "model": "qwen", 
 "prompt": "为什么天空是蓝色?", 
 "stream": false 
}

返回结果如下:

{
	"model": "qwen",
	"created_at": "2024-05-10T15:03:49.9029106Z",
	"response": "天空为什么是蓝色的呢?这是因为大气中的空气分子散射太阳光,其中波长较短的紫光和红光被大量吸收,而波长大于蓝光的黄光和橙光则通过少量的大气分子而散射出来。因此,在日出时,由于阳光需要穿过更长的大气层路径才能到达地面,所以光线在穿越大气层过程中被大量的空气分子所散射,使得太阳光中的颜色被分散,呈现出一种淡黄色的颜色。这就是为什么天空在日出时呈现为淡黄色的原因。",
	"done": true,
	"context": [
		151644,
		872,
		198,
		100678,
		101916,
		20412,
		105681,
		30,
		151645,
		198,
		151644,
		77091,
		198,
		101916,
		100678,
		20412,
		105681,
		9370,
		101036,
		11319,
		109989,
		105797,
		101047,
		100819,
		102388,
		99632,
		99759,
		101281,
		99225,
		3837,
		90919,
		99804,
		45861,
		99260,
		99534,
		9370,
		101168,
		99225,
		33108,
		99425,
		99225,
		99250,
		100722,
		104460,
		3837,
		68536,
		99804,
		102829,
		34204,
		100400,
		99225,
		9370,
		99789,
		99225,
		33108,
		107678,
		99225,
		46448,
		67338,
		108521,
		104197,
		99180,
		102388,
		68536,
		99632,
		99759,
		99898,
		1773,
		101886,
		3837,
		18493,
		8903,
		20221,
		13343,
		3837,
		101887,
		104166,
		85106,
		109239,
		33126,
		45861,
		104197,
		99180,
		99371,
		76837,
		101901,
		104658,
		104722,
		3837,
		99999,
		109587,
		18493,
		106063,
		105797,
		99371,
		101925,
		99250,
		101514,
		100819,
		102388,
		31838,
		99632,
		99759,
		3837,
		104193,
		101281,
		99225,
		101047,
		102284,
		99250,
		105211,
		3837,
		107433,
		101053,
		99773,
		106140,
		108901,
		1773,
		104301,
		100678,
		101916,
		18493,
		8903,
		20221,
		13343,
		104401,
		17714,
		99773,
		106140,
		104249,
		1773
	],
	"total_duration": 39132770800,
	"load_duration": 9506095200,
	"prompt_eval_count": 13,
	"prompt_eval_duration": 1913722000,
	"eval_count": 118,
	"eval_duration": 27710203000
}
05-11 06:10