# \LlmApi

所有 URI 都相对于 *http://localhost*

方法 | HTTP 请求 | 描述
------------- | ------------- | -------------
[**google_file_upload**](LlmApi.md#google_file_upload) | **POST** /api/llm/google/vertex-ai/upload | 上传文件到谷歌存储,用于gemini视觉功能
[**invoke_gemini_ai_api_llm_google_chat_post**](LlmApi.md#invoke_gemini_ai_api_llm_google_chat_post) | **POST** /api/llm/google/chat | 调用google推理
[**invoke_media_analysis_api_llm_google_sync_media_analysis_post**](LlmApi.md#invoke_media_analysis_api_llm_google_sync_media_analysis_post) | **POST** /api/llm/google/sync/media/analysis | 【同步适合小文件】gemini多模态分析,支持视频,音频,图片
[**llm_chat**](LlmApi.md#llm_chat) | **POST** /api/llm/chat | 调用大模型进行推理
[**llm_supported_models**](LlmApi.md#llm_supported_models) | **GET** /api/llm/model/list | 获取支持的模型列表
[**llm_task_id**](LlmApi.md#llm_task_id) | **GET** /api/llm/task/status | 查询推理过程结果
[**submit_media_inference_api_llm_google_async_media_analysis_post**](LlmApi.md#submit_media_inference_api_llm_google_async_media_analysis_post) | **POST** /api/llm/google/async/media/analysis | 【异步适合需要长时间的推理过程】gemini多模态分析,支持视频,音频,图片



## google_file_upload

> serde_json::Value google_file_upload(local_file)
上传文件到谷歌存储,用于gemini视觉功能

Args:         local_file:  本地文件支持 音频,视频, 图片       Returns:   {     \"status\": \"状态信息, true 成功, false 失败\",    \"data\": \"gs://fashion_image_block/gallery_v2/mp4/1f76996f-a13e-450e-8c86-029c398932c4.mp4\", 分析媒体时候使用该字段   \"msg\": \"\",   \"extra\": 原始信息 }

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**local_file** | **std::path::PathBuf** | 本地文件 | [required] |

### Return type

[**serde_json::Value**](serde_json::Value.md)

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: multipart/form-data
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)


## invoke_gemini_ai_api_llm_google_chat_post

> serde_json::Value invoke_gemini_ai_api_llm_google_chat_post(prompt, timeout)
调用google推理

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**prompt** | **String** | prompt输入 | [required] |
**timeout** | Option<**f64**> | 超时时间 |  |[default to 180]

### Return type

[**serde_json::Value**](serde_json::Value.md)

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: application/x-www-form-urlencoded
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)


## invoke_media_analysis_api_llm_google_sync_media_analysis_post

> serde_json::Value invoke_media_analysis_api_llm_google_sync_media_analysis_post(text_prompt, media_uri)
【同步适合小文件】gemini多模态分析,支持视频,音频,图片

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**text_prompt** | **String** | 文本提示词 | [required] |
**media_uri** | **String** | gs:xxxx, 上传到谷歌vertex ai 上的链接 | [required] |

### Return type

[**serde_json::Value**](serde_json::Value.md)

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: application/x-www-form-urlencoded
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)


## llm_chat

> serde_json::Value llm_chat(prompt, model_name, temperature, max_tokens, timeout)
调用大模型进行推理

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**prompt** | **String** | prompt输入 | [required] |
**model_name** | Option<**String**> | 模型名称, 从/model/list接口获取 |  |[default to gemini-2.5-flash]
**temperature** | Option<**f64**> | 模型的温度值 |  |[default to 0.7]
**max_tokens** | Option<**i32**> | 最大token值 |  |[default to 4096]
**timeout** | Option<**f64**> | 超时时间,推理 |  |[default to 180]

### Return type

[**serde_json::Value**](serde_json::Value.md)

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: application/x-www-form-urlencoded
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)


## llm_supported_models

> serde_json::Value llm_supported_models()
获取支持的模型列表

### Parameters

This endpoint does not need any parameter.

### Return type

[**serde_json::Value**](serde_json::Value.md)

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)


## llm_task_id

> serde_json::Value llm_task_id(task_id)
查询推理过程结果

Args:     task_id: 任务id   Returns:      {'status': '值为字符串的时候标识任务运行的状态,为布尔值时,标识任务运行完毕！', 'data': '', 'msg': ''}

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**task_id** | **String** | 任务id | [required] |

### Return type

[**serde_json::Value**](serde_json::Value.md)

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)


## submit_media_inference_api_llm_google_async_media_analysis_post

> serde_json::Value submit_media_inference_api_llm_google_async_media_analysis_post(text_prompt, media_uri)
【异步适合需要长时间的推理过程】gemini多模态分析,支持视频,音频,图片

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**text_prompt** | **String** | 文本提示词 | [required] |
**media_uri** | **String** | gs:xxxx, 上传到谷歌vertex ai 上的链接 | [required] |

### Return type

[**serde_json::Value**](serde_json::Value.md)

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: application/x-www-form-urlencoded
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

