Skip to content

Commit

Permalink
feat: 移除模型名的强制小写转换 (#889)
Browse files Browse the repository at this point in the history
* 移除模型名的强制小写转换

* 更新版本号

* 固化 poetry 版本号为 1.8.2

* 解决python 小于 3.7 时找不到 poetry 的问题

* 固化版本号

* Java 侧修改逻辑支持 V2 DeepSeek
  • Loading branch information
Dobiichi-Origami authored Feb 5, 2025
1 parent d01fc59 commit 1230d82
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/doc_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
python-version: ${{matrix.python-version}}
- name: Install Poetry
run: |
pip install poetry
pip install 'poetry~=1.0'
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
poetry lock --no-update
- name: Get Poetry version
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/go_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
python-version: ${{matrix.python-version}}
- name: Install Poetry
run: |
pip install poetry
pip install 'poetry~=1.0'
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
cd python && poetry lock --no-update
- name: Setup Python Cache
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/go_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- name: Install latest version of Poetry
if: steps.cache-poetry.outputs.cache-hit != 'true'
run: |
pip install poetry
pip install 'poetry~=1.0'
- name: Add Poetry to $PATH
run: |
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/js_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
python-version: 3.11
- name: Install Poetry
run: |
pip install poetry
pip install 'poetry~=1.0'
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
cd python && poetry lock --no-update
- name: Setup Python Cache
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/js_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
python-version: 3.11
- name: Install Poetry
run: |
pip install poetry
pip install 'poetry~=1.0'
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
cd python && poetry lock --no-update
- name: Setup Python Cache
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/py_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,12 @@ jobs:
- '3.10'
- '3.11'
exclude:
- { python-version: "3.7", os: "ubuntu-latest" }
- { python-version: "3.7", os: "macos-latest" }
- { python-version: "3.8", os: "macos-latest" }
- { python-version: "3.9", os: "macos-latest" }
include:
- { python-version: "3.7", os: "ubuntu-20.04" }
- { python-version: "3.7", os: "macos-13" }
- { python-version: "3.8", os: "macos-13" }
- { python-version: "3.9", os: "macos-13" }
Expand All @@ -53,7 +55,7 @@ jobs:
python-version: ${{matrix.python-version}}
- name: Install Poetry
run: |
pip install poetry
pip install 'poetry~=1.0'
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
- name: Get Poetry version
run: poetry --version
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ build:
python: "3.11"
jobs:
post_create_environment:
- pip install poetry
- pip install 'poetry~=1.0'
- poetry config virtualenvs.create false
post_install:
- make install
Expand Down
2 changes: 1 addition & 1 deletion java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.baidubce</groupId>
<artifactId>qianfan</artifactId>
<version>0.1.3</version>
<version>0.1.4</version>
<packaging>jar</packaging>

<name>qianfan</name>
Expand Down
5 changes: 2 additions & 3 deletions java/src/main/java/com/baidubce/qianfan/QianfanClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
import java.util.Map;

class QianfanClient {
private static final String SDK_VERSION = "0.1.3";
private static final String SDK_VERSION = "0.1.4";
private static final String CONSOLE_URL_NO_ACTION_TEMPLATE = "%s%s";
private static final String CONSOLE_URL_ACTION_TEMPLATE = "%s%s?Action=%s";
private static final String QIANFAN_URL_TEMPLATE = "%s/rpc/2.0/ai_custom/v1/wenxinworkshop%s";
Expand Down Expand Up @@ -105,12 +105,11 @@ public <T extends BaseResponse<T>, U extends BaseRequest<U>> StreamIterator<T> r
}

private <T extends BaseRequest<T>> HttpRequest createHttpRequest(BaseRequest<T> baseRequest) {
String finalEndpoint = endpointRetriever.getEndpoint(baseRequest.getType(), baseRequest.getModel(), baseRequest.getEndpoint());

String url;
if (auth.authType().equals(Auth.TYPE_V2)) {
url = String.format(QIANFAN_V2_URL_TEMPLATE, QianfanConfig.getConsoleApiBaseUrl());
} else {
String finalEndpoint = endpointRetriever.getEndpoint(baseRequest.getType(), baseRequest.getModel(), baseRequest.getEndpoint());
url = String.format(QIANFAN_URL_TEMPLATE, QianfanConfig.getBaseUrl(), finalEndpoint);
}
baseRequest.getExtraParameters().put(EXTRA_PARAM_REQUEST_SOURCE, REQUEST_SOURCE);
Expand Down
2 changes: 1 addition & 1 deletion python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "qianfan"
version = "0.4.12.2"
version = "0.4.12.3"
description = "文心千帆大模型平台 Python SDK"
authors = []
license = "Apache-2.0"
Expand Down
1 change: 0 additions & 1 deletion python/qianfan/resources/llm/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1194,7 +1194,6 @@ def _generate_body(
body["model"] = self._model
else:
body["model"] = self._default_model()
body["model"] = body["model"].lower()
return body

@classmethod
Expand Down

0 comments on commit 1230d82

Please sign in to comment.