Skip to content

Adding an instruction and model type field. #32733

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,12 @@ model DocumentTranslateBody {
@query("allowFallback")
allowFallback?: boolean;

@doc("""
Specifies the input string is designed to be submitted to a GPT model for translation
""")
@query("translateQuery")
translateQuery?: boolean;

@doc("Content Type as multipart/form-data")
@header
contentType: "multipart/form-data";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"toScript": "Latn",
"allowFallback": true,
"api-version": "3.0",
"translateQuery": false,
"body": [
{
"text": "This is a test."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ alias CommonParameters = {
model InputTextItem {
@doc("Text to translate.")
text: string;
@doc("Text field allowing a natural language description of the needed translation")
instruction?: string;
}

alias CommonResultHeaders = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@ model TranslateParameters {
""")
includeSentenceLength?: boolean = false;

@query
@doc("""
Specifies the type of model which the input text will be submitted to for translation.
Possible values are: DNN (default), GPT4, GPT4Mini
""")
modelType?: string;

@query
@doc("""
Specifies a fallback language if the language of the input text can't be identified.
Expand Down Expand Up @@ -109,6 +116,12 @@ model TranslateParameters {
specifies that the service is allowed to fall back to a general system when a custom system doesn't exist.
""")
allowFallback?: boolean = true;

@query
@doc("""
Specifies the input string designed to be submitted to a GPT model for translation
""")
translateQuery?: boolean = false;
}

@doc("Response for the translation API.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"fromScript": "Latn",
"toScript": "Latn",
"allowFallback": true,
"translateQuery": false,
"api-version": "3.0",
"body": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,9 @@
{
"$ref": "#/parameters/TranslateParameters.allowFallback"
},
{
"$ref": "#/parameters/TranslateParameters.translateQuery"
},
{
"name": "api-version",
"in": "query",
Expand Down Expand Up @@ -1522,6 +1525,15 @@
},
"x-ms-parameter-location": "method"
},
"TranslateParameters.translateQuery": {
"name": "translateQuery",
"in": "query",
"description": "Specifies whether the input body parameter is intended as a GPT translate query",
"required": false,
"type": "boolean",
"default": false,
"x-ms-parameter-location": "method"
},
"TranslateParameters.suggestedFrom": {
"name": "suggestedFrom",
"in": "query",
Expand Down
Loading